Red Gate forums :: View topic - Need to script a table into a Select statement with datatype
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Doc 2
SQL Doc 2 forum

Need to script a table into a Select statement with datatype

Search in SQL Doc 2 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
paputzback



Joined: 18 Jul 2012
Posts: 4

PostPosted: Fri Aug 02, 2013 4:06 pm    Post subject: Need to script a table into a Select statement with datatype Reply with quote

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.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1121
Location: My desk.

PostPosted: Mon Aug 05, 2013 2:41 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group