Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

SQL Server 2012 (major build version 11.00.xxxx). Please also tag sql-server.

0
votes
0answers
8 views

How to set up a replication from a publisher to an always availability group with two replicas and a listener

There is a publisher that plays the distributor role, too. A database on the publisher is supposed to be replicated (Transactional Replication) to both replicas of a remote always-on availability ...
0
votes
1answer
32 views

Instead of C:\SQLDBA\ServerName\Instance rather C:\SQLDBA\ServerName_Instance

I am trying to create a folder based on the servername\instance to backup up to, i want the folder to create as servername_instance. Could you please point out where i am going wrong as it creates as ...
1
vote
1answer
40 views

Script SQL Server Agent jobs to file

I am busy making a backup of all Agent Jobs by scripting them all to file.`How would i rewrite the below to use BCP instead BEGIN SET @EchoCommand = 'ECHO ' + @EchoField + ' >> ...
-4
votes
0answers
21 views

Performance Hit [on hold]

In my opinion, this can be the simplest DML as long as the INDEXES are in place. When we started the investigation, the INDEXES were 80% fragmented. After the SQL server restart the INDEXES are 10% ...
0
votes
1answer
42 views

Migrating SSRS from SQL Server 2012 to 2016

I have a requirement of migrating my whole SQL Server from SQL Server 2012 to 2016. I have already migrated the database engine part. Since I have not really worked on SSRS (reporting part), so need ...
0
votes
1answer
50 views

Need help figuring out a daisy chain issue [on hold]

We have a goofy process (don't we all?) that daisy chains (or cascades) on a table that needs flattening out for our data warehouse. The field "alt_key" is an identifier field. It ends up being the ...
2
votes
0answers
70 views

SQL Server service is not starting

After I reboot the server, the mssqlserver service is not starting. The service account is a valid Id and logon credentials are also correct, using same account for other servers. The error looks ...
2
votes
0answers
48 views

Use LIKE in column with arabic

I have a SQL Server 2012 DB with a column that includes Arabic text. The column is nvarchar(MAX) with collation Arabic_CI_AI_KS_WS. To test if LIKE searches are working I copied some of the text ...
0
votes
0answers
27 views

Date is mismatched on maintences plan and resulting folder

We looking after almost 10 SQL server. Some of these under a following scenario: They have Differential Backup plan, which runs on 12:00 AM as Daily basic. But the resulting Backup folder is created ...
1
vote
1answer
28 views

HADR wait on servers without HA configured

I am investigating a slow SQL Server 2012 server in a virtualized (VMWare 6.5) environment, and have come across three different waits on the server that are... confusing. These are ...
1
vote
0answers
35 views

Testing Data Compression

Scenario: We have a 1 TB size table that gets queried a lot. I have suggested we use Data Compression to save on DB Space as well as help put more in memory. Because of the concern of CPU overhead, ...
1
vote
0answers
16 views

File Extensions are missing from new SSMS 2012

One of my colleagues SSMS recently got updated to 2012 version from SSMS 2008 R2. After that they are view only a few editors in SSMS for adding different File Extensions Tools ==> Options ==>Text ...
0
votes
1answer
28 views

Clone SQL Server databases [closed]

I have a 2 databases on 2 servers, Server A db1 and Server B db2. Db 1 is a clone of db 2 from 2 weeks ago, and was never updated since then. There is a short way to make db1 exactly like db2?
0
votes
1answer
30 views

Documenting where stored procs are called from [closed]

I've been wishing lately that we documented what all places stored procedures are called from. It would have to be pretty painless to do though... i.e. doing it in excel wouldn't be very good. Seems ...
-5
votes
0answers
31 views

I can't create database in mssql sql server 2012 [closed]

[![Since I cant create database in sql server 2012, I followed steps from different sites, and their common answer is this: Log on to the computer using the credentials for the domainname\username ...
5
votes
2answers
93 views

How to teach the optimizer to use index instead of fts with join on data logging master/detail tables?

SQL Server 2012 optimizer does not get it right. Test case, summary: This is a simplified test scenario. DDL statements at the bottom. I have two tables for data logging, A and B. There is a 1:n ...
2
votes
1answer
62 views

SQL Log Shipping Read Only/Standby Different users

I have a primary OLTP server on Server A and Log Shipping in Standby/Readonly mode on Server B. Log Shipping Server is refreshed every 4 hours, and utilized for BI Reporting Analysis, to reduce load ...
1
vote
0answers
35 views

SQL Server Agent Alert does not pick up some of Events from Application Log written by SQL Server Audit

My end goal is to be emailed when new object (schema, table, procedure etc.) is created / altered / dropped at one of my databases on SQL Server I created a server-level audit, that writes to Windows ...
0
votes
1answer
26 views

Email SSMS Log Shipping Status Report

We use Log Shipping to allow Business Analysis users to query data. I would like to email the Log Shipping Status report to users to see last time data is refreshed. When I Right Click on Server--&...
0
votes
1answer
32 views

Count of open sockets to the database

I want to check open socket connection count to the database. Is there any way to get the number of open sockets to the database?
-1
votes
1answer
53 views

Analysis of queries or stored procedures which ran on the database for last 15 days [duplicate]

We had a site slowdown between 11.57 am and 12:02 pm on 6th Aug 2018, To trace back the queries which were ran our production database (SQL Server Standard Edition 2012) and which might have caused a ...
1
vote
1answer
37 views

Confused to use join or sub-query SQL?

Table1 Id Name DemoID 1 a 33 2 b 44 3 c 33 4 d 33 5 e 44 Table2 Id DemoID IsTrue 11 33 1 12 44 1 Now we can find which DemoID is present in Table2 using ...
0
votes
2answers
59 views

What happens in Microsoft SQL Server 2012 .ldf when the database log file if full?

Recently we found out that .ldf file of our Microsoft SQL Server 2012 database was growing large. We have set limit as follows: Now we have a question: What will happen when log .ldf file reaches ...
1
vote
2answers
138 views

Cannot resolve the collation conflict between “SQL_Latin1_General_CP1_CI_AS” and “Latin1_General_CI_AI”

We recently started getting the following error while executing a stored procedure: System.Data.SqlClient.SqlException (0x80131904): **Cannot resolve the collation conflict between "...
0
votes
0answers
19 views

How to reset or resume transaction log chain for a database in high availability during restore of database

I ran into this specific error "The log in this backup set begins at LSN X:Y:Z, which is too recent to apply to the database. An earlier log backup that includes LSN A:B:C can be restored." I came ...
6
votes
2answers
1k views

List All Dropped Databases

I need to confirm if a particular table ever existed in our SQL Server. Is there an existing script or method one can use to list all dropped databases in an SQL Server instance?
1
vote
0answers
16 views

Mirroring on-premise SQL Server to AWS EC2 SQL Server

Trying to mirror an on-premise SQL Server instance to EC2 instance, but not much information is available on this topic. The closest one I managed to find is: Implement SQL Server High Availability ...
1
vote
3answers
52 views

MS-SQL 2012: IF NULL THEN Last Non-NULL Value

In the below table I am attempting to fill in NULL values with the last known non-null value if the current value is null. If the first value is NULL it should remain NULL. EntryDate CustId Stat ...
1
vote
2answers
49 views

How to Locate Resource System Database in MS SQL Server

There is a database called Resource database, which I know that is read only and contains information about system objects and does not save any user related data or metadata. I am using SSMS to ...
1
vote
1answer
38 views

Uninstalling 2 instances on 1 node of a 2 node SQL Server 2012 failover cluster instance

I need some pointers to uninstalling 2 instances on SQL Server 2012 cluster We have a SQL Server 2012 Active -Active cluster with instance A on Node 1 and Instance B, Instance C and 3 services on ...
0
votes
1answer
25 views

LSN mentioned in Backup is missing in Backupset

I was testing some restore scenario for one of my requirement. SO while i was restoring i got the below error. --Msg 4305, Level 16, State 1, Line 79 --The log in this backup set begins at LSN ...
0
votes
0answers
49 views

Affinity Masking

One of the servers I'm responsible for now was set up under the wrong license so can only use 40 cores on the server. This has led to an imbalance in the NUMA node schedulers. I'm planning on using ...
1
vote
1answer
24 views

SQL Server datetime column datatype stores offset

Does the SQL Server datetime column have the capability to store the offset of the time? I'd like to store a value like YYYY-MM-DDThh:mm:ss±hh e.g. 2015-07-14T10:08:15+01 But when I insert the ...
-1
votes
1answer
27 views

Find the customers who bought at least the products bought by customer with “name 4”

I have the following 3 tables: Invoice {NrFact, Date, CodCl} LinesInvoice{NrFact, Line, CodPr, Quantity,} Customers {CodCl, Name, Adress, Phone} I have tried this,but is not working SELECT ...
2
votes
2answers
42 views

Splitting the servers

We have a Windows 2012 VM running SQL Server 2012. There are around 20 databases with a total size of 5.83 TBs. There is 64GB of RAM and 16 logical processors on the box. The server is extremely busy ...
0
votes
0answers
31 views

SQL Server could not retrieve the list of publications for 'DB'

I've created a SQL Server 2012 peer-to-peer publication, but when I try to subscribe to it, I get the following error: TITLE: New Subscription Wizard SQL Server could not retrieve the list of ...
0
votes
0answers
32 views

How much size of log file may create if we alter one column of table having size of 136 GB?

We have one table in production environment having 870 million records.The size of table is around 136 GB.We are altering (i.e increasing its precision) one decimal column in the same table.We have ...
9
votes
1answer
105 views

Increased waits during checkpoint after upgrading to better storage

When we migrated from an older all flash array, to a newer all flash array (different, but well established vendor), we started seeing increased waits in SQL Sentry during checkpoints. Version: ...
2
votes
2answers
34 views

Performance Metrics be on Own Server or Own Server Instance

We would like to collect SQL Server performance metrics (memory, Cpu, page writes/sec, batches/sec,active sessions), etc. I heard its a rule not to collect Sql server metrics on the live Financial ...
1
vote
0answers
51 views

Why isn't prod level updated after applying SP - SQL 2012

My environment is SQL Exp 2012 | SELECT @@VERSION = 11.0.2100.6 (RTM) I then installed SP4 + GDR with no errors. Now, SELECT @@VERSION = 11.0.2100.6 (RTM). I would have expected 11.0.7462.6. ...
2
votes
2answers
22 views

What is the best way to shut down a 2 node availability group

This fall we will be powering down the whole data center to replace a defective power module. There is no DR site to move anything to, everything last bit of the company resides in one DC at one ...
4
votes
1answer
42 views

How to Find Pages/Sec from sys.dm_os_performance_counters

How do we find pages/sec from dm_os_performance_counters DMV, I do not see it here: SELECT * FROM sys.dm_os_performance_counters where counter_name like '%page%' Monitor Memory Usage Pages/sec ...
2
votes
2answers
46 views

How to remotely connect SQL Server 2016. Since we have 2012 and 2016 in same server

Issue I am not able to connect to a SQL Server 2016 instance on a remote system/server. My Existing Environment Windows Server 2012 SQL Server 2012 and 2016 installed on same server I tried to ...
1
vote
0answers
22 views

SQL Server with peer-to-peer replication migration from on-prem to AWS EC2 instances

I need to move three on-prem servers with peer-to-peer replication to AWS. SQL Server version is 2012. The AWS SQL Server will be on EC2 instances as the SQL Server RDS doesn't support replication yet....
1
vote
0answers
48 views

Create BCP Format File From SSMS

I want to create a BCP format file from within SSMS. Is there anyway to do this? All the sources are asking to use the BCP command line. I would rather utilize in SSMS window. https://docs.microsoft....
0
votes
1answer
62 views

Query and index optimization for a table containing 10 million records [closed]

I was trying to retrieve data from a table A to retrieve data for 1 month, which has around 10 million records and 21 indexes built on it, It took me 3 min to retrieve around 20 columns and total of ...
4
votes
1answer
102 views

Why do I get incorrect characters when decoding a Base64 string to NVARCHAR in SQL Server?

I've been looking at how to decode Base64 with SQL Server and after searching around many solutions online (some from here) seem to be based upon this sort of method. SELECT CAST(CAST('...
1
vote
1answer
35 views

Handling 'Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements'

Our systems suddenly started failing on: Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. There was no service pack or other installation changes ...
1
vote
0answers
30 views

Restricting users to execute queries that bloat up tempdb

we have many a times faced a scenario where bad queries using tempdb just bloats up this system database filling 700 GB of tempdb in like couple of hours. I know there is a scope to tune them up. But ...
3
votes
2answers
49 views

Tempdb with Multiple mdf and Renaming

We just inherited a legacy Tempdb database with Multiple MDF files. Tempdb1 is the primary. Example: Tempdb1.MDF Tempdb2.MDF Tempdb3.MDF (1) Was tempdb2.mdf and tempdb3.MDF being ignored the whole ...