Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stroed Procedure Help 1

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
0
0
US
I know nothing abour stored procudures and need help. I need a stored procedure that will check a date field and if it is 10 minutes old then it will change another fiedl to a certain value. I need it to be managed within SQL (it will not be called externally)

Any help?

[conehead]
 
Is it the query you need?

Update <table> SET <Field> = '<X>'
Where DateDiff(DateAdd(n, 10,<datefield>), getdate()) > = 0
And <Field> <> '<X>'

-- <X> is the value you want to change to


==========================
Date is a way to show you care
Time is a great healer
DateTime is just damn confusing

Tim
 
I need the T-SQL to write the stored procedure and then to know how to call it from within SQL -- so basicaly I need it all -- sorry....

[conehead]
 
BOL is the place to go --
Check it out!

Type in Create procedure

==========================
Date is a way to show you care
Time is a great healer
DateTime is just damn confusing

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top