all groups > sql server dts > december 2005 >
You're in the

sql server dts

group:

Use global variable to update a table


Use global variable to update a table txksa
12/27/2005 1:41:40 PM
sql server dts:
In part of a DTS package a user will input a value. I need to take that
value and update a table. Something along the lines of

"UPDATE dbo.OLSParms" & _
" SET dbo.OLSParms.Val = '" & DTSGlobalVariables("Category").Value & "'"

Re: Use global variable to update a table (jariwala_b NO[at]SPAM rediffmail.com)
12/27/2005 9:07:23 PM
you can use inputBox function and catch user input to DTSGlobalVariables("Category").Value.

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Re: Use global variable to update a table txksa
12/28/2005 8:23:02 AM
I am currently using an inputbox to do this. I am new to this kind of stuff.
I am trying to actually figure out how to execute a sql string within the
activex script task.

[quoted text, click to view]
Re: Use global variable to update a table txksa
12/28/2005 1:42:02 PM
I just was not understanding exactly how this worked before. I have since
worked throught the problem.

Function Main()
'Get Category Information
'DTSGlobalVariables("Category").Value

'Get TimeID Information
'DTSGlobalVariables("TimeID").Value
Dim oPkg, oDataPump, sSQLStatementCat, sSQLStatementTime

' Build new SQL Statement
sSQLStatementCat = "UPDATE dbo.OLS_Parms " & _
"SET dbo.OLS_Parms.Val = '" & DTSGlobalVariables("Category").Value & "' "
& _
"WHERE dbo.OLS_Parms.Parm = 'CrossAppCategory'"

' Get reference to the Exec SQL Task
Set oPkg = DTSGlobalVariables.Parent
Set oExecSQL = oPkg.Tasks("DTSTask_DTSExecuteSQLTask_1").CustomTask

' Assign SQL Statement to Exec SQL Task
oExecSQL.SQLStatement = sSQLStatementCat

' Clean Up
Set oExecSQL = Nothing
Set oPkg = Nothing

Main = DTSTaskExecResult_Success
End Function

Now here is my new question......
When I run this DTS package from within a SQL Job, why doesn't the input box
display?

[quoted text, click to view]
Re: Use global variable to update a table Allan Mitchell
1/3/2006 2:25:04 PM
Hello txksa,

It would be much better if the user deposited this value in a place that
the package could pick up rather than the package halting execution whilst
it waits for the user to enter a value.


Allan



[quoted text, click to view]

Re: Use global variable to update a table txksa
1/4/2006 6:58:02 AM
I realized that after the fact. I have since corrected. Thank you for your
input!

[quoted text, click to view]
AddThis Social Bookmark Button