Questions tagged [sql-server-2012]

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

Filter by
Sorted by
Tagged with
5
votes
2answers
597 views

Deleting data from a table containing LOBs did not reduce the amount of data reported INTERNALLY by the table or database

Running SQL Server 2012 standard, using both replication data and log shipping. Transaction log backups are created every few minutes. This question is NOT about the amount of space reported by the ...
2
votes
2answers
348 views

Concurrent backups (full and transaction) and testing recovery model

My intent is to test my recovery model and setup log shipping to replicate a database on another server. I have a database called AdventureWorks on a primary sql server. Presently SQL Backup performs ...
0
votes
1answer
1k views

How to implement SQL Server Service Broker with external activator

I am trying to execute an external app using SQL Server Service Broker and the External Activator provided by Microsoft. I have created the following script: IF EXISTS (SELECT * FROM sys.databases ...
0
votes
2answers
41 views

How can I only UPDATE if the user was created?

I got A cursor with some ifs like this one: IF @ROLE='RW' BEGIN SET @COMMAND =' USE '+QUOTENAME(@DATABASE)+' CREATE USER '+QUOTENAME(@...
1
vote
1answer
63 views

Casting int YYYYMMDD to date produces incorrect value in Squirrel-SQL

I have extracted some data from a legacy database where dates are stored as Numeric(8) values, in YYYYMMDD format. I've stored them in a staging table in that same format, and now I would like to ...
0
votes
1answer
27 views

How to Grant A User Under A Sql Domain Account To Insert and Update Records

I have a sql domain account in sql server like DOMAIN\GroupName. There are many user accounts under that account like DOMAIN\user.name. I want to give insert and update permission only to a user under ...
0
votes
1answer
61 views

MSSQL 2016 - Restore SSISDB from MSSQL 2012

On "MSSQL 2016 (SP2-CU11) (KB4527378)" I created empty SSISDB. After that I restored SSISDB from "MSSQL 2012 (SP4) (KB4018073)" to "MSSQL 2016 (SP2-CU11) (KB4527378)" On DB I set owner to sa and ...
0
votes
1answer
10 views

How can I Get Value of Max(col) in a greatest n per grouped by into Declared variable. MS SQL sever

I am looking for how to set the value of @MaxItemSeqNum to the returned result of the column MAX(dbo.[Table1].[Item_Seq_number]) in my select statement. I need this in order to insert the next record ...
0
votes
0answers
12 views

Incremental Load SSIS Job not capturing Data from CDC tables [closed]

I have few tables enabled with CDC and SSIS job is working side by side to deliver the incremental data to FTP via text files. It was working fine few days back but now job is generating the files ...
1
vote
1answer
93 views

SQL Server - db_owner user can't see sys schemas

these is a user in database XXX_service (it's technical account) and it has set "Server role" - public and and user mapping as dbo_owner for one database. Programmer sent logs and there are errors ...
1
vote
1answer
56 views

Why only few of expected tasks are processed although many cores are available?

I push some data from one database to another on the same instance using Service Broker. 20 cores are online, 6 Service Broker tasks are activated, every taks is working on indepentent piece of data. ...
0
votes
1answer
39 views

Duplicate record inserted - why trigger is not preventing it?

I have two tables: DebitIUVs and RPTs. I have record inside DebitIUVs which is with state 118001. My business logic must insert new line inside RPTs table. Inside RPTs table there is additional ...
0
votes
0answers
28 views

Stuff With XML Path

DECLARE @v NVARCHAR(MAX)='' select @v =STUFF((SELECT CASE WHEN MeterID=0 THEN '' ELSE CONVERT(VARCHAR(50),MeterID) + ',' END AS [text()] FROM (SELECT DISTINCT mr.MeterID FROM #...
4
votes
1answer
2k views

“Corrupted key” error when creating/updating SQL Server 2012 credential for proxy account

Following a restart of a SQL Server 2012 SP3 instance caused by a reboot of the unresponsive host WINTEL server, I have a SQL Agent Log Shipping Copy job (which uses a proxy account to access the NAS ...
6
votes
3answers
11k views

How to check history of primary node in an Availability Group?

How do I see history of failovers of the primary node of a cluster? I'm trying to figure out at what point secondary node started to act as primary. We are running Windows Server 2012 with SQL Server ...
1
vote
1answer
538 views

Sql Server Query timeouts when duration is under a second

We are getting the following exception in an application: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. So, I looked ...
1
vote
3answers
1k views

Query to see Index Fragmentation on all databases without using SP or temp tables

I am trying to compile a index fragmentation report on all databases, in a multi-server environment. The query will be executed via an openquery command, so I would like to make it as simple as ...
3
votes
4answers
9k views

How to properly increment an int identity in SQL Server if the Identity Increment isn't set?

When I use SQL Server with an int based identity column, I always use the auto increment. But I'm needing to insert into an existing table that doesn't have the property set, and I'm wondering what ...
3
votes
2answers
2k views

After Restore Log_reuse_wait_desc of Replication

I'm wondering if anybody has ran into this issue before and has any suggestions on what's causing it/how to fix it. We are restoring a database into lower Dev environments and after the restore the ...
-1
votes
1answer
24 views

Delete Data in Two Tables Based on Date in One Table

I am trying to delete data in a table where a date field value is older than 30 days and also delete related records in a second table that has no date field based on a matching key column in both ...
1
vote
2answers
1k views

delete WSFC 2012 cluster role/group fails

PS C:\Windows\system32> get-cluster Name ---- sql2012poc_cl1 PS C:\Windows\system32> get-clustergroup Name OwnerNode State ----...
2
votes
1answer
478 views

NUMA configuration

We have clustered servers, each of which has 32 CPU cores and 512 GB memory. The cluster is home to 7 instances of SQL Server 2012 Standard Edition. With Standard Edition allowing a maximum of 64 ...
2
votes
1answer
64 views

Date time cast preferred method

What would be the preferred method for speed and less database stress using a between or less than? SELECT LogId FROM [Master].[dbo].log mlog WHERE cast(LogDate as Date) BETWEEN '2019-01-01' AND '...
0
votes
1answer
44 views

How can a field with multiple values be used with SQL Server?

For example, I have a field in MongoDB like this: "SignedDocs" : [ { "_id" : "blablabla" "title": " bla bla bla" }, { "_id" : "blablabla2" "title": " bla bla bla2"...
3
votes
2answers
345 views

Upgrading from SQL Server 2012 SP1 to SQL Server 2019

I'm upgrading an internal database at work, and we are creating a new VM to host it. I can't see an option to generate a script to export the SQL Server 2012 SP1 database for server version SQL ...
2
votes
1answer
67 views

Breaking point for SQL server database based on connections from app to SQL server [closed]

We have been asked to confirm on some capacity test for one of our SQL server. Application team is building their new app servers with better infrastructure to connect to SQL server. Currently with ...
0
votes
1answer
35 views

Patching SQL server

I am having the original release of the 2012 server having bulid number 11.0.2100.60. I have a question like can we install the current patches on the existing version or do we need to do it in stages....
1
vote
1answer
1k views

How to replace multiple unicode characters

I have identified a couple of unicode characters in my database by means of the following query: SELECT name FROM table WHERE name NOT LIKE '%'+CAST(name AS VARCHAR(1000))+'%' ...with which I get ...
1
vote
1answer
1k views

Server Local Connection Provider has stopped listening on local pipe due to a failure

All, I'm looking at a database where every so often, connections to it will fail. The event viewer and SQL Logs have the following error in them: Server local connection provider has stopped ...
0
votes
2answers
107 views

Import data from excel to table in sql

Please I have issue that when I try to import data from excel to table in SQL it fails with below errors even I modified all the tables in the tables to be nvarchar(max) and I tried to enter dummy ...
0
votes
2answers
88 views

SELECT last date from multiples values

I have this table: I want to make a query that allows me to show the last value in fecha_gestion grouped by NitSec. It would be something like this: SELECT id_log, fecha_gestion, nitsec FROM table ...
5
votes
3answers
115 views

Optimizing table/indices for getting the latest row (filtering by one additional column)

I have a SQL Server table (SQL Server 2012 SP3 Standard edition) that stores a bunch of configuration information (basically text blobs) for different organizations. The schema is something like this: ...
0
votes
2answers
1k views

How to Solve the Failed to initialize the CLR

I Have a Following Error .. Failed to initialize the Common Language Runtime (CLR) v4.0.30319 with HRESULT 0x80004005. You need to restart SQL Server to use CLR integration features. How To ...
1
vote
2answers
6k views

Can not ping Always On listener from outside primary node

I just setup SQL Server 2012 (on Windows Server 2012) Always On feature and have a problem with connecting to SQL Server Listener from non-primary node (it works from primary node though). Here is ...
1
vote
0answers
518 views

Log Reader Agent Blocking Distributor Agent T-log Stuck with log_reuse_wait_desc Replication

I've got a nasty SQL Server 2012 replication issue. I have a transactional publication going to a pull subscriber. The log reader agent on the publisher has gotten stuck in a loop of: Delivering ...
0
votes
2answers
827 views

how to create custom id in sql server with sequence

How can I create a table with custom ID like BK-0001001 with a sequence. Sorry I'm a newbie with databases. All help will be appreciated thank you!
0
votes
1answer
62 views

Differential backup same size as of Full Backup

I have a SQL Server database of almost 2 TB size, it has tables with image datatypes. Now the size of differential backups are same as that of full backup. Does image datatype makes any difference to ...
1
vote
1answer
4k views

SQL Server Cluster Service Online Pending Status

I have 2 Nodes of SQL Cluster running SQL 2012 Ent over Windows 2012 R2 and i don't know suddenly what happened the service is not coming online. Under Failover Cluster Mannager > Roles > SQL > ...
0
votes
1answer
43 views

Offline index rebuild - does it also create a whole new copy of the index?

As I know, while online index is rebuilding, SQL Server virtually creates an index and then at the end it swaps the existing old index with the new created one and then finally drops the old index. ...
0
votes
1answer
982 views

SQL Server Average Lock Wait time Historical data

Monitoring software has indicated average lock wait times rising to 500ms during the night. Is there any way of confirming which locks these were as we currently do not log any performance data to a ...
1
vote
2answers
60 views

How to Add A User To A Database In Standby / Read-Only Mode In Sql Server

I have a database which is in standby / read-only mode in my reporting server. But, I can not add a new user to this database. How can i add a new user to this database?
2
votes
1answer
225 views

Why is our select statement using a predicate clause with string concatenation running faster than our select statement using a single field?

We have been working on an application that utilizes a view with several tables in our database. This view is utilized throughout the application, and although significantly more complicated than the ...
0
votes
2answers
177 views

msdb.dbo.sp_send_dbmail temp table does not exist

I have created a temp table and would like to email the results I am getting the following error. Query execution failed: Msg 208, Level 16, State 1, Server PRODYCHDBX3\X3V7, Line 1 Invalid ...
0
votes
1answer
664 views

Drop a replicated subscription table that has been orphaned after restore migration

We restored a database on a new server for a migration. When attempting to set a subscription to a transnational publication, we get the error: Can't drop the table because it is set for ...
0
votes
1answer
27 views

Differential Backup of A Table In Sql Server

I will transfer the datas of a two different table to a database in reporting server Daily but i don't want to do it manually and also don't want to transfer all the datas to that databases everyday. ...
3
votes
2answers
3k views

Full text search using words stored in another table

Is there a way to do a full-text search using words stored in another table? This is my scenario: Table_A contains phrases entered by users in field "UserInput" (and other stuff). I have a full-...
3
votes
1answer
3k views

SQL Server 2012 hangs at SqlRsConfigAction_install_ConfigNonRC_Cpu64

For some reason SQL Server 2012 keeps hanging at SqlRsConfigAction_install_ConfigNonRC_Cpu64 There isn't any Windows installer running apart from the SQL Server setup. Update on Resolution Install ...
1
vote
1answer
202 views

How to setup encryption on a column that joins two tables in two different databases

What is the best method to encrypt a column that exists in two tables (BUID) in two different database on a 2012 server, at the end should be able to join on the encrypted columns between two tables ...
1
vote
1answer
555 views

Maintenance plan to delete backup and restore history not working

I have a maintenance plan set up on our SQL Server 2012 that contains only a "History Cleanup Task", which is configured to delete the following data if older than 4 weeks: Backup and restore history ...
1
vote
1answer
97 views

Shredding Query Plan XML For Potential Skewed Estimates - Data Type Conversions

I'm using the below T-SQL to check for root level estimate skews in execution plans by pulling the estimated rows from the execution plans and comparing to the last rows from the sys....