Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

2
votes
1answer
35 views

Failover Cluster Diagnostic Logs

I know there must be a simple answer to this question, but I cannot find it anywhere. Our SQL 2012 FCI have SQLDIAG .XEL files in their MSSQL\LOG folder. In some instances, these files are often ...
1
vote
2answers
35 views

Migrating CLR Assemblies

I am migrating a SQL Server 2008R2 database to a new server. (also 2008R2) There are a number of CLR assemblies on the server. Will these automatically migrate with the database or will I have to ...
1
vote
1answer
33 views

Linked Server and MSDTC on cluster

I'm trying to set up a linked server between two instances we have on our network. I've done this many times before without an issue, but this time I repeatedly get the following error: OLE DB ...
2
votes
1answer
57 views

Scripting a maintenance plan

I created a maintenance plan for my SQL Server 2008 R2 using SQL Server Management Studio (SSMS). However, I am unable to export/convert it to a script, in case I need to redo it on another server. ...
1
vote
1answer
41 views

Restoring a database, changing recovery model

I regularly make a backup of my production database, then restore the same onto a test database, so developers can always have recent data for testing. The production database uses full recovery ...
0
votes
2answers
43 views

How to escape '%' inside varchar @params for RAISERROR funcion in SQL Server 2012

How I should escape the % character in params so my RAISERROR retun my message declare @msg varchar(max) = (SELECT ' Message with % ' AS MSG) if @msg is not null begin RAISERROR (@msg ,16,1); ...
0
votes
1answer
96 views

Why straight SQL query run faster than stored procedure?

I am facing-out a very surprising problem in SQL Server. The problem is when the query run in SSMS window it will return result in ~1 sec and when the query run through a stored procedure it will ...
1
vote
1answer
80 views

The operating system returned error 665(The requested operation could not be completed due to a file system limitation)

Have a SQL Server 2014 instance running on Windows 2012 R2 that weekly runs Ola Hallengren's DB integrity scripts and the last two weeks started getting this error: DESCRIPTION: The operating ...
0
votes
1answer
36 views

Apparantly errorneous Exceeds 8K row length message

In attempting to alter an SQL Server table adding DATE and FLOAT columns. I get a message: Warning: The table "CustomerTransactions" has been created, but its maximum row size exceeds the allowed ...
0
votes
1answer
39 views

Logical problem with a database model

Beforehand the table names and columns are in spanish, my native language is spanish. I've got a database to manage the tickets sales of a trip that is made by a bus, the problem is that when i relate ...
1
vote
0answers
29 views

Does the order of columns in a non-clustered ColumnStore index matter? [duplicate]

I'm reading about creating a non-clustered ColumnStore index. I noticed that when I modify an already created non-clustered ColumnStore in SQL Server Management Studio I have an option to change the ...
2
votes
1answer
180 views

SQL Parameter Sniffing Possible Workaround

Our system has roughly 500 "Customers" that have extreme differences in record counts. Here is a (greatly simplfied) sample query that could return 0 - 100000 rows depending on the parameter passed. ...
0
votes
1answer
31 views

Difference between character_maximum_length and character_octet_length

Maybe there is an answer for this somewhere but, I couldn't find any efficient answer on Google for this question, therefore, I will ask this here. I wanted to get some information about my Stored ...
0
votes
0answers
47 views

Showing employee on leave [closed]

How can I show an employee which is absent and leave and absent but not in leave here I can show which employee is on leave when there ApproveStatus is true and I can give date manually from which ...
-3
votes
0answers
61 views

How to fix my corrupted SQL Server database? [closed]

My database in SQL Server is corrupted. Tried to return the backup, but when importing, there is an error that the database is corrupted. What should I do, tell me?
1
vote
1answer
59 views

Why is my filtered index being ignored?

--Setup, actual queries after the space --create table fltrind (a integer,b integer) truncate table fltrind DROP INDEX fltrind.nf DROP INDEX fltrind.f DECLARE @i integer SET @i=0 while @i<100 BEGIN ...
2
votes
0answers
28 views

How to add a missing database to an AlwaysOn Availability Group [duplicate]

Setup: Microsoft SQL Server 2012, and we have 3 production servers(prod1, prod2, prod3) with AlwaysOn. We recently added a new database and the new database was added to our Availability Group(named ...
2
votes
1answer
150 views

Partitioning Query

I have a couple of questions about the phyiscal layout of tables when they are partitioned. I've been researching this but am still a little unsure. Say I have an existing table:- CREATE TABLE ...
1
vote
2answers
29 views

Is there a policy or special server configuration to limit SQL Server query results?

I have been seeing developers using SELECT * FROM table when testing their queries. The issue is that many developers are executing such SELECT statements on huge tables, which slows down SQL Server ...
4
votes
1answer
156 views

Optimize for ad-hoc workload

I know what this option does and how to enable it. My question is what things will happen if I were to enable this. Without giving too much info, our accounting system is a Microsoft Dynamics ...
0
votes
2answers
34 views

SQL Server 2012 - Insufficient memory to continue the execution of the program. (mscorlib)

I have a sql file, which is up to 180 Mb. When I try to open and execute it on Microsoft SQL Server Managment Studio 2012, I am getting this error. . What do do ? I researched on Google. And there ...
0
votes
1answer
30 views

TempDB Query being Blocked

I have been monitoring Blocking issues on our SQL Server database. Very often the below query is running on tempdb and is blocked with LCK_M_S What is this query used for and why does it run ...
1
vote
1answer
42 views

Maintenance plan backup and reload the same database

I want in my maintenance plan every night to copy the production database to a backup, and reload the newly-created backup into a test database. By reading here: Restore database - maintenance plan ...
-1
votes
2answers
42 views

How to merge a column in single row in sql server

I have a following data: Comp_id | Cntm_nb | Seq_nb | Amount | Type 1 | 1 | 1 | 2000 | rent 1 | 1 | 1 | 200 | charge 1 | ...
0
votes
2answers
33 views

SQL Server Express Setup

I'm definitely a Database newbie and I'm trying to get SQL Sever Express set up so I can create and play with a database. I managed to install SQL Server Express 2012 before and It allready had the ...
4
votes
1answer
86 views

Why is SQL Server's online indexing causing blocking?

My understanding is that online indexing acquires locks at the beginning (Preparation) and end (Final) phases. However, we see a lot of DML queries blocked during the Build phase. A sampling of the ...
0
votes
1answer
35 views

Query Rows That Have a Following Row That Meets Criteria

Will try to do my best to explain this, as I don't really know how to word this to search for an answer. I'm a constantly learning but still newish SQL user who thus far has been able to solve most ...
0
votes
1answer
43 views

Delete from table where not in another table using two columns

I am trying to get my head around this delete statement I am trying to accomplish. I understand how to delete from table where column not in ( subquery to table2) I have two tables with multiple ...
0
votes
1answer
13 views

Getting the value from a column during a trigger

After a test completes (on a SQL 2008R2 system), the system updates a row in the TestRun table to include an end time. I am creating a trigger that will take action after that update, and do some ...
2
votes
1answer
28 views

Obtaining the next partition number

For a partitioned table, how do I determine via T-SQL what is the next partition number that will be used? For example, the switch-in today went into partition number 50. I want to build the new ...
0
votes
0answers
22 views

MS DPM 2012 R2 - any concerns with using it for SQL backups?

Our company is looking at moving to MS DPM 2012R2 to backup VM's, SharePoint, SQL etc. enterprise wide and trying to research any down side for using this to backup SQL. The whitepapers I've read ...
0
votes
1answer
21 views

SSMS 2014 installation - “Invalid license data” when opening ASP.NET files

I have just installed SSMS 2014 Express on a brand new Windows Server 2012 (x64) so I connect to the SQL Server 2014 instance running on a different Windows Server 2012. This is working without issue ...
0
votes
1answer
21 views

SSIS unpivot returns different results when run via a SQL agent job

I hope someone can help me. I have an SSIS package which grabs data from an excel (.xls) file, unpivots it from a rubbish format into a 'proper' format, transfers it to a SQL server 2008 R2 db, and ...
1
vote
1answer
65 views

SQL Server Multiple JOINS with Table Value Function - query never ends

I have a query with 4 joins using a table value function to get the data and when I execute it the query never ends. Issue Details Table valued function: CREATE FUNCTION [dbo].[GetIndicator] ( ...
1
vote
0answers
40 views

Querying LDAP multi-value attributes using Openquery

I'm using SQL Server 2012 Express to query an LDAP linked server like this: SELECT * FROM OPENQUERY (MYLINKEDSERVER, 'SELECT * FROM ''LDAP://myserver:389/o=root'' where telephonenumber = ...
-6
votes
0answers
32 views

Absent and Leave [duplicate]

The code you sent me which is show only absent not leave but I have to show those employee leave SELECT DISTINCT subDate.absent_date, SMEmployee.EmployeeID, SMEmployee.BadgeNumber, ...
2
votes
3answers
68 views

Standard Edition High Availability without Shared Storage

I'm a software dev with little experience managing SQL Server so please bear with me. We are developing a piece of software that needs to be highly available, with a significant degree of resilience. ...
4
votes
0answers
50 views

Why is it @@SERVERNAME but not @@DBNAME? [closed]

I'm just curious: To get the server name, I use SELECT @@SERVERNAME but to get the current database name, I use SELECT DB_NAME() Technically, both seem to be scalar functions: @@SERVERNAME is ...
0
votes
1answer
24 views

STDisjoint() = not STIntersects()?

In short, are STDisjoint() and STIntersects() antipodes of each other? According to the documentation, it seems that they are. But there is no explicit note about it. Are there any tricks? Which one ...
-6
votes
0answers
54 views

Query For Leave and Absent [closed]

SELECT DISTINCT subDate.absent_date, SMEmployee.EmployeeID, SMEmployee.BadgeNumber, SMEmployee.EmployeeFullName, SMDepartment.DepartmentName, MIN(CONVERT(time(0),CHECKTIME)) as Intime, ...
1
vote
0answers
20 views

Does cmdexec have additional process isolation beyond cmd.exe?

I have a cmdexec step in a sql agent job that includes a redirection into a file at the end. It works as expected from a CMD shell running in the context of SQL Agent service account and produces a ...
4
votes
3answers
376 views

Why does transaction log continue to grow in Simple recovery mode with nightly backups

Before immediately marking as duplicate, I have read Mike Walsh's Why Does the Transaction Log Keep Growing or Run Out of Space?, but I don't think it gave an answer to my situation. I looked through ...
2
votes
0answers
11 views

Sql Server Backup to URL (Azure) ERROR

I'm trying to take advantage of the new backup to url function in SQL Server. I have created a valid cert and tried a simple backup, but I get the same error every time no matter what I try. I have ...
4
votes
2answers
74 views

Cannot remove SQL Server 2012

I was in the process of installing SQL Server 2012 x64 Express Management Studio and encountered one heck of an issue. I was most of the way through the installation process when my computer locked ...
0
votes
1answer
9 views

SQL Server - linked Oracle server: EXECUTE permission denied on 'xp_prop_oledb_provider'

Inside of our SQL Server, we have created a linked server to an Oracle server. We ave mapped several users to the Oracle server and specified the credentials. On the Linked Server 'Security' ...
2
votes
0answers
42 views

Issue shrinking dev sql server DB's log file

I have a development db that's running on sql 2014 in 2012 compatibility that I'm having an issue with trying to shrink the log file. The mdf is 60+gb and the log is 80+gb but since it's dev like ...
0
votes
1answer
36 views

Change code editor variable highlighting colour

Within the SSMS Code Editor (for SQL Server 2012) I have this code written within the editor, that has a Dark theme applied. When you click on a variable, SSMS highlights all the other occurrences of ...
2
votes
2answers
65 views

Database events that will cause deletion of index

In SQL server if we try to change a data type of a column having index ,then it deletes the indexes associated with that column and changes the data type . I was not aware of it and was faced problem ...
1
vote
0answers
53 views

A query that does a lot of reads, but plan is OK [migrated]

I´m experiencing a strange behaviour in a specific query in the SQL Server 2008 R2. I´ve got a query that does 19 million reads and is very time-consuming and when I try to check its cached plan, the ...
3
votes
2answers
155 views

Alert when Job isn't triggered

I have a Sql Job on my server that is triggered nightly from a remote server (once it has completed its backups). I have successfully configured the job to notify me when it fails, but I would like ...