dbTalk Databases Forums  

Assign global variables

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


Discuss Assign global variables in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AlejoR
 
Posts: n/a

Default Assign global variables - 08-11-2003 , 02:15 PM






Hello all,
How, from a SQL Task, can I assign the value to a global variable.
I mean, in a SQL Task I execute a SQL that returns a date value, I need to
assign this value to a global variable.
I've tried this:
select gv = mydate from my table. Here gv does not have value!!
or
select @gv = mydate from mytable. This generates a error because @gv is
not declared

So how is the correct form???
Thanks




Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Assign global variables - 08-11-2003 , 02:23 PM






Are you using SQL Server 2000 or 7

2000 - Look for a parameters button
7 - Good way is to either

1. Use an Active Script task and an ADO recordset
2. Use a datapump and pump the record into the GV


--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

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.