Hello EEE
I have a GUID value that is retreived from a table1 that I am trying to insert into table2. Both the source and destination tables have the datatype uniqueidentifier. However, on an insert to table2, this column is being set to null. Can we copy guid columns from one table to another? Or is the issue something else.
declare @myGUIDsrc uniqueidentifier
select @myGUIDsrc = column1 from table1 <---- only one row and GUID value is returned
insert into table2 (column1, column2) values (@myGUIDsrc , 'TEST')
Microsoft SQL ServerMicrosoft SQL Server 2008SQL
Last Comment
Tomas Helgi Johannsson
8/22/2022 - Mon
Raja Jegan R
Yes, we can insert GUID values from one table to another..
But you need to use another format to insert the records and use WHERE clauses as required..
insert into table2 (column1, column2) SELECT column1, 'TEST'from table1
I didn't get what you meant..
Can you kindly clarify..
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
But you need to use another format to insert the records and use WHERE clauses as required..
Open in new window