Monday, October 29, 2007

INSERT INTO statement

The INSERT statement adds one or more new rows to a table. Use a SELECT subquery to specify the data values for one or more rows.

Syntax :
INSERT INTO [existing table] ([column])
SELECT [column name]
FROM [table name]




Example :
INSERT INTO dbo.Shop (ShopNo,ProductNo,Stock)
SELECT ForeignKey, Description
FROM dbo.NewShop

1 comment:

Sospixs said...

Hi. my name is thanapat from thailand.
I would like to introduce my site
It's about Business Inteligence.(Microsoft Sql Server)
:)

Thank you.
www.mssqlbase.blogspot.com