Change language in the database during a query

Asked

Viewed 351 times

0

Is it possible to change the language of the database only during the execution of an insertion query? I am having problems with date conversion due to the formation of them, the Bank expects dd-mm-yyyy, but in the query is yyy-mm-dd.

  • In fact, you need to convert before, in the language you are using to access the BD.

  • Hello Marcelo, I have an Insert already ready, and this is very big and can not be created again.

  • So you want the easy answer. Without modifying anything I really don’t know answer.

1 answer

2


The easy way is applying CONVERT and specifying the desired format as the third argument. In your case, code 105:

SELECT CONVERT(VARCHAR(10), GETDATE(), 105)

It will generate something like:

18-07-2014

Other formats: http://msdn.microsoft.com/en-us/library/ms187928.aspx

Browser other questions tagged

You are not signed in. Login or sign up in order to post.