Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getdate() in sql server 2005 in 2000 compatibility mode
Message
 
To
29/03/2007 16:07:09
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01209728
Message ID:
01210061
Views:
19
>Actually, we were passing the datetime to the sql proc as a character string. The value was set using datetime() in foxpro. The we realized that we needed to use a standard datetime from the server so we added a line in the sql stored procedure to store the datetime to that variable using getdate() after a value was passed in. For some reason, when doing it that way, the time is rounded to whole minutes. It comes from VFP correct, but changing the value using getdate() rounded the minutes. I've never seen it happen before. So what we ended up doing as a quickfix was to just create a new variable in the stored proc, declaring the new variable there as datetime, and then using the new variable instead of the original parameter passed. Now the precision is maintained. Go figure! I don't get it. I just figured it was something to do with changing the value (and type) of a parameter in the stored procedure that I was not aware of.

Please, can you post a simple code from SQL Server side that I can research.
Because:
declare @temp varchar(200)
SET @temp = '20070101 15:00:00'
declare @temp datetime

SET @temp = GETDATE()
SELECT @temp
raises an error (have no desire to create a SP :-)))
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform