S.p. execution with date type parameter (Management Studio)

  • When I execute a stored procedure requiring a datetime type parameter from within SQL Server Management Studio, I get a date conversion error if the date is not mmddyy(yy). My date format in Europe is ddmmyy and this is my Windows XP setting.

    I can get it work by specifying a known "bad" date such as 31-01-2007, waiting for the execution to fail and then adding  SET DATEFORMAT dmy before the EXEC in the execution window and edit the date to what I really want in ddmmyy format.

    A bit laborious; Is there an easier way to get Management Studio to respect my international settings?

     

  • This was removed by the editor as SPAM

  • If the database is not on your local machine then your local international settings will have no effect. By far the best strategy for passing dates to SQL Server is to convert them to ISO standard format, YYYYMMDD. This will not be interpreted incorrectly, regardless of machine locale settings.

    Hope that helps,

    Ric.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply