SQL Server datetime field issue - sql

My personal computer is running Windows 7 (language turkish) and I installed SQL Server 2008. When I create a new database, the database language is Turkish_CI_AS
And I have a server with Windows Server 2003 (language english) and installed SQL Server 2008 on that server. I set the Regional and Language Options as Turkish. I am creating a database and selecting collation Turkish_CI_AS
But when I insert a row into a table on the server, an error occurrs:
The date format is invalid

You should always use unambigious formats like YYYYMMDD or YYYYMMDD HH:MM:SS so that no matter what setting the server/database is it will be added correctly. Read this for a better understanding http://beyondrelational.com/modules/2/blogs/70/posts/10898/understanding-datetime-column-part-ii.aspx

Related

SQL Server 2012 Ansi Warnings and SSRS

When the query or stored procedure is run form SSRS, the ANSI warnings are setting to OFF - the connection takes defaults values from Server properties.
Is there any way to determinate the ANSI warnings ON for current user (not for entire server) who is define in connections ?
SQL Server 2012

How to store the number without the comma in SQL server

We have a web application which from the UI is passing a value say 50.00 but when it is stored in the database it is stored as 50000. Most of our installations are for English OS (windows 7) but this problem is on a dutch installation.
Is there a way I can tweak SQL server so that it saves the value at 50 and not 50000 without changing any code? The field in the database is an integer.
The customer has SQL server 2008 express.

date issue after migrating to SQL Server 2012

I am facing an issue after we migrated our DB from SQL Server 2008 R2 to SQL Server 2012 in our production server. When we pass any date in yyyy-mm-dd format it changes it into yyyy-dd-mm and breaking all the applications. So in SQL itself datetime parameter in SP changed our value (to yyyy-dd-mm) passed from all our applications (live website and all other backend applications).
We have tried changing dbcc useroprions. Currently they are set like this:
language British
dateformat dmy
datefirst 1
We changed it to us-english but it does not work. Do I need to restart DB engine?
Kindly advise ASAP as it is affecting client. Thanks in advance
It worked after executing below SP.
sp_defaultlanguage 'DBUsername','us_english'
Thanks.

Import Data Between Servers with Different Version

I need to transfer data from sql 2012 to 2000 so I decide to create a file of insert using "Generate Script" in sql 2012 then Execute it in sql 2000.
But one of the columns DataType is Date; The Sql 2012 generates Date like this:
CAST(0x13FC0A00 AS DateTime)
But SQL 2000 throw Syntax error when executing the above code
Syntax error converting datetime from binary/varbinary string.
How can I fix this error?
Try in SQL Management Studio going
Tools -> Options -> SQL Server Object Explorer -> Scripting
Set "Script for server version" to "SQL Server 2000".
Then re-generate the scripts.

change SQL Server error message to another language

How I can change SQL Server error message to another . I am using SQL Server 2008 R2 with Windows server 2008 r2 enterprise and want to change error message to persion language.
SET LANGUAGE:
Specifies the language environment for the session. The session
language determines the datetime formats and system messages.
I don't think there is a Persian edition though, see the list at sys.syslanguages
try setting the language like this
SET LANGUAGE ENGLISH
Persian isn't a language supported on SQL Server 2008 R2
To see the supported languages click here
You could also find them by using
SELECT name, alias
FROM sys.syslanguages
If you then want to change the language to Italian for example use
SET LANGUAGE Italian
Further info on SET LANGUAGE here