Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [sql-server-2012]

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

0
votes
0answers
24 views

pivot vs multiple columns

I have a table that I've been tasked to look at for optimization (both for entering data through stored procedure, and for views based off the table). The table has (currently) 115 columns, 2 make up ...
16
votes
2answers
1k views

Is it possible for SQL statements to execute concurrently within a single session in SQL Server?

I have written a stored procedure which makes use of a temporary table. I know that in SQL Server, temporary tables are session-scoped. However, I have not been able to find definitive information on ...
1
vote
1answer
24 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 ...
15
votes
4answers
927 views

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

Currently, we have an existing database and application that is fully functional. I do not have the ability to change the architecture at this point. Today, each table in the database has an "...
1
vote
1answer
51 views

I want to change to Dynamic SQL Query instead of CASE statement [on hold]

I have two tables as below and description is given in below Employee table id EmployeeID departmentid department1 department2 department3 1 300 100 IT Finance ...
1
vote
1answer
19 views

Is there any way to find information of index fragmentation, Statistics information with the help of system tables in SQL Server

I am working on a report which will give information for different segments like blocking process, slow running queries, disk space etc. I also want to add one more segment where I can get information ...
2
votes
1answer
51 views

CTE Query to CONCAT text (over 10,000 rows)

I am trying to construct a CTE query to loop through rows of data and concatenate text into one line for each SampleUserNumber. Below is what I am working with: CREATE TABLE #SampleTable ( ...
2
votes
2answers
38 views

Selecting the same column from Different rows Based on Different Criteria

My table creates a row for each customer name for the unique customer number. CREATE TABLE #src(Number int, name varchar(32), seq bit); INSERT #src(Number,name,seq) VALUES (12345,'Mickey Mouse',0), (...
0
votes
1answer
43 views

Drop the user from Read only Secondary database Always ON server

How to drop a user from the secondary database in an AG when it is in read only mode and synchronizing in SQL Server 2012? The login and user have been deleted from the primary database, and we are ...
1
vote
1answer
17 views

SQL Services Wont Start After Removing TLS [duplicate]

I need to remove TLS 1.0 from one of my SQL servers. When I do so and then reboot the server the SQL services dont start automatically. When I attempt to start them I get an error that it cant be done....
0
votes
0answers
27 views

Create SQL Server Agent job for stored procedure with input parameter

Could you suggest please how to create SQL Server Agent job for a stored procedure that have 1 input parameter? The procedure is correctly created and i executed it using this code : EXECUTE dbo....
0
votes
2answers
51 views

Triggers vs. Jobs in SQL Server

I’m designing a database with a table that automatically gets loaded with a new record every 15 seconds (each record will have a 'timestamp' field and around 50 ‘float’ fields). Each record in this ...
-1
votes
0answers
19 views

Compare 500 files and load only distinct record

I have 400 to 600 different files and with same data type. But in these files, we have so many duplicates record in all the files. In my folder, there are A.txt, b,txt, c.txt files are there. It ...
0
votes
1answer
33 views

Security admin access [on hold]

I have plans to leverage security access request to L2 team to manage their create and modify logins permission in SQL server 2012. So that they can manage the Grant and revoke permissions for ...
1
vote
2answers
67 views

SQL Server - Extremely low avg_page_space_used_in_percent for heap table

While analyzing a SQL Server 2012 database bloat issue, I found that fragmentation might be a major contributor to how much space is being taken up by certain tables, so after some Googling, I'm ...
0
votes
1answer
34 views

How to get MSSQL Type definition from system tables?

If I have a user table type (like CREATE TYPE ...), how do I get to it's definition in the system tables? I know I can see it through SSMS through GUI, but I would like to have a query to retrieve ...
0
votes
1answer
36 views

Setup Multiple SQL Server Tree Structure similar as RDC based on Enviornments

I want to setup multiple SQL Servers like a tree structure similar to Remote Desktop connection Manager, where we can setup multiple servers based on environments we support like Test and Prod.
0
votes
1answer
15 views

Query error: there is no matching unique or primary key constraint in the referenced table

I am getting an error of *Cause: A REFERENCES clause in a CREATE/ALTER TABLE statement gives a column-list for which there is no matching unique or primary key constraint in ...
0
votes
1answer
44 views

SQL - Update certain database records with a loop

I have a certain IDs in a table that I would like to change a column value from false to true. How can I do a loop that goes through the specific IDs given and changes a column value from false to ...
1
vote
1answer
44 views

Conversion of Row into Column

I'm in very weird situation and i have researched a lot but not able to find anything similar to this scenarios. Input looks something link this. Where Each patient has Primary Dx code, Admit Dx ...
-2
votes
0answers
18 views

SQL Server 2012 on Windows 2016 installation issues

I have tried to install a fresh install of SQL Server 2012 on a Windows Server 2016 several times now. I had to add 3.5 framework as expected, and I got errors that prevented the database engine from ...
0
votes
0answers
18 views

What are SSIS ,SSRS and DB engine SQL server 2008R2 to 2012 IN PLACE UPGRADE steps and cautions? [duplicate]

I am trying to find, SSIS ,SSRS and DB engine SQL server 2008R2 to 2012R2 IN PLACE UPGRADE steps and cautions ? Thanks, DL
-1
votes
1answer
64 views

Retrieve records when value in column changes [closed]

I am using SQL Server 2012. I have this table below. I would like to get records when the Name changes (see column result). I' m not getting with this code. SELECT [Date], [Name] FROM myTable as T1 ...
0
votes
0answers
19 views

SQL server 2014 new publication error “A generic failure occurred during Service Master Key encryption or decryption.”

I'm trying to create a new local publication (replication , Transactional Publcation) on my production data base but i'm getting an error A generic failure occurred during Service Master Key ...
1
vote
0answers
25 views

SSMS - Data load Option

I have recently installed the newer version of SSMS on my system. But the option to load the excel file is grey out. I'm not able to load BULK Load I tried to run DTSWizard.exe, even it doesn't give ...
2
votes
1answer
93 views

Direct values on predicate produce not-so-good plan

I'm using StackOverflow dump to run some tests. In particular, I'm querying this table: I have created this index: I'm running the following query (just forcing an index to test alternatives) I ...
0
votes
1answer
57 views

Query taking more time to execute due to lengthy column size

When I am trying to execute below query in SSMS, the query is taking more time (more than 10 minutes) to execute due to lengthy column size (Column Name: Keywords, Column Size: nvarchar(4000)). ...
-1
votes
0answers
34 views

Admission count in SQL

In above scenario, Patient A has been admitted to ER to Hospital A and then transferred to another ER hospital or they may transfer to Hospital in a day or on same day. I need to calculate the ...
0
votes
1answer
28 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
0answers
62 views

Regarding NIGHT SHIFT Employees

I have small issue on night shift of our employees. Shift timings are from 22:00 to 6:00. If the shift starts today at 11 PM it will end the next morning at 6:00 AM (7 Hours ). Here I want to know ...
8
votes
3answers
622 views

CAST throwing error when run in stored procedure but not when run as raw query [duplicate]

Something very odd is happening here. I have a query that looks like this. SELECT CAST(FT.DOP AS SMALLINT) FROM TRACKING_DATA WHERE date > @mydate and identifier = 0000000000 When run as a raw ...
0
votes
0answers
36 views

Loading 'Image Service Package' crashes Management Studio

I'm getting the following error on my SQL Server when I log into the system: I ran a repair on SSMS successfully, but it did not resolve the issue. The following error message is recorded in Event ...
1
vote
2answers
115 views

Is this deadlock related to our database?

our application is running in a SQL enterprise cluster hosted at a client. We don't have administrative access. They are saying that our database is generating deadlocks, and sent us a huge trace file....
2
votes
2answers
106 views

Slow checkpoint and 15 second I/O warnings on flash storage

Last couple of weeks we've been working on getting to the root cause of what could likely be the cause of the occurrence of these I/O issues and slowdown of the checkpoints. At first glance it looks ...
0
votes
1answer
37 views

How to deploy the SQL scripts to the local database (one-click deployment)?

How to deploy the SQL scripts to the local database (one-click deployment)? On a periodic interval, we receive .sql files from Developers. I will have to automate the process of pushing all .sql ...
0
votes
2answers
49 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 ...
3
votes
1answer
67 views

sp_blitzCache results Memory grants

I am running SQL Server 2012 and and using the March 2019 release of sp_blitzCache to analyze some slow running queries on the system. I have executed the stored procedure with parameter @SortOrder = ...
0
votes
2answers
37 views

Disk Separation DB installation and data files

I am wondering whether it is a good idea to separate the database installation media from the actual data files. In our current environment we have: C: - Windows Server D: - MS SQL Installation &...
3
votes
1answer
59 views

Availability Group backup preference not changing to primary

I have an availability group setup and I'm using Ola Hallengren backup scripts. At setup of the Availability group, the default option of Prefer Secondary was set, where it should have been changed to ...
0
votes
1answer
81 views

How to find how many number of transactions are happening in SQL Server/SQL Server database in a day?

I have to migrate my SQL Server on a particular public cloud, which is charging/licensing on the basis of number of transactions happening on the SQL Server. I am aware of the Performance Counters ...
-1
votes
1answer
25 views

SQL Admission Count using row_number

I'm new in SQL Server learner and I'm stuck in simple problem to count the admission using SQL Server in healthcare data set. Sample table: create table admissions ( HIC char(1), DateFrom date, ...
0
votes
1answer
15 views

SQL 2012 Replication Between Subscribers Across VPN

I have been assigned with setting up replication for an instance(remote instance) at a geo location that we access across a VPN. The remote instance will need to send the transactions to a local ...
3
votes
3answers
187 views

All SQL Server aliases linked to default instance instead of instance I assigned

I have multiple SQL Server instances(different versions) on my computer. I try to create aliases for each instance as First I thought I had everything settled then I found no matter which alias name ...
0
votes
1answer
65 views

Limiting the number of CPUs used in SQL Server 2012 Enterprise [closed]

The platform under consideration is SQL Server 2012 Ent. SP3. We are in the process of migrating a SQL Server environment to VM but highly feel the server was over spec'd to start. We want the ...
1
vote
1answer
35 views

SSMS is crashing and SSMS Toolbar

I'm new in SQL Server and i have installed SQL Server on my system for testing purpose. Issue 1: I want to convert the name of all the toolbar in menu tab to icon. I have no clue from where does it ...
1
vote
1answer
44 views

How to change SQL Server master key password?

I created a master key, then a certificate and encrypted my database. CREATE MASTER KEY ENCRYPTION BY PASSWORD='A Very Strong Password'; GO CREATE CERTIFICATE foo WITH SUBJECT='Database Encryption ...
3
votes
2answers
24 views

dtexec returns immediately without any messages

I'm trying to setup a command-line call to dtexec to validate packages, using the project model. I'm calling dtexec like this: dtexec /val /proj my.ispac /pack my.dtsx /rep v Though the real ...
2
votes
1answer
63 views

sp_blitzCache against one stored procedure

Recently we started using sp_BlitzCache to help us tune our queries. We found one SP that had some issues with it and we were able to refactor it successfully. I have a copy of the output of ...
0
votes
1answer
40 views

Proper resizing of Log File after shrinking - SQL

Recently I've discovered our 2012 SQL Server database contains over 100,000 Virtual Log files by running the DBCC LOGINFO command. After doing a good deal of research I am still uneasy as to what ...
1
vote
2answers
36 views

Index options and applying partitioning to an index

I have following two questions: I have a SQL Server index with the following options: PAD_INDEX = OFF STATISTICS_NORECOMPUTE = OFF SORT_IN_TEMPDB = OFF DROP_EXISTING = OFF ONLINE = OFF ...