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
 SQL Server Development (2000)
 diffrent behaviour of the same code on 2 diffrent

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-03-19 : 09:10:29
diffrent behaviour of the same code on 2 diffrent servers :
i have code in asp in which i send a date to the server
on the server i swap the day and month like this :
dd/mm/yyyy->> mm/dd/yyyy
and then i insert it
for example
01/04/2006
i am sending the data ->the data is being updated in the db
i am checking usingthe DAY and MONTh function to be sure which is day and which is month.
on one server i recive DD=1 and MM=4
on the second i recive DD=4 and MM=1
its like one server need the date to be cahnged into mm/dd/yyyy
and the second which dont need too is chaning them for nothing and make a mess!
how can tis be pioissble?
thnakdin advance
peleg



Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-03-19 : 09:26:53
Use parameters in both your asp code as well as for stored procedure inputs. Make the datatype of the parameters the appropriate type. (in this case - datetime).

Be One with the Optimizer
TG
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-03-19 : 10:20:12
Another option is to pass it as yyyymmdd which is unambiguous.
If this is from the same client you might also look at why the two servers have a different date format.



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-03-19 : 15:06:02
i have compared th 2 servers there defenitons are the same
is there in sl server a place that the date structure is configured?

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-03-19 : 21:00:36
What is the result when you run this on each server?

print @@language





CODO ERGO SUM
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-03-20 : 00:54:44
its us_english in both of them

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page
   

- Advertisement -