Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getdate() in sql server 2005 in 2000 compatibility mode
Message
 
À
29/03/2007 16:07:09
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01209728
Message ID:
01210061
Vues:
20
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform