Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getdate() in sql server 2005 in 2000 compatibility mode
Message
De
29/03/2007 17:19:27
 
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:
01210082
Vues:
19
Sure, but it will have to be tomorrow. I won't have access to the stored procedure until then...




>>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 :-)))
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform