Link to home
Start Free TrialLog in
Avatar of Chris Michalczuk
Chris MichalczukFlag for United Kingdom of Great Britain and Northern Ireland

asked on

create a new stored procedure in SQL2012

I want to create a small stored procedure called UpdateOrderDate that runs this bit of code
How do I create it?

  update [TC_Integration].[dbo].[tbl_orderheaders]
  set createddate ='2014-01-06 09:38:08.000'
Avatar of Vikas Garg
Vikas Garg
Flag of India image

Hi,

User generated image
Clicking on New procedure will open script window

User generated image
Hope this would help
Caveat: This UPDATE will change every row in your table.
WHY would you create a stored procedure to sett ALL records of a table to a constant date/time value????????

Do you intent to have every record in that table "created" at '2014-01-06 09:38:08.000' no matter when you create them?

perhaps use

GETDATE()

instead??
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial