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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert data from one table to the other

Status
Not open for further replies.

wg26

Programmer
Mar 21, 2002
135
US
Hi Everyone:

I have one empty table with two column([Name] varchar, [LookupId] uniqueidentifier default newid()) and I am trying insert data which retrieve from other table into this table... the code is as the following:

Insert into [Detail Name Lookup_2][([Name], default)]
Select distinct [Name]
from [Detail]

But SQL keeps giving me error as: Incorrect syntax near '([Name'......

Can anyone please kindly give me some suggestions about what is wrong with my code? Thanks alot...
 
Code:
INSERT [Detail Name Lookup_2]([Name])
SELECT DISTINCT [Name]
FROM [Detail]

The default values will be inserted automatically
 
I just found out that...but Thanks alot anyway...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top