Need to script a table into a Select statement with datatype

paputzbackpaputzback Posts: 13
edited August 5, 2013 9:41AM in SQL Doc Previous Versions
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.

Comments

  • James BJames B Silver 4 Posts: 1,124 Silver 4
    Thanks for your post- I don't think any of our tools are likely to help you here unfortunately.

    The only tool that helps you write SQL is SQL Prompt, but it doesn't auto-generate code in the fashion you describe. Sorry.
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.