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.
| 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 serveron the server i swap the day and month like this :dd/mm/yyyy->> mm/dd/yyyyand then i insert itfor example01/04/2006i am sending the data ->the data is being updated in the dbi 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=4on the second i recive DD=4 and MM=1its like one server need the date to be cahnged into mm/dd/yyyyand the second which dont need too is chaning them for nothing and make a mess!how can tis be pioissble?thnakdin advancepelegIsrael -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 OptimizerTG |
 |
|
|
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. |
 |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2006-03-19 : 15:06:02
|
| i have compared th 2 servers there defenitons are the sameis 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 -:) |
 |
|
|
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 |
 |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2006-03-20 : 00:54:44
|
| its us_english in both of themIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
 |
|
|
|
|
|