dbTalk Databases Forums  

Parameter don't work in TSQL

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


Discuss Parameter don't work in TSQL in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #31  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: Parameter don't work in TSQL - 04-03-2008 , 03:32 AM






Hi Francisco,

Firstly, I'm assuming you're using SSIS and not DTS2000 .. if you're
using DTS then you need to write an ActiveX script which I'm afraid I
can't help you with because I don't have a copy of SQL2k installed
anymore.

In SSIS:
1) Select the "Expressions" option in the left pane of the ExecuteSQL
task editor and click the "..." button next to Expressions on the
right pane.
2) Select the "SqlStatementSource" property, and open the Expression
Builder ("..." button again)
3) Type your SQL statement into the Expression box. Something like:
"INSERT INTO PackageSystemAudit (PackageName, ...
VALUES ('" + @[User::PackageName] + "', '" + @[User::Param2] + ...

You can evaluate the expression to check that it's generating the
expected results. This expression will generate the SQL statement at
runtime using the current package variable values.

Good luck!
J

Reply With Quote
  #32  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: Parameter don't work in TSQL - 04-03-2008 , 03:32 AM






Hi Francisco,

Firstly, I'm assuming you're using SSIS and not DTS2000 .. if you're
using DTS then you need to write an ActiveX script which I'm afraid I
can't help you with because I don't have a copy of SQL2k installed
anymore.

In SSIS:
1) Select the "Expressions" option in the left pane of the ExecuteSQL
task editor and click the "..." button next to Expressions on the
right pane.
2) Select the "SqlStatementSource" property, and open the Expression
Builder ("..." button again)
3) Type your SQL statement into the Expression box. Something like:
"INSERT INTO PackageSystemAudit (PackageName, ...
VALUES ('" + @[User::PackageName] + "', '" + @[User::Param2] + ...

You can evaluate the expression to check that it's generating the
expected results. This expression will generate the SQL statement at
runtime using the current package variable values.

Good luck!
J

Reply With Quote
  #33  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: Parameter don't work in TSQL - 04-03-2008 , 03:32 AM



Hi Francisco,

Firstly, I'm assuming you're using SSIS and not DTS2000 .. if you're
using DTS then you need to write an ActiveX script which I'm afraid I
can't help you with because I don't have a copy of SQL2k installed
anymore.

In SSIS:
1) Select the "Expressions" option in the left pane of the ExecuteSQL
task editor and click the "..." button next to Expressions on the
right pane.
2) Select the "SqlStatementSource" property, and open the Expression
Builder ("..." button again)
3) Type your SQL statement into the Expression box. Something like:
"INSERT INTO PackageSystemAudit (PackageName, ...
VALUES ('" + @[User::PackageName] + "', '" + @[User::Param2] + ...

You can evaluate the expression to check that it's generating the
expected results. This expression will generate the SQL statement at
runtime using the current package variable values.

Good luck!
J

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.