Reputation:
I am inserting some data into a table on different SQL server , for this purpose i have created a dtsx package ,
We need data in destination table in dd-mm-yyyy format and i am using below query to convert date into desired format
Convert(varchar,dbo.Member.DateOfBirth,105)
when run query in SSMS , it gives perfectly converted data as '25-08-1989'
but when i check it in destination table after insertion, it show date as '1989-08-25'
Can somebody tell me why destination table is not accepting date in dd-mm-yyyy format after conversion ?
I am new here , sorry for formatting mistakes ....
Upvotes: 0
Views: 534
Reputation: 131180
You are probably confusing the client's way of formatting dates for some (non-existent) server date format. There is none. All date types are binary values, just like int, float and decimal. The client formats them into strings in order to display them.
SSMS is nothing more than a specialized client. By default, dates are formatted according to your (the user's) locale. This can lead to confusion when the same date appears as 25/9/2017 to one user but 9/25/2017 to another. The date though is still the same.
DBAs and developers don't care about localized formats though. SSMS uses YYYY-MM-DD
to avoid confusion.
Upvotes: 0