IdleTymes Blog

Personal Diary, Musing and rubish of a F*!^%#g bored programmer.

SQL Inserts

05 23rd, 2005 Author: Administrator

Insert a record:

“INSERT INTO Person (field1, filed2…) VALUES (value1, value2,…)”

Insert using a select statement:

INSERT INTO NGLinkCon
(ConID)
SELECT AutoID AS ConID
FROM COntacts
WHERE (firstname = `roland`)

INSERT INTO eshot_Extract.dbo.Contacts (Firstname, Lastname, email, Company) SELECT Contacts.Firstname, Contacts.Lastname, Contacts.email, Contacts.Company FROM eshot_forfront2.dbo.Contacts INNER JOIN eshot_forfront2.dbo.NGLinkCon ON Contacts.AutoID = NGLinkCon.ConID WHERE NGLinkCon.NGID = 18


Comments are closed.