You are here: Re: simple SQL question to insert records in an existing table - Newbie « MsSQL Server « IT news, forums, messages
Re: simple SQL question to insert records in an existing table - Newbie

Posted by Plamen Ratchev on 02/20/07 16:40

To insert into a table that already exists you use INSERT INTO. In your case
it will be something like this:

INSERT INTO NewTable (OrderID, CustomerID)
SELECT OrderID, CustomerID
FROM Source1

This assumes table NewTable already exists. If the table does not exist you
can create it with SELECT INTO like this:

SELECT OrderID, CustomerID
INTO NewTable
FROM Source1

HTH,

Plamen Ratchev
http://www.SQLStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация