Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Query help

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2012-06-27 : 13:35:34
[code]
Table:Student

SID name skey
--- ---- ------
10 sam SaK10


Desired output


Table:Student

SID name skey
--- ---- ------
10 sam NUll


Table:student

SID name skey
---- ---- ------
11 Sam Sak10

I want to transfer student table record to New record and null it out skey value in the old record of student table before put it in the new record as skey is unique.

Please help.

[/code]

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 13:44:54
insert into Student
select SID, name, NULL
from Student
where SID = 10

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -