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 2000 Forums
 Transact-SQL (2000)
 SET DATEFORMAT mdy

Author  Topic 

gpiva
Starting Member

47 Posts

Posted - 2004-08-31 : 21:28:54
how can i use the DATEFORMAT in a store procedure ?

this is my code

CREATE PROCEDURE UpdateTimeTable
@ID int,
@IToursXrefRoutesId int,
@ITransportId int,
@DDepartureTime datetime,
@DDepartureDate datetime,
@DArrivalTime datetime,
@DArrivalDate datetime

AS
SET DATEFORMAT dmy
UPDATE TimeTable
SET
IToursXrefRoutesId = @IToursXrefRoutesId,
ITransportId = @ITransportId,
DDepartureTime = @DDepartureTime,
DDepartureDate = @DDepartureDate,
DArrivalTime = @DArrivalTime,
DArrivalDate = @DArrivalDate,
LastModified = GetDate()
WHERE (ITimeTableId = @ID)
GO


Any help appreciate.


Carlo

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2004-09-01 : 00:10:52
Let me know if this is a dumb question (I'm sure someone will), but is there a reason why you're trying to do this in a stored procedure? Normally you would do this as an administrator. Do you need to revert back to the previous dateformat after the procedure is run? Are you trying to set dateformat to handle some type of datetime conversion, rather than by using CONVERT?

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
   

- Advertisement -