date issue after migrating to SQL Server 2012 - 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.

Related

SSRS 2012 to SSRS 2016 causing reports to show different NLS parameters (Oracle 12c (12.1.0.2.0) )

We've recently updated SSRS to 2016 from 2012 - once we updated the server and installed the ODAC we noticed the NLS settings change for reports (for example if we run SELECT * FROM V$NLS_PARAMETERS locally the NLS settings default to UK however when we run this through a report it defaults to US).
This issue is causing day parameters (TO_CHAR(DATE,'D')) and date parameters ('DD/MM/YYYY') to break.
Any advice would be greatly appreciated.
Thanks
Always check nls_session_parameters because that will be the one finally used by the database.
select * from nls_session_parameters;
And use for example ALTER SESSION To MATCH the parameters with REPORT or vice versa
ALTER SESSION SET NLS_DATE_FORMAT='DD/MM/YYYY'

I have exactly same code in DEV and PROD and few properties(PII data) on PROD is masked and on DEV its not

I'm seeing SSN masked on PROD and it is not masked on DEV with same exact code. I looked up the stored procedures it is calling and it is simple select statement. I inquired DB admin and he said they are not doing any masking, since they are using SQL server 2012 he is pretty sure it is not happening on sql server side(sql server 2016 and up year can do masking on DB).
I need suggestions what else I can debug or is it possible to do masking on SQL server 2012?

SQL Server datetime field issue

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

Oracle-to-SQL Server replication: manipulate data during replication

I've "inherited" a working Oracle (10g) to SQL Server 2005 data replication using standard SQL Server snapshot and transactional replication.
Everything works fine - as long as Oracle doesn't try to send a date that's outside the SQL Server DATETIME range (1753/1/1 to 9999/12/31). I was hoping to be able to somehow get in the middle of the data replication, check for that date range, and if necessary, tweak the Oracle date being published to be something that SQL Server 2005's DATETIME datatype can handle.
Is there any reasonably easy way to do this?? I know I could just change the target datatype to VARCHAR(19) or something like that - and I know I could upgrade to SQL Server 2008 and use the DATE or DATETIME2 datatypes to solve the issue - both options aren't viable right now (maybe in 6, 12 months or so).
Is there something I can do right now? And easily?? I cannot get too deep into Oracle to fix it here, unforutnately (that's another third-party company that doesn't like other folks fiddling around in their system).
I don't believe there's a solution to this - from what I understand, the replication process is similar to using the log reader for transactional replication, so it's a black box - it's unlikely that you could inject any code into the process, and if you could, it would be lower level code than SQL.

DATENAME(MONTH,GETADATE()) is returning numeric value of the month as '09'

When I run the following query [SELECT DATENAME(MONTH,GETDATE())], ideally speaking it should return value as 'September' but its returning value as '09'. I am running this query on MS SQL Server 2005. Is there anything I need to configure with MS SQL Server 2005?
Please find the details of the SQL Server 2005
Component Name Version
--------------------------------------------------------------------
Microsoft SQL Server Management Studio 9.00.1399.00
Microsoft Analysis Services Client Tools 2005.090.1399.00
Microsoft Data Access Components (MDAC) 2000.086.3959.00 (srv03_sp2_rtm.070216-1710)
Microsoft MSXML 2.6 3.0 4.0 5.0 6.0
Microsoft Internet Explorer 6.0.3790.3959
Microsoft .NET Framework 2.0.50727.42
Operating System 5.2.3790
SELECT ##LANGUAGE -> gives an Asian one?
SET LANGUAGE Japanese
SELECT DATENAME (month, GETDATE())
SET LANGUAGE us_english
SELECT DATENAME (month, GETDATE())
DATENAME depends on language, so need to change server default or your login default language...
Thank you and sayonara...
Hmmmm, I get "September", SqlServer 2005 9.00.3402.
Nope, SELECT DATENAME(month, GETDATE()); returns September for me. I just tried it in SQL 2005 and 2008. Where are you executing this query? That may help as to why this is happening to you.
The only thing I can think of would be collation causing that, but I can't find any specific examples of a collation that would do that. The other possibility could be the language which also sets date format. I'm a bit mystified, but these are places to start.
Try running:
select name ,alias, dateformat
from syslanguages
where langid =
(select value from master..sysconfigures where comment = 'default language')
To see what language the system thinks it's using. SqlServer changes its date format based on that.