dbTalk Databases Forums  

Select * from Table XXX Name

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


Discuss Select * from Table XXX Name in the microsoft.public.sqlserver.dts forum.



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

Default Select * from Table XXX Name - 07-08-2004 , 12:31 AM






Declare a variable XXX

a table name = TableXXXName ( insert variable between Table and Name)

how to write a select statement where table name got insert a variable ?

Select * from Table+XXX+Name .......can not
Select * from Table%XXX%Name......can not
Select * from Table&XXX&Name .......can not
Select * from Table||XXX||Name......can not

pls advise me...thank you



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

Default Re: Select * from Table XXX Name - 07-08-2004 , 01:20 AM






Is this in DTS or in general.

As you have included the .Programming group I shall assume the latter.
There is an excellent paper here that will tell you everything you need to
know.

http://www.sommarskog.se/dynamic_sql.html

--

----------------------------

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


" PK" <pk999 (AT) hotmail (DOT) com> wrote

Quote:
Declare a variable XXX

a table name = TableXXXName ( insert variable between Table and Name)

how to write a select statement where table name got insert a variable ?

Select * from Table+XXX+Name .......can not
Select * from Table%XXX%Name......can not
Select * from Table&XXX&Name .......can not
Select * from Table||XXX||Name......can not

pls advise me...thank you





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.