May 18, 2011 at 2:10 pm
Hi I have a table that contains SQL Query's and a table that contain list of server names .Now for each server i have to connect and run each SQL Query's from the table we have .So While running the query's i may get different columns .So is there any way i can capture the data and create dynamic columns and table for each query i run ?
Thanks in Advance
May 19, 2011 at 12:27 am
What kind of queries are those? All SELECT?
If you want to dynamically create tables based on the data you selected, I would use the SELECT ... INTO syntax.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
May 19, 2011 at 7:21 am
Hi !
Yes all the queries are select and they get different data with different structure of columns,So in the run time when the queries are run against the server ,I need to capture these data for each query in destination tables(different tables)
May 19, 2011 at 7:57 am
And you can't use SELECT INTO because... ?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
May 19, 2011 at 8:13 am
Hi !
I won't be able to use select into as i will be running the multiple query's to a multiple servers(around 400) by looping to each server.
May 19, 2011 at 8:20 am
And why is that a problem?
You just create a table with the same name on each server.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
May 19, 2011 at 8:22 am
Setting up dynamic columns in SSIS (or any ETL tool) is not really that easy as it's not what SSIS was designed for.
It can be done but usually involves using custom scripting, instead I would look at using SELECT INTO, or another T-sql method to do this.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply