It doesn't work if it has begin ... end
anonymous_at_discussions.microsoft.com
Date: 07/13/04
- Next message: TomTait747: "Re: bas file does nothing"
- Previous message: Rich: "Re: DTS pkg to VB6 to VB.Net problem"
- In reply to: Allan Mitchell: "Re: Thanks for your reply!"
- Next in thread: Allan Mitchell: "Re: It doesn't work if it has begin ... end"
- Reply: Allan Mitchell: "Re: It doesn't work if it has begin ... end"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 14:26:09 -0700
Hi,
Thanks for your help. I really appreciate it.
I have a variable in my SQL statement. I am trying to pass
this value from the GV into that.
Like, set @wk_no = ? , for which I want to define the
parameter as the GV. The statement could not be prepared.
If I use
"Select wk_no from time_input where wk_no = ?"
or
INSERT INTO time_input(wk_no ) VALUES (?)
as a single statement, it accepts.
I dont know! It looks I can't use ? in a statement where
it has BEGIN... END. or may be to another variable.
Kris.
>-----Original Message-----
>In article <2cbf401c4690f$b9df1f90$a301280a@phx.gbl>,
Kris wrote:
>> Actually! I modified it as follows and it worked.
>>
>> Function Main()
>> dim conn, var
>> set conn = DTSGlobalVariables.Parent.Steps
>> ("DTSStep_DTSDataPumpTask_1")
>> DTSGlobalVariables("WKADD").value = InputBox("Enter
>> Current Month as 1, 2, 3, etc.")
>> Main = DTSTaskExecResult_Success
>> End Function
>>
>> The value from the inputbox is now in the GV. I am
trying
>> pass this into the Execute SQL Step (Script) as a
>> condition.
>>
>> Thanks again.
>> Kris.
>>
>> >-----Original Message-----
>> >In article <2cad101c46901$93cb8950$a301280a@phx.gbl>,
>> Kris wrote:
>> >> oPkg.DisableStep = True
>> >>
>> >> oPkg.DisableStep = True
>> >>
>> >
>> >The package object does not have a DisableStep method.
>> >
>> >Also, I do not consider DTS the right choice for user
>> interaction. I
>> >personally would rather I asked the user up front of
>> executing the
>> >package for any values they needed to supply.
>> >
>> >Also why do this
>> >
>> >oVAR = (DTSGlobalVariables("gvweek").Value)
>> >oVAL = inputbox("Enter A Number ")
>> >Set oVAR = oVAL
>> >
>> >Can you not do
>> >
>> >oVAL = inputbox("Enter A Number ")
>> >DTSGlobalVariables("gvweek").Value = oVAL
>> >
>> >
>> >You may want to do some checking of the value supplied
>> also.
>> >
>> >
>> >
>> >Allan Mitchell (Microsoft SQL Server MVP)
>> >MCSE,MCDBA
>> >www.SQLDTS.com
>> >www.konesans.com - for all your consultancy needs
>> >
>> >
>> >
>> >.
>> >
>>
>
>Are you now asking for this next part of the puzzle?
>
>Assuming you are using SQL Server 2000 then you statement
will look
>something like
>
>SELECT col1, col2 FROM table WHERE col3 = ?
>
>You will then see the parameters button which you can use
to assign
>your GV to the ?
>
>If you are using SQL Server 7 (or if you want to do it
this way, SQL
>Server 2000) then you can do it also like this
>
>
>Global Variables and SQL statements in DTS
>(http://www.sqldts.com/Default.aspx?205)
>
>
>Allan Mitchell (Microsoft SQL Server MVP)
>MCSE,MCDBA
>www.SQLDTS.com
>www.konesans.com - for all your consultancy needs
>
>
>
>.
>
- Next message: TomTait747: "Re: bas file does nothing"
- Previous message: Rich: "Re: DTS pkg to VB6 to VB.Net problem"
- In reply to: Allan Mitchell: "Re: Thanks for your reply!"
- Next in thread: Allan Mitchell: "Re: It doesn't work if it has begin ... end"
- Reply: Allan Mitchell: "Re: It doesn't work if it has begin ... end"
- Messages sorted by: [ date ] [ thread ]