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
0
votes
0answers
12 views

Inserting Millions Records Into A Table With Identity Column In Sql Server

I was changing the primary key column to different column on a table which contains about 300 million records in itself. I used the table design screen to change it but it got time-out. And, i decided ...
1
vote
1answer
22 views

Sql server sleeping state is increasing using ADO.NET?

We have one live ASP.Net application which is used by around 1000 concurrent users. In this application we have used connection pooling. There are 2 connection string defined in web.config with ...
-3
votes
0answers
20 views

Which is faster in Windows service and Sql server Jobs and Why?

I am working on a application and we have created a stored procedure which is updating and selecting some data. We have not used Transaction in SP. Now we are calling this sp from windows services and ...
1
vote
2answers
21 views

Incremental backup between now and backup taken one week ago

We do a full backup of our SQL Server 2012 database every night. A new developer needs an incremental (or differential) backup of a backup we took one week ago. The reason is that for them, ...
1
vote
0answers
12 views

Informatica MD5 function vs SQL Hashbytes MD5 function

I am hoping someone has some crossover experience here. I am attempting to utilize the Hashbytes function within SQL to match a value that is being generated utilizing the MD5 function from ...
7
votes
2answers
294 views

See details of old sessions

Is there any way of seeing details of sessions from the past (I fully expect the answer to be "no"). I am trying to find out what server a certain application is running on, that application accessing ...
2
votes
1answer
31 views

Log Shipping and Daily Backup

My SQL Server 2012 DR setup is a mess. We've had a maintenance plan in place from the beginning that takes a daily full backup, with hourly log backups. Recently, we set up log shipping to an off-site ...
0
votes
0answers
15 views

TDE Encryption and “Recovery Pending” After Service Reebot

I've recently enable the TDE Encryption in a SQL Server 2012. I've setup de Encrytion key and the certificate in Production and exported to the Test Environment in order to copy/update test environmet....
3
votes
2answers
2k 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-...
-1
votes
1answer
47 views

How can I achieve the below case in marketing cloud without using loop? [on hold]

I have a table like this and in the table you can see 123 losing to 456, 456 losing to 789 and 789 losing to 101112 and in the same fashion for ID's 5 and 6. In this case I want to replace winner ...
0
votes
1answer
24 views

Passing Variable in json_value in sql server 2016 [duplicate]

declare @id int set @id = 1754 select (JSON_VALUE(cast(ad.data_map as varchar(max)),'$.dataMap."1754".value')) CorrespondanceNumber, (JSON_VALUE(cast(ad.data_map as varchar(max)),'$.dataMap.***"'+...
0
votes
1answer
768 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
357 views

SQL Server Management Studio DAC connection error

I'm trying to connect to SQL Server 2012 via DAC using Management Studio. I type admin: before my server name, yet I keep getting the same error: A network-related or instance-specific error ...
1
vote
1answer
35 views

What impact on the index storage size does overprovisioning of varchar types have?

Does over-provisioning varchar columns (as in using varchar(100) to store values from 1 to 10 characters long vs using varchar(10)) have any impact on the index storage size and if yes than why? I ...
3
votes
2answers
9k views

SSISDB master key

I recently had to recover my ssisdb databases, along with all other user databases to a new server because of a hardware failure. I am now seeing the following errors when trying to run ssis jobs ...
0
votes
1answer
26 views

Does Data Migration Advisor migrate system databases?

I would like to know if Data Migration Assistant copies system databases (master, model, msdb) into the new server.
0
votes
0answers
10 views

Report Service stopped unexpectedly

The SSRS service stopped unexpectedly and the workaround was to recycle the app pool and then restart the service, but no clue of what happened. When looking at the error log below:   <Path>C:\...
0
votes
1answer
1k views

Persistent Data Collector Collection_Set_3_Upload Job Failure with AlwaysOn Groups Enabled

I have a two node SQL 2012 AlwaysOn HADR cluster (v11.0.3412) with 3 availability groups configured. The AG groups are set to synchronous mode and the secondary is not readable (we do not want the ...
0
votes
0answers
43 views

A Procedure Causes Some Blockings In SQL Server [on hold]

There is a stored procedure in my sql server database and it causes so much blockings for itself. Here is the code. How to solve this issue? USE [FATURA] GO /****** Object: StoredProcedure [dbo]....
3
votes
1answer
131 views

How can I get rid of this Lazy Spool, or otherwise improve this query's performance?

Here is the plan: https://www.brentozar.com/pastetheplan/?id=rkM8d7ONS I am mostly interested in how to get rid of the lazy spool? This is the query: SELECT DISTINCT SM.Security_ID '...
1
vote
3answers
2k views

How do I get a run duration in minutes for each individual step in a single Job?

The Run_Duration in sysjobhistory of the the complete job. Is there a way to get this? [msdb].[dbo].[sysjobactivity] only has the last step.
0
votes
1answer
104 views

Keeping my database updated every 30 minutes using Log files

I have a situation where I get a full nightly backup and trans log backup every 30minutes starts at 7:00 am ends at 2:00 am. I need to restore them every 30 minutes into a database and replicate this ...
0
votes
2answers
183 views

Granting a SQL Server database only user execute on xp_instance_regread fails

So I'm not finding an answer to my specific issue. SQL Server 2012 database SSMS 17 admin tool Log on as a database (not domain) user foo. Receive sys.xp_instance_regread no permission errors. In ...
-2
votes
0answers
21 views

What would be the suitable certification for SQL Data protection and privacy? [closed]

This posting is not related to any specific issue. I couldn't find suitable Certification code related to SQL Data Protection , Privacy , SOX ( Sections 302,404,408, 409 etc..) What would be the ...
1
vote
1answer
31 views

When are statistics created?

I know that when we create an index then statistics are automatically created. My question is: Is it the only case when statistics are created? I remember that once I found on the internet that we ...
1
vote
2answers
904 views

New Server Query AD is giving permission error

We replaced a physical server with virtual, I copied all the logins, and linked servers from the old server and restored all the databases from the old server to the new. Everything works fine except ...
1
vote
1answer
601 views

Identifying Execution Plans with Probe Residual

I am trying to find out Execution Plans that has Probe Residual. Need to know the following Which physical and logical operator has this Probe Residual What is the Cost% of that operator in the ...
1
vote
3answers
102 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 ...
0
votes
1answer
103 views

Secure Symmetric key from sa

Can I secure SQL Server symmetric key from [sa] account? Can I create symmetric key using local user certificate via MMC? Thanks
-1
votes
1answer
39 views

How to loop data month wise for the targeted dates [closed]

I need to load data from a primary table to an archive table by month or week. As an example, I have a table called transactions with a column named return_datetime where I have 5 years or data. I ...
0
votes
2answers
122 views

How can I use SQL Profiler to capture a single stored procedure

Using SQL Server SQL Profiler, which configuration can be used to monitor a single stored procedure? I'd like to capture all EXEC sprocName to include the parameter list. I'd like to capture this ...
0
votes
3answers
93 views

Check if the value from one table exists in another tables in SQL Server

I have one table (tbl1) with column ID, the values can be duplicated. I have others tables (tbl2, tbl3...) with column ID , values are unique. I want to write a trigger on insert row in tbl1 and check ...
1
vote
1answer
64 views

Is it useful to index a column if it is already the first column in a composite index? [closed]

Suppose I have this table (simplified from my project): create table BillTax ( BillID int not null constraint FK_BillTax_Bill foreign key references Bill(BillID), TaxCode varchar(20) not null,...
0
votes
1answer
17 views

Implementing gMSA account for SQL FCI

I have a question on implementing gMSA account for managing authentication to SQL server. Our goal is to use gMSA account to manage the auto password change activities for SQl server service and it's ...
3
votes
3answers
6k views

How do I detect execute permission granted to a role (when no ON clause was used)

I just spent hours trying to figure out how an app had privilege to execute stored procedures. TIL from StackExchange: Turns out the ON clause is optional for GRANT, allowing a role to be granted ...
0
votes
2answers
90 views

How to grant or allow a particular SQL Server Login/User to always view a Column Level Encrypted data?

I used Column Level Encryption to encrypt one of the columns in my SQL Server database. Now everytime I want to SELECT to see that encrypted data, I have to open the symmetric key to decrypt the ...
1
vote
5answers
6k views

Query last time a view, function or sp was last used/read

I use sys.dm_db_index_usage_stats.last_user_seek, sys.dm_db_index_usage_stats.last_user_scan and sys.dm_db_index_usage_stats.last_user_lookup to query last time a table was read. For views, functions ...
1
vote
1answer
411 views

Attach Database is disabled in Microsoft SQL Server 2012 Management Studio

I have buy from Godadday hosting and domain, after that I have create database in godaddy and the connect to this db using my authentication. I have .mdf, .ldf that need to attach to the connected ...
3
votes
3answers
152 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 ...
8
votes
1answer
268 views

Do I need a “downtime” to update a stored procedure? (Due to “definition changed” error)

I always thought that updating a stored procedure was something I could do while users were actively using the system. But I am currently testing out an update to a stored procedure and while a long ...
-1
votes
1answer
51 views

restart sequence when the year changes

Is it possible to do a sequence with Start at 1 and INCREMENT 1, and when changing the year, restart the sequence? -- code# Create a sequence CREATE SEQUENCE SEQ_ALUNO START WITH 1 INCREMENT BY ...
1
vote
1answer
93 views

Transaction log rollback broke Log Shipping chain?

Is it correct that performing a transaction log restore to a previous point in time will break the log shipping chain? If this is correct, is there a way to recover from this situation without having ...
0
votes
0answers
14 views

Not able to migrate DTS package from SQL Server 2008 to 2012. Getting errored out

Requirement: We need to migrate SSIS/DTS package from SQL Server 2008 to another machine having SQL Server 2012 on it. Steps performed so far: 1. First I exported the package from Source server to ...
1
vote
1answer
93 views

How to improve query to include 2 critical pieces of employee data

I’m going to preface by saying that I’m fairly green with SQL. My code below works, however I am missing two vital pieces of my employee population: (1) those employees who have been invoiced but ...
0
votes
2answers
122 views

Options for structuring multiple associations to a record

This is 101 level stuff and I promise to read a book later, but in the meantime, given the following three tables: Product --------- ProductId (uniqueidentifier) User --------- UserId (...
0
votes
1answer
39 views

SQL Full Backup job is taking too long to complete

I am facing a strange issue with daily FULL backup. We have a total of 23 databases. We have 1.21 TB big database in this SQL server 2012 Standard Edition. We are taking daily FULL database backup for ...
4
votes
2answers
75 views

A table with all fields NULLable with important, sensitive data

I have a requirement for a database table to hold sensitive patient information about their lifestyle (alcohol/ drug use / injecting etc). On screen the information is sectioned into tabs - "alcohol",...
12
votes
1answer
154 views

Is this a symptom of an overloaded server?

I've been trying to diagnose slow-downs in an application. For this I've logged the SQL Server extended events. For this question i'm looking at one particular stored procedure. But there are a ...
33
votes
3answers
8k views

Are there disadvantages to contained databases?

SQL Server 2012 introduced the concept of "contained" databases, where everything (well, mostly everything) the database needs is contained within the database itself. This offers big advantages when ...
1
vote
1answer
426 views

BACKUP Detected Corruption in the database log

I took a backups of a few db's on server A (2008R2), Then restored it to server B (2012). One database had TDE enable, so I disabled it, took a back up then proceeded to server B. The other database, ...