Click here to Skip to main content
14,638,900 members
Rate this:
Please Sign up or sign in to 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
Rate this:
Please Sign up or sign in to vote.

Solution 1

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
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

try to use "Case When" in your StoredProcedure

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
   
v4

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100