Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
There is serialno column in table .
i want to set zero automatically in serialno column every new day .
how to write update statement with store procedure in sql setver 2005.
Posted

You'll have to check for specific time, for eg if time == 12AM then you'll have to update your table, for this using triggers will be better
 
Share this answer
 
try to use "Case When" in your StoredProcedure

SQL
SELECT 

     ItemName, 
     
     (CASE SerialNumber WHEN '' THEN '0'
      ELSE SerialNumber END) as SerialNumber

FROM Items

we force to override the SerialNumber field to zero because we put Conditional statement



please vote and Accept solution
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900