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 2000 Forums
 Transact-SQL (2000)
 INSERT INTO from other table

Author  Topic 

Ken Blum
Constraint Violating Yak Guru

383 Posts

Posted - 2004-04-22 : 05:49:04
Is there a way that I can
INSERT INTO Table1 (field1, field2)
VALUES (Select x1, x2 FROM MyTable WHERE MyTableID = 1)?

TIA

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-04-22 : 05:57:57
[code]
INSERT INTO Table1 (field1, field2)
Select x1, x2 FROM MyTable WHERE MyTableID = 1
[/code]
Go to Top of Page

Ken Blum
Constraint Violating Yak Guru

383 Posts

Posted - 2004-04-22 : 06:57:33
That was a little too simple. Guess that's what happens when you start programming at 4am.

Thanks!
Go to Top of Page
   

- Advertisement -