cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
905
Views
4
Helpful
2
Replies

MS-SQL Job clarification

I need to execute below sql statement from Tidal using MS-SQL job.can i mention directly with following settings.Is it correct ? and also what i need to mention for parameters tab?

SQL:
UPDATE tab1
SET ExtractStartDt = '2015-04-01 00:00:00.000'
WHERE ExtractID = (SELECT MAX(ExtractID) FROM tab2)

Type:-sql job
Database:-Database name is selected
SQL:
UPDATE tab1
SET ExtractStartDt = '2015-04-01 00:00:00.000'
WHERE ExtractID = (SELECT MAX(ExtractID) FROM tab2)
parameters:
Not sure what i need to mention for parameters tab.

2 Replies 2

There is no requirement to use paramters, if you dont have one

Parameters are used when you want to pass values to the query dynamically. For example, if you want the value of ExtractStartDt to be passed dynamically from a Tidal variable.

Try this ...

UPDATE tab1
SET ExtractStartDt = :TodaysDate
WHERE ExtractID = (SELECT MAX(ExtractID) FROM tab2)

Note the colon prior the variable name. Now, you should see the parameter TodaysDate in the list. Assign any fixed value('2015-04-01 00:00:00.000') or value from a Tidal variable. Then :TodaysDate will be substituted by the value set in the paramter

Useful especially when invoking stored procedures

Thanks for input

Review Cisco Networking for a $25 gift card