dbTalk Databases Forums  

Dynamic SQL Statement at Runtime SSIS SQL Server 2005

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Dynamic SQL Statement at Runtime SSIS SQL Server 2005 in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Doug
 
Posts: n/a

Default Dynamic SQL Statement at Runtime SSIS SQL Server 2005 - 10-17-2005 , 09:55 PM






Sorry if this is inappropriate in DTS ... this was the closest I could find
for 2005 and SSIS.

I'm trying to create a single, all-purpose SSIS package that would move data
from a source database table to a matching target database table. The
requirement is to create the package such that the SQL statement used by SSIS
could be supplied at runtime. This would allow a single package to be used
for different SQL statements, representing different tables, rows and
columns, etc. as needed. The data movement combinations are highly variable,
so I'm hoping to find a flexible one-size-fits-all solution with a single
package.

I've looked at setting up a string variable for the SQL statement, and
populating it at runtime using a config file or command line SET statement.
The package is initially built with a temporary SQL statement for the
variable ("select x from dual" -- appologies to the Oracle folks.) When I
use a config file and substitute in the SQL statement I want to use on a
given run (i.e. select * from myTable) SSIS complains about verification,
column mismatch problems, etc. I've played with shutting off validation, but
I'm not sure how to get around the output and metadata column problems, etc.

I'd like to try to avoid writing custom components w/ C# for this. Before I
go down that route I was wondering if anyone had tried this or had a
suggestion.

Thanks so much!

--
Doug

Reply With Quote
  #2  
Old   
Andrew Watt [MVP - InfoPath]
 
Posts: n/a

Default Re: Dynamic SQL Statement at Runtime SSIS SQL Server 2005 - 10-18-2005 , 02:59 AM






Doug,

Have you looked at creating a wrapper (parent) package that could pass
in a variable? I don't know that that would work for this scenario but
it *might* get round the mismatch problems. Maybe worth exploring?

Andrew Watt
MVP - InfoPath

On Mon, 17 Oct 2005 19:55:03 -0700, "Doug"
<Doug (AT) discussions (DOT) microsoft.com> wrote:

Quote:
Sorry if this is inappropriate in DTS ... this was the closest I could find
for 2005 and SSIS.

I'm trying to create a single, all-purpose SSIS package that would move data
from a source database table to a matching target database table. The
requirement is to create the package such that the SQL statement used by SSIS
could be supplied at runtime. This would allow a single package to be used
for different SQL statements, representing different tables, rows and
columns, etc. as needed. The data movement combinations are highly variable,
so I'm hoping to find a flexible one-size-fits-all solution with a single
package.

I've looked at setting up a string variable for the SQL statement, and
populating it at runtime using a config file or command line SET statement.
The package is initially built with a temporary SQL statement for the
variable ("select x from dual" -- appologies to the Oracle folks.) When I
use a config file and substitute in the SQL statement I want to use on a
given run (i.e. select * from myTable) SSIS complains about verification,
column mismatch problems, etc. I've played with shutting off validation, but
I'm not sure how to get around the output and metadata column problems, etc.

I'd like to try to avoid writing custom components w/ C# for this. Before I
go down that route I was wondering if anyone had tried this or had a
suggestion.

Thanks so much!

--
Doug


Reply With Quote
  #3  
Old   
Doug
 
Posts: n/a

Default Re: Dynamic SQL Statement at Runtime SSIS SQL Server 2005 - 10-18-2005 , 06:07 AM



Hi Andrew ..

I have not tried to use a wrapper to pass in a variable. I have tried
setting the variable at runtime w/ a config and also w/ a command line SET.
Do you know if the wrapper technique would give me a better result? I'm
wondering if I would still have the same column and validation issues.

Thanks so much!!!
--
Doug


"Andrew Watt [MVP - InfoPath]" wrote:

Quote:
Doug,

Have you looked at creating a wrapper (parent) package that could pass
in a variable? I don't know that that would work for this scenario but
it *might* get round the mismatch problems. Maybe worth exploring?

Andrew Watt
MVP - InfoPath

On Mon, 17 Oct 2005 19:55:03 -0700, "Doug"
Doug (AT) discussions (DOT) microsoft.com> wrote:

Sorry if this is inappropriate in DTS ... this was the closest I could find
for 2005 and SSIS.

I'm trying to create a single, all-purpose SSIS package that would move data
from a source database table to a matching target database table. The
requirement is to create the package such that the SQL statement used by SSIS
could be supplied at runtime. This would allow a single package to be used
for different SQL statements, representing different tables, rows and
columns, etc. as needed. The data movement combinations are highly variable,
so I'm hoping to find a flexible one-size-fits-all solution with a single
package.

I've looked at setting up a string variable for the SQL statement, and
populating it at runtime using a config file or command line SET statement.
The package is initially built with a temporary SQL statement for the
variable ("select x from dual" -- appologies to the Oracle folks.) When I
use a config file and substitute in the SQL statement I want to use on a
given run (i.e. select * from myTable) SSIS complains about verification,
column mismatch problems, etc. I've played with shutting off validation, but
I'm not sure how to get around the output and metadata column problems, etc.

I'd like to try to avoid writing custom components w/ C# for this. Before I
go down that route I was wondering if anyone had tried this or had a
suggestion.

Thanks so much!

--
Doug



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.