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 2005 Forums
 .NET Inside SQL Server (2005)
 DateTime properties in C# object

Author  Topic 

astorm
Starting Member

1 Post

Posted - 2009-05-26 : 11:40:53
I have a file which contains a date but the format of this date could be an english date format or some other european date format. When running my class from a standard .net application I can read the date from the file and parse it into a variable of type Date using Date.Parse

The issue I have is when I call this same class from a CLR Stored Procedure. On my US built machine with US regional settings everything works fine. But I have a colleague that has a French XP built machine with the regional settings set to US; when they run the standard windows .net application they can read the file without issue, the date parses fine. But when they run the stored procedure they are always getting a parsing error on the Date.Parse.

My question is, where is SQL Server pulling the date format from? If the date in the file is "03/25/2009" and the regional settings are set to English why would SQL Server be trying to parse this date as (month = 25)/(day = 03)/2009?

Any help / clarification on this would be greatly appriciated.

Thank you
   

- Advertisement -