Need to script a table into a Select statement with datatype
paputzback
Posts: 13
I was given a stored procedure to turn into an SSIS package and the proc has temp tables. From what I have found on the web I need to script out a an empty select statement from the final query in the proc and put it in the top of the procedure in able to get SSIS to pull in column information in the OLE DB Source editor. Here is the example that I am going off of:
IF 1 = 2
BEGIN
SELECT CAST(NULL AS INT) AS ContactID,CAST(NULL AS NVARCHAR(50)) AS FirstName,
CAST(NULL AS NVARCHAR(50)) AS MiddleName, CAST(NULL AS NVARCHAR(50)) AS LastName,
CAST(NULL AS NVARCHAR(10)) AS Suffix, CAST(NULL AS NVARCHAR(50)) AS EmailAddress
END
I believe I have the SQL Developer bundle. Perhaps there is a tool in it for this.
IF 1 = 2
BEGIN
SELECT CAST(NULL AS INT) AS ContactID,CAST(NULL AS NVARCHAR(50)) AS FirstName,
CAST(NULL AS NVARCHAR(50)) AS MiddleName, CAST(NULL AS NVARCHAR(50)) AS LastName,
CAST(NULL AS NVARCHAR(10)) AS Suffix, CAST(NULL AS NVARCHAR(50)) AS EmailAddress
END
I believe I have the SQL Developer bundle. Perhaps there is a tool in it for this.
Comments
The only tool that helps you write SQL is SQL Prompt, but it doesn't auto-generate code in the fashion you describe. Sorry.
Redgate Software