Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert into ... newid() and select statement

Status
Not open for further replies.

almoes

Programmer
Jan 8, 2003
291
US
Hi all,

I want to insert into a table all records result from a select statement with a previous field which creates a unique identifier (newid()). I tried, with no succes the following syntax:

insert into myTable(field1, field2,field3) newid() select field1, fields from myTable2

is this possible? thanxs.

cheers,
alej
 
Close shot...

insert into myTable(field1, field2,field3) select newid(), field1, field2 from myTable2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top