Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ismailc
Constraint Violating Yak Guru
290 Posts |
Posted - 2008-03-18 : 05:35:07
|
Hi, I need help please. I have two tasks.1. SQL Execution task to output a variable which must be a datetime value "2007/12/31 00:00:00.000" Variable name: Test Value Type: Datetime Value: 2007/12/31 00:00:00.000 2. Then in my OLEDB source i want use the parameter: I have setup the parameters for QRY = 0 (Test) QRY: WHERE WT.ApplyDtm = ?I have two problems to this:1. How do i know that my first task is bring back a value of datetime "2007/12/31 00:00:00.000"2. In my QRY i have to put the parameter within '' , I tried '?' but it maons. The QRY should run: WHERE WT.ApplyDtm = '2007/12/31 00:00:00.000'Please Assist!Regards |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-03-18 : 07:12:07
|
1. You can put a breakpoint in the sql execution task for post execute event and check the value of variable in wtach window to see if value is coming as expected.2.You need to have a seperate variable that holds the query string to be executed and use SQL command from variable option and map to this variable. In the variable properties set evaluate as expression property true and in expresiion window use conactenation operator to get your expected query...like @user::query='... WHERE WT.ApplyDtm = ' + User::yourDateVariable + ''' |
 |
|
ismailc
Constraint Violating Yak Guru
290 Posts |
Posted - 2008-03-18 : 07:42:10
|
Great stuff - Thank You very much! I could see that my value returning was incorrect. A good lesson learnt with a parameter with ''Thank You very much! |
 |
|
|
|
|