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.

1
vote
0answers
5 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
51 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
36 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
24 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 ...
3
votes
1answer
84 views

Queries running parallel with default maxdop

I need to understand below behavior of sql server queries System has 4 CPUs with hyper thread ratio of 20 making 80 logical processors count on my sql server instance. Currently MAXDOP is 0 and ...
0
votes
1answer
24 views

Sql selection of text file

I am new in SQL and need a small help in solving this. I have a column which has a file path name "C:\Users\akumar\Desktop_Claim Files\AMSO_CLAIMS_YYYYMMDD.txt". And, I need to create a column (...
3
votes
2answers
255 views

Get top 1 row value from third table while joining 3 tables mssql

I am new to mssql .here I need to get some data using joins between three tables . Header join Lines join Images --> Result Header Table : Line Table : For each header record we can have multiple ...
0
votes
1answer
124 views

SQL PRINT vs SQL EXEC

When executing the query below, if I use PRINT it prints correctly. I can copy and paste the printed code and execute it. However, if I use EXEC I get the following error: Is there a way of ...
-1
votes
2answers
33 views

I need help with a SQL Query

I'm not so great with SQL Queries and would like to know if someone would know the correct Query to return the information below. I'm having a difficult time trying to figure this out. I'm using ...
4
votes
0answers
49 views

How do I identify the source of the 17886 errors (“server will drop the connection”) in my SQL errorlog?

I have a SQL 2012 server that is throwing the following error every 5 minutes or so: Error: 17886, Severity: 20, State: 1. The server will drop the connection, because the client driver has ...
0
votes
0answers
29 views

Need Help in extended events SQL Server

I have created an extended event as below. I want to know how to query the historical data using T-SQL to see the issues at particular timestamps. The trace is running as of now CREATE EVENT SESSION [...
6
votes
0answers
113 views

SQL dumping all pages from buffer cache every few minutes

I have a single SQL2012 SP4 node running several databases. The server has 20GB of memory available, 14GB allocated to SQL (nothing else running on the box). Every few minutes SQL dumps the whole ...
1
vote
0answers
14 views

Enabling FileStream in existing clustered servers in SQL Server 2012

I have heard that enabling FileStream in an already existing clustered environment is tough. I'm working on a consolidation project and currently analyzing the impact it will have if we migrated DBs ...
1
vote
0answers
17 views

AlwaysOn Replicas set to manual but failing automatically

My two synchronous-commit SQL AO replicas are set for manual failover mode but are failing over automatically. When I look through the logs and extended events, it looks just like what would happen if ...
1
vote
0answers
85 views

How we can clear tempdb without restart MSSQL service [duplicate]

While checking my tempdb details, its showing that almost 90 GB is consumed. So I tried clearing all caches and perform shrinking, but still it's consuming 90 GB of space. My drive became full where ...
0
votes
2answers
29 views

SQL Server 2017 Express edition Bulk load

I am working on the SQL Server 2017. I need to import 20 text file into one table. Every text file has the same data type and column name. I have checked the data and they have in the same order also. ...
-2
votes
0answers
79 views

How to investigate locks impact on MSSQL performance? [closed]

I have performance issues with 3rd-party application on MSSQL database. By query sys.dm_os_wait_stats (from sqlskills) I have this results: WaitType Wait_S Resource_S Signal_S ...
0
votes
1answer
46 views

Display all fields with null values in a particular row in SQL Server

I have a requirement where I want to fetch and display all the fields with NULL value for a particular row in the table. Some thing like: select 'all columns with NULL' from table_xyz where ...
3
votes
1answer
90 views

How to put SQL Server 2012 in single-user mode

I am trying to restore master DB from a backup and getting below error: To restore the master database, the server must be running in single-user mode. For information on starting in single-user ...
0
votes
0answers
30 views

Restore master DB to default(as just installed) without backup [duplicate]

I know this is not a reasonable request but is it possible to reset master DB to the status it was just installed without backup? I deployed a DB project which I didn't know it will mess with master ...
1
vote
1answer
22 views

Subtracting Days From Current Date

I know this is probably very basic, but I'm trying to create a calculated field that subtracts X number of from Current Date, based off of the value of another field: CASE WHEN DaysPD = 30 THEN 1 ...
1
vote
1answer
25 views

Using a Calculated Field in a Separate Calculated Field

I'm trying to avoid creating a temp table for just one single field, but I need to use a calculated field in a separate calculated field. For example: ,CASE WHEN ln.INT_RATE_CODE = 'A' THEN 1 ...
7
votes
2answers
387 views

SQL Server: Covering indexes including all columns?

Our team has inherited an application and associated database. The previous developers appear to have enforced a rule where every index, on every table, has an INCLUDE clause to always add every ...
0
votes
1answer
45 views

Query To Return Column Name And Date

I have a SQL Table that houses the date that a student was assigned and completes one of three exams. I am in need of a way to query the table and return the column name of the exam the student needs ...
-3
votes
1answer
51 views

Case statement with multiple condition [closed]

Case when a.name and a.rownum=1 <> b.name and (b.namereason isnull or b.namereason in ('') and b.rownum=1 then a.name when when a.name and a.rownum=1 <> b.name and (b.namereason isnotnull ...
7
votes
2answers
102 views

SQL Server creates different plans when OR condition is re-arranged

I was reviewing an under-performing query which looks like this: WHERE manymany.Active = -1 AND manymany.Check1 = -1 AND manymany.WebsiteID = @P1 AND CURRENT_TIMESTAMP BETWEEN ISNULL(manymany....
-2
votes
2answers
42 views

Collecting query performance metrics without impacting production servers [closed]

How can I capture the query or performance metrics over a period of time, say a month, so that later they can be analysed for performance? I'd like to use DMVs or extended events. I am trying to ...
1
vote
1answer
62 views

Understanding the TempDB growth

Need to understand below behavior of tempdb:- Due to some poor running queries which caused Tempdb bloating, we had shrink and tried to adjust the sizes of each tempdb file: Before issue: no of ...
3
votes
0answers
51 views

Seeking Help Optimizing Self-Joins

This query takes ~5x longer than it should due to the WHERE IN() statement at the end. I am a junior DBA in over my head trying to figure out a way to optimize it. Is there a way to check IN() the ...
8
votes
0answers
95 views

Incorrect process utilization from System health extended events?

I have been recently working on understanding the data or metrics being stored in system health extended events event file. We are trying to implement the data collection of performance metrics using ...
0
votes
0answers
22 views

Connect to SQL server from client

Currently, I am using the SQL Server 2012 Express version and it is installed on Windows Server 2012 R2. Now I just want to connect to this database from a Windows 7 client. The Windows 7 computer ...
0
votes
1answer
22 views

Aggregate Number of Days YTD & MTD

Using the prior month as the "end", I need a syntax for calculating/aggregating the number of days YTD and MTD. For example, if today is 3/6, then the YTD calculation should be for 1/1/2019 thru 2/28/...
0
votes
1answer
25 views

File growth and location change for system health extended events

I am continuing the questions over system health extended event from my previous question How are the system health extended events files rolling over? I see system health file location by default ...
1
vote
1answer
44 views

Convert SQL Server results to a text file that PowerShell can access and use

The query below is used to create a text file with a list of server names. The problem I have is that the text file gets created like Server, Server, Server etc. but I need it as follows Server ...
0
votes
2answers
48 views

select query with where clause having variable taking more time to execute

I have a query which selects a couple of rows from a view based on the variables declared. I ran the same query in lower environments and to my surprise, I got the result in less than 3 minutes ...
5
votes
1answer
111 views

How are the system health extended events files rolling over?

I see the default system health session events within SQL Server are 5 MB each with 4 files in total. We are trying to fetch data from the system health in historical events but for some critical ...
0
votes
0answers
36 views

sys.dm_db_index_operational_stats not giving proper statistics in sql server?

While working on Index Analysis in SQL Server 2017, I observed that sys.dm_db_index_operational_stats not showing index is getting utilized(column name range_scan_count, however when i checked same ...
1
vote
3answers
49 views

Why does sqlexpress run on .\sqlexpress while mssqlserver runs on .\

I have two computers. One machine runs sqlexpress and the instance is named SQLEXPRESS The other machine run mssqlserver and the instance is MSSQLSERVER. Why is it that sqlexpress runs on .\...
0
votes
1answer
42 views

Select All Instances of Substring in a String

I have a varchar(max) column that holds a JSON request string. I need a SQL statement for a report that will select all of the instances of that substring. More specifically I need to grab the LoanId ...
0
votes
0answers
47 views

Consolidating SQL Server databases into a New Server vs. Existing Server

Currently I am working on a project that requires me to consolidate 3 servers into 1 server, so I am trying to find the best method at the moment. Right now my options are: Consolidate the 3 servers ...
2
votes
1answer
47 views

Implications of changing SQL Server collation

We are currently using SQL Server 2016 and currently the collation set on our database is SQL_Latin1_General_CP1_CI_AS. Our Analaysis services' collation is set to SQL_Latin1_General_CP1_CS_AS. The ...
1
vote
0answers
26 views

SQL JDBC upgrade from v6.0 to v7.2 causes java.lang.NullPointerException in *some* stored procedure returned recordsets

I am developing a java application onWindows 10 using Eclipse Oxygen and SQL JDBC v7.2 and java 1.8 update 202. My code runs fine when I use SQL JDBC v6.0 (sqljdbc42.jar Jan 2017 and java 8), but ...
-1
votes
0answers
24 views

Adhoc and Prepared query in Sql-server-2012 [migrated]

is there are any possibility to do a prepared statement C# linq to SQL-server-2012 prepared query?
1
vote
1answer
20 views

Insert multiple times XML data (SQL SERVER)

I have some difficulties to solve my problem. I have a stored procedure which take 2 input parameters. The first one is a varchar, but in reality it's going to be a list of SomeID separated by comma ...
0
votes
0answers
47 views

Can we find who killed a SQL Server process? [duplicate]

I am using SQL Server 2012 Enterprise Edition. We are running SSIS package which usually take more than 5 hours to complete execution. Some time we find that the transaction is being killed by someone ...
-1
votes
1answer
57 views

Where clause in an inner join in SQL Server [closed]

I have the below query SELECT b.CreateDate, * FROM ConsolidatedData_DealSheet AS a INNER JOIN Deals AS b ON a.DealNo = b.DealNo Result Set 2007-11-13 15:40:15.627 ...
0
votes
1answer
144 views

CONVERT to datetime fails on Dynamic SQL - “Conversion failed when converting date and/or time from character string” [closed]

I've spent a few hours with this and still can't get it to work. I'm trying to get the path to the most recent file that matches a pattern for a dynamic SQL query where I'm loading a CSV file into a ...
2
votes
0answers
23 views

How to handle normalizing the concept of a grid, and also plan for data versioning?

I have inherited a database that has a normalized structure, except for its data tables which are aggressively denormalized. Our system mostly renders grids into a browser, and the previous developer ...
0
votes
5answers
304 views

Filter by using in for SQL Server

I have the below table Col1 Col2 1 ACA,ABS,PHR 2 PHR 3 MCM 4 ABC Now I want to filter the data from this so if I have a filter parameter as say 'ABS,MCM' I ...
1
vote
1answer
45 views

Setting up a many-to-many relationship based off of two other many-to-many relationships

I have 3 main top level entities: Project (PK: Id) Owner (PK: Id) Product (PK: Id) Here are the rules: A Project can have many Owners. An Owner can have many Projects. A Project can have many ...