dbTalk Databases Forums  

Global Variables in SQL Statements

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


Discuss Global Variables in SQL Statements in the microsoft.public.sqlserver.dts forum.



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

Default Global Variables in SQL Statements - 06-18-2004 , 02:55 PM






Hey all,

A simple statement below:

DROP TABLE [Table_1]

What I'm trying to do--essentially--is this:

DROP TABLE [?]

And pass in a global variable as a parameter. Conventional
wisdom says that with DROP's and CREATE's it's not
possible to do this. I say to hell with conventional wisdom,
I'm sure someone out there has done this before. FWIW,
I did see a reference to a "gvcustomtask" on sqldts.com which
would allow for such things, BUT, it involves outside code
with a "use at your own risk" disclaimer, so I'm somewhat
leery of bringing it into a production environment.

Ideas, anyone? Thanks very much!



Reply With Quote
  #2  
Old   
Nex
 
Posts: n/a

Default Re: Global Variables in SQL Statements - 06-18-2004 , 03:32 PM






Never mind, I ran it in as an "execute sql task" but ran the sql through
the workflow properties as an activex script. Got the variables in that
way. Works like a dream.


"Nex" <nex (AT) nex (DOT) com> wrote

Quote:
Hey all,

A simple statement below:

DROP TABLE [Table_1]

What I'm trying to do--essentially--is this:

DROP TABLE [?]

And pass in a global variable as a parameter. Conventional
wisdom says that with DROP's and CREATE's it's not
possible to do this. I say to hell with conventional wisdom,
I'm sure someone out there has done this before. FWIW,
I did see a reference to a "gvcustomtask" on sqldts.com which
would allow for such things, BUT, it involves outside code
with a "use at your own risk" disclaimer, so I'm somewhat
leery of bringing it into a production environment.

Ideas, anyone? Thanks very much!



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

Default Re: Global Variables in SQL Statements - 06-19-2004 , 12:32 AM



That is your only way as well. ? is not very good at being used as an
object name.

--
--

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


"Nex" <nex (AT) nex (DOT) com> wrote

Quote:
Never mind, I ran it in as an "execute sql task" but ran the sql through
the workflow properties as an activex script. Got the variables in that
way. Works like a dream.


"Nex" <nex (AT) nex (DOT) com> wrote

Hey all,

A simple statement below:

DROP TABLE [Table_1]

What I'm trying to do--essentially--is this:

DROP TABLE [?]

And pass in a global variable as a parameter. Conventional
wisdom says that with DROP's and CREATE's it's not
possible to do this. I say to hell with conventional wisdom,
I'm sure someone out there has done this before. FWIW,
I did see a reference to a "gvcustomtask" on sqldts.com which
would allow for such things, BUT, it involves outside code
with a "use at your own risk" disclaimer, so I'm somewhat
leery of bringing it into a production environment.

Ideas, anyone? Thanks very much!





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.