brgdotnet
asked on
How to just insert one column value into a multi column temp table
Hello Experts. I have a temp table, and initially I just want to insert into it, one column value "EntityId". So after the insert statement all EntityId column fields will be populated based upon my insert statement that involves a sub query.
My insert statetement is failing though. I have tried changing the syntax of the insert statement, and my syntax is incorrect. Can someone tell me how to change the INSERT statement below, so that it will insert the #TempTable with the EntityId values?
CREATE TABLE #TempTable (EntityId varchar(64),
NameOfEntry varchar(150),
AgeId varchar(10))
INSERT INTO #TempTable SELECT EntityId from Customers where EntityId NOT IN (Select EntityId from OldCustomers)
My insert statetement is failing though. I have tried changing the syntax of the insert statement, and my syntax is incorrect. Can someone tell me how to change the INSERT statement below, so that it will insert the #TempTable with the EntityId values?
CREATE TABLE #TempTable (EntityId varchar(64),
NameOfEntry varchar(150),
AgeId varchar(10))
INSERT INTO #TempTable SELECT EntityId from Customers where EntityId NOT IN (Select EntityId from OldCustomers)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER