Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
snow12
Yak Posting Veteran
74 Posts |
Posted - 2011-12-05 : 12:44:18
|
How to insert the row to the table but one column form another tableI have table name:NAME, IDENTIFY, TermAnother table: identify1234566611Insert into NAME(name, identify, term )values('ABC', identify, 12)but identify values is from table identify. Is there any way to accomplish it?Thank you very much! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
snow12
Yak Posting Veteran
74 Posts |
Posted - 2011-12-05 : 15:01:25
|
Tara;Thanks for the response. I just need to insert same name and term: 'ABC',12 with different identify1234566611Something like this: Insert into NAME(name, identify, term )values('ABC', '12', 12)Insert into NAME(name, identify, term )values('ABC', '34', 12)Insert into NAME(name, identify, term )values('ABC', '56', 12) |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
snow12
Yak Posting Veteran
74 Posts |
Posted - 2011-12-05 : 15:53:53
|
Tara:Thanks. I use the query you provide:Insert into NAME(name, identify, term )select 'ABC', identify, 12from identifyThere is error: Msg 128, Level 15, State 1, Line 2The name "identify" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.because identify is column name. How to fix it? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
snow12
Yak Posting Veteran
74 Posts |
Posted - 2011-12-05 : 16:48:07
|
Tara:Thank you very much! I made a mistake and have typo. You are super! |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|