| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
Use varipus select Statement in 1 updateI want to use a select statment to INSERT data into a table, but when i leave a column out for it to auto generate a key. I get the error
Insert Error: Column name or number of supplied values does not match table definition. What i would really like to be able to do is a use a number of selects to create a new row and use the newid() function to give it an ID. Does anyone know how yo do that? I have been trying: example declare @table as table( [fkClient] [uniqueidentifier] NOT NULL, [uidClientDefaultFee] [uniqueidentifier] DEFAULT (newid()) ) INSERT INTO @table select Distinct uidClient From tblClients thanks in advance |
|
Be the first to answer this question! Click on the 'Post Reply' button below.
|