dbTalk Databases Forums  

Insert Sql Statement

microsoft.public.sqlserver.mseq microsoft.public.sqlserver.mseq


Discuss Insert Sql Statement in the microsoft.public.sqlserver.mseq forum.



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

Default Insert Sql Statement - 10-06-2003 , 05:08 PM






What is the syntax to insert a field data using a
variable.

TableName = Variable

I have a sql
Insert into TESTTABLE Item, Price From Tablename
I have a field TESTTABLE called Table, I need to include
in my insert statement to have Table = TableName.
I have tried the Set Table = TableName but got an error.

Can someone help me?
Thanks
Vina

Reply With Quote
  #2  
Old   
Ray Higdon
 
Posts: n/a

Default Re: Insert Sql Statement - 10-07-2003 , 09:08 PM






You might use dynamic SQL, try this link

http://www.algonet.se/~sommar/dynamic_sql.html

HTH

--
Ray Higdon MCSE, MCDBA, CCNA
---
"Vina" <tvae (AT) att (DOT) net> wrote

Quote:
What is the syntax to insert a field data using a
variable.

TableName = Variable

I have a sql
Insert into TESTTABLE Item, Price From Tablename
I have a field TESTTABLE called Table, I need to include
in my insert statement to have Table = TableName.
I have tried the Set Table = TableName but got an error.

Can someone help me?
Thanks
Vina



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 - 2013, Jelsoft Enterprises Ltd.