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)
 datetime

Author  Topic 

Arun.G
Yak Posting Veteran

81 Posts

Posted - 2010-06-17 : 05:43:58
i have one column in my database called del_date

in that column i want to store whenever the records are deleted , that dataandtime of the deletion should be stored, and the status of the record will be 1 in another column del_flag

so physically we r not deleting the records, just inactivating and storing the deletion date and time

how to do it in stored procedure?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-06-17 : 05:45:39
[code]
update t
set del_flag = 1,
del_date = getdate()
from yourtable t
where . . .
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -