Viewing 6 posts - 1 through 6 (of 6 total)
The easiest way is something like this:
INSERT INTO Table2 (EmpID, AssetType, AssetValue)
SELECT EmpID, Type1, Type1Value
FROM Table1
UNION ALL
SELECT EmpID, Type2, Type2Value
FROM Table1
UNION ALL
SELECT EmpID, Type3,...
October 25, 2010 at 2:22 pm
You can try something like this. You many need to use convert if your non-id fields are of different data types.
I can give you a more exact answer if you...
November 5, 2009 at 6:36 pm
There are several ways that you can do this.
You can create an Identity column and use a check constraint against the identity column. This will work unless the record is...
November 5, 2009 at 6:24 pm
You can either write a batch script to get the required information from the database via a command line, or if you want to do from within the database you...
October 23, 2009 at 5:20 pm
You could do it using NOT EXISTS but you would need to reference the outer table in the subquery.
INSERT INTO TestID
(OldLicenseNumber)
SELECT
DISTINCT x1.OldLicenseNumber
FROM TableFrom2002 x1
WHERE NOT EXISTS
(SELECT x2.OldLicenseNumber FROM TestID...
July 8, 2009 at 5:54 pm
Viewing 6 posts - 1 through 6 (of 6 total)