Thursday, March 17, 2011

Creating a table and moving from one table to another table

Creating a table and moving from one table to another table
------------------------------------------------------------
SELECT
ALY_ID,
FCO_ID,
AnalysisCode,
ALPType,
ALPMinType,
ALPMinVal,
ALPMaxType,
ALPMaxval,
ALPConform,
ALPDetect,
ALPPermitted,
RStatus
INTO TempFull_Bkp
FROM TempFull

Moving from one table to another when table is created
------------------------------------------------------------
INSERT INTO TestTable (FirstName, LastName)
SELECT FirstName, LastName
FROM Person.Contact
WHERE EmailPromotion = 2
----Verify that Data in TestTable
SELECT FirstName, LastName
FROM TestTable


Moving from one table to another when table is not created
-----------------------------------------------------------
SELECT FirstName, LastName
INTO TestTable
FROM Person.Contact
WHERE EmailPromotion = 2
----Verify that Data in TestTable
SELECT FirstName, LastName
FROM TestTable

No comments:

Post a Comment