February 20th, 2012, 03:56 PM
How to read from a text file in SQL query ?
I am creating a SSIS package which reads from a table & outputs a text file. In the SQL that is being used I have a WHERE condition:
SELECT COLUMN_NAME FROM TABLE_99
WHERE FISCAL_YR = '2012'.
Instead of hard coding the year '2012', I would like to pass the year from a text file? That way the user can just change the text file's year when the fiscal year changes.
How do I pass the year as a parameter into the SQL query?
I am using SQL server management studio (SQL 2008).