Hello Gurus
Here is the problem
I need to insert Columns A and B from say table T1 to Table T2 . Table T2 has primary key defined as column PK1(GUID) .
Now lets say I have one row corresponding to Column A and B from T1 that I need to insert into T2 .
When I do the usual insert into Table T2 (Sql Server ) , Should I be using User Defined SQL to load into T2, if yes how would I take care of the GUID (PK1) here ?
Any help is appreciated .
I have searched for this topic with Key works GUID and SQL Server Unique ID but could not find any direct answers .
Sql Server Unique Identifier
Moderators: chulett, rschirm, roy
Sql Server Unique Identifier
Last edited by devsonali on Mon Sep 17, 2012 11:26 am, edited 1 time in total.
Yup , I we would need one (I am new to sql server too ) but what about metadata , Should this pk be the part of metadata ? (If Yes then since there is no value for this new column coming in it wouldn't compile ?)
or should it be like insert into table T1 ( pk1,a,b ) VALUES (newid(),'value1','Value2')
or should it be like insert into table T1 ( pk1,a,b ) VALUES (newid(),'value1','Value2')
Does the SQL-Server DDL specify that the key column has "IDENTITY" set to on? If so, you may not specify that key column on writing; if not, then you need to fill that column with a value at runtime.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>