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 |
|
swathigardas
Posting Yak Master
149 Posts |
Posted - 2008-09-01 : 01:30:28
|
| Hi when i'm trying to retrieve values from two tables like the Query below insert into dbo.two (id, name)values select id,namefrom one,names where id=2 and name ='Arul Raj A'It is throwing me the following Error--Msg 102, Level 15, State 1, Line 2Incorrect syntax near 'id'.Can anyone help me on this - how to insert the data into one table.. where the values are retreived from more than one table where the tables does not have any kind of relation |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-01 : 01:40:37
|
[code]insert into dbo.two (id, name)values select id,namefrom one,names where id=2 andname ='Arul Raj A'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
swathigardas
Posting Yak Master
149 Posts |
Posted - 2008-09-01 : 01:44:11
|
| Hey its the same what i posted.. Still it shows the same error..No change..Give me a correct solution |
 |
|
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-09-01 : 01:49:00
|
quote: Originally posted by swathigardas Hey its the same what i posted.. Still it shows the same error..No change..Give me a correct solution
Are you making a request or ordering people here to help you. Please have some gratitude for people helping you. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-01 : 01:59:25
|
quote: Originally posted by swathigardas Hey its the same what i posted.. Still it shows the same error..No change..Give me a correct solution
not the same. I strike off the values KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
swathigardas
Posting Yak Master
149 Posts |
Posted - 2008-09-01 : 02:07:41
|
| Hey thanks Khtan..I dint check it properly.. it was really helpful for me..Thanks a lot |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-01 : 03:28:49
|
quote: Originally posted by swathigardas Hey thanks Khtan..I dint check it properly.. it was really helpful for me..Thanks a lot
It is a copy/paste error MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|