I am having java code which inserts date (which is in String format) into
MSSQL table.
The format of date is "yyyy-MM-dd hh:mm:ss" (I believe this is a standard
format '). On my local m/c it was working fine, but when shifted to new
serverit stopped working. On new serverit takes "dd/MM/yyyy hh:mm:ss" format
only. the above format - it gives me Airthmatic overflow error.
1)Is there any standard format which will always work on MSSQL ?
2)btw, how this format is set on SQL server ? Can i change the date format
to be displayed on Enterprise manager ?
regards
Manishacheck out the ISO8601 format; search BOL for convert using style 126. This
format is international and will always work no matter how the SQL Server is
set up.
yyyy-mm-ddThh:mm:ss:mmm(no spaces)
regards,
Mark Baekdal
http://www.dbghost.com
+44 (0)208 241 1762
Database change management for SQL Server
"manisha_css" wrote:
> I am having java code which inserts date (which is in String format) into
> MSSQL table.
> The format of date is "yyyy-MM-dd hh:mm:ss" (I believe this is a standard
> format '). On my local m/c it was working fine, but when shifted to new
> serverit stopped working. On new serverit takes "dd/MM/yyyy hh:mm:ss" format
> only. the above format - it gives me Airthmatic overflow error.
> 1)Is there any standard format which will always work on MSSQL ?
> 2)btw, how this format is set on SQL server ? Can i change the date format
> to be displayed on Enterprise manager ?
> regards
> Manisha
>
>|||BOL - writing international transact-sql statements
"manisha_css" <manishacss@.discussions.microsoft.com> wrote in message
news:6017A109-369E-48B5-B6B0-3F6DDCF773F3@.microsoft.com...
> I am having java code which inserts date (which is in String format) into
> MSSQL table.
> The format of date is "yyyy-MM-dd hh:mm:ss" (I believe this is a standard
> format '). On my local m/c it was working fine, but when shifted to new
> serverit stopped working. On new serverit takes "dd/MM/yyyy hh:mm:ss"
format
> only. the above format - it gives me Airthmatic overflow error.
> 1)Is there any standard format which will always work on MSSQL ?
> 2)btw, how this format is set on SQL server ? Can i change the date format
> to be displayed on Enterprise manager ?
> regards
> Manisha
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment