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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Problem with Insert

Author  Topic 

swathigardas
Posting Yak Master

149 Posts

Posted - 2008-08-29 : 09:06:03
create table one (id int)

create table two (id int, name varchar(20)

insert into two (id, name)
values
select id from dbo.one where id=2,
'abc'



when i'm trying to insert values in the table 'two'
with the help of above query
it is showing the followin error

Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'select'.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ','.



Can anyone help me on this

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-08-29 : 09:11:10
Problem here too!
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=109736



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -