I have the following query:
SELECT * FROM REGULARIZACION WHERE FECHA_CORTE = '2019-12-31'
When executing the query it shows me the following error:
Casting from varchar data type to datetime produced an out of range value.
To solve the error I execute the query:
SET LANGUAGE ENGLISH
SELECT * FROM REGULARIZACION WHERE FECHA_CORTE = '2019-12-31'
My question is if there is a way to configure the server so that by default I take the queries of the dates in LANGUAGE ENGLISH
?
I saw that you solved your doubt, while researching I found as a reference This Answer . You can also change that parameter from the SQL Server Management Studio , In the Security - Logins part, select the user you are using to make the queries and give it Properties. You select the language in "
Default Language
". Do the same with some other user who makes queries.You can do it from SQL Management Studio by entering the advanced options in the server properties
As you can also do it directly by modifying the server settings, indicating the
langid
for it, use the following querysys.syslanguages
for instance: