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)

3
votes
2answers
79 views

What perfmon counters should I use to get the fastest restore possible on an idle system?

I have a development VM running Windows 2012-R2 and Sql Server 2014. I have one disk from a SAN holding the OS and SQL. My backup file is stored locally on the disk. I want to restore database as ...
0
votes
3answers
47 views

Should I enable db_writer in public facing website

I've come across an issue when using Entity Framework and trying to delete an object. The SQL-Server DB that it's trying to delete from, and the Login it is using, has a role membership of public ...
0
votes
2answers
47 views

How to split a row in a result into mutliple rows

I have the following query: SELECT vs.MonthName AS Month, vs.Region, vs.Category, CAST (MIN (a.TotalAmount) AS money) AS ActualAmount, MIN (a.TotalCases) AS ...
0
votes
2answers
72 views

Connecting SQL Server 2008 R2 to SQL Server 2000

Initially, my desktop has been installed with SQL Server 2000 Standard Edition SQL Client. Recently, I installed SQL Server 2008 R2 client and server instance. I'm using SQL Server 2008 Management ...
1
vote
1answer
115 views

SQL Server stored procedure causing 100% CPU usage

I'm using SQL Server 2008 R2 We have a single stored procedure that causes 100% CPU usage when ran. The said SP is ran once a month and performs heavy calculation for approximately 5 minutes. Since ...
0
votes
1answer
52 views

SQL Server 2014 and SQL Server 2014 Management Studio

I successfully installed SQL Server 2014, but when I look for SQL Server Management Studio it was not on the CD. I have just downloaded SQL Server 2014 Management Studio separately and would like to ...
1
vote
1answer
27 views

Filtering data in a publication

I'm looking to replicate a table that has a particular column for deciding if a row should be replicated. If the column is set to 'Y', then replicate. From my searching, Static Row filters are my ...
5
votes
2answers
136 views

Shrink or no Shrink dilemma

I have databases that I am tasked to move two databases DBName1 and DBName2 to SSD and I only have limited space on the SSD to fit these databases.I do not want to shrink log or data files for the ...
2
votes
3answers
354 views

Automatically restore SQL Server database from file from another server

We have a daily task to overwrite a number of development databases using backups of the associated production databases. The backups are produced by maintenance plans on the production server then ...
0
votes
1answer
58 views

Is there a reason my CTE with a basic subquery in the second stage of the CTE is failing?

Ok... anyone aid with this sorry...i've been playing with some of my works reports and i thought id found a way to mix two results into one when i came across a small issue... if i run my CTE code ...
2
votes
1answer
79 views

Indexing nvarchar(128) in SQL Server

Have no idea how indexing works in SQL Server. Working with a SQL Server 2012 Intel Xeon 2.2 GHz dual core 8 GB RAM. Will indexing a nvarchar(128) in addition to int primary key cause any ...
1
vote
0answers
15 views

Does an “update-update” conflict get created from the same node in P2P replication?

I have been told that an update-update conflict is being created in a production environment, which is set up using p2p replication, because of concurrent update by stored procedures. The msdn ...
2
votes
1answer
48 views

T-SQL query to find backup folder for specific maintenance plan

I want to check check if backup plans are set up correctly and need to query different servers, mostly SQL Server 2008, but also 2012. Is there any way to query the maintenance plans for databases, ...
1
vote
1answer
67 views

Modifying a non managed table partition

I ran across a partition that was initially setup (sql 2012) beginning of 2014 to break by month but wasn't updated for 2015. The main issue is that the last partition was setup as Jan 2015 so Feb ...
3
votes
1answer
60 views

Changing db ownership using a user which can only see the sa

At first, I would like to thank the community for creating such a resourceful forum. I've been using StackOverflow for years, and recently, using dba on SE too and you're great. Most of my questions ...
1
vote
1answer
14 views

Distribution clean up job in transactional replication. Records removed but files didnt

Distribution clean up job runs without errors according to schedule, but I noticed that snapshot files do not remove even if they are created beyond max_disretention period. Records from ...
2
votes
2answers
141 views

SQL Server Timeout Expired in ASP.NET C# WebForms application

I have the following issue on my database which is used by a c# ASP.NET application: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not ...
2
votes
3answers
99 views

Recover deleted table from the database

Currently I deleted one table from the database. But now I want some of the information from that table. Please suggest how to restore or get back the table. I am using SQL Server 2008 R2.
0
votes
4answers
29 views

ISNULL() OR Is NULL in UPDATE statement

I have to run UPDATE statement on live online database about 5 lac records so i want to know which statement are run faster Update Table set REC_ID = isnull(REC_ID,'') Update Table set REC_ID = '' ...
2
votes
1answer
31 views

Linked server issues and administration

We have around 15 linked servers in each of 2 servers and application is querying the views and stored procedures using these linked servers. I would like to know Is there a way to find from ...
-5
votes
1answer
35 views

SQL Server DBA database space [duplicate]

Some X application is using 650 GB of hard disk and after delete the XXX company now current data size is 85 GB so we need to release 500 GB back to disc. How to do it?
1
vote
2answers
53 views

DB backups for production to DR without creating jobs in prod

I had two servers(SQL 2005) A and B. B is Production server and A is DR. I want to take backups for B server databases from A server. We can not create any maintenance plans or jobs in B production ...
0
votes
1answer
22 views

How to use a group by in inner join

I have Two tables Table 1 ID totalamount 100 1000 101 500 Table 2 ID Individualamount 100 500 100 300 100 100 101 ...
0
votes
1answer
44 views

Error message when importing data into SQL (Import & Export Data Wizard)

I am trying to use the Import & Export Data Wizard to import the contents of a CSV file into a table in MSSQL. I have no issues if I import all columns as strings however, I need one column to be ...
0
votes
0answers
33 views

Will SSDT publish always fail with “Data Loss May Occur” when table is rebuilt?

Consider the following scenario: We have a SSDT database project. We add a new column to the middle of a table. This forces the database project to rebuild the table in order to deploy the change. ...
0
votes
0answers
8 views

DBM_INIT distributed transaction rollback in profiler

SQL Server 2008 R2. WebSphere 7.x Windows 2008 server. Our application is JEE in WebSphere 7.x, and so uses Microsoft JDBC I believe 4.0 to connect to the db server. During one of our batch jobs, ...
1
vote
0answers
16 views

Replicating Multiple SQL Servers to Azure and Accessing From Web Apps

I am setting up quite a large system with multiple servers (MS SQL Server), and Office 365 Access DB, and a custom SharePoint web app for reporting purposes. The system should work as follows: Each ...
0
votes
0answers
16 views

Issues with using a database snapshot to report off of production [duplicate]

Has anyone used a database snapshot to allow reports to be run off of a production environment? I'm currently evaluating whether this is a good idea, however, it seems like since the database snapshot ...
3
votes
1answer
78 views

Is a clustered index on a child table in a parent/child relationship the most optimal index?

A clustered index will sort row data in a table according to the ordering of the fields in the index. If so, why would you (or would you not) want to create a clustered index on the child table in a ...
0
votes
1answer
25 views

Insert where not already available for FK?

I'm looking for a simpler way to do this as I'm clearly thinking like a developer instead of a DBA. How would a DBA tackle this? I have a table with 3 column: PK, Name, FK. PK Name FK 1 ...
0
votes
0answers
14 views

tempdb Log Continuing to Fill, but No Long Running Transactions In Flight [duplicate]

I'm suspecting a report is generating a large data set with sorting in tempdb, causing the tempdb tlog to fill. I'm trying to identify the session that's generating the log growth but DBCC OPENTRAN is ...
1
vote
2answers
84 views

Improve performance of converting a large xml file (~300 MB) to relational table in SQL Server

So this is what I have so far: --Read xml content into a XML data type variable DECLARE @FileData XML SELECT @FileData = CONVERT(XML, BulkColumn) FROM OPENROWSET(BULK '\\file_path\test.xml', ...
6
votes
4answers
1k views

Are deadlocks a serious problem? [closed]

I have a few production SQL Server instances and I get around 100 deadlock alert emails a day (up to 100 for one server, 150 in total). Is this a problem I should investigate? How many deadlocks are ...
0
votes
3answers
92 views

Should login id and password be stored in separate table

I am working on my academic project. I have a table for employee records which have employee id, joining date, designation and other fields. I am trying to implement a scheme in which when record of ...
-1
votes
1answer
68 views

use variable as column name in where clause in sql

I want to use a variable as column name in my SQL query. Problem: I can not use dynamic SQL as the SQL query that I have is inside of a user defined inline table function. What are other possible ...
2
votes
2answers
58 views

Slow queries on production Server

I am a developer who has been asked to look at a database slowness issue. I have had a look at the waits on the server and retrieved the following using a query from Red Gate's wait stats white paper. ...
-1
votes
0answers
30 views

SUM values within a grouped table

[MSSQL] Having a table like: --------------------------------- | A | B | C | D | --------------------------------- | 1 | ABC | 1.3 | 2.5 | | 1 | ABC | 2.7 | 2.5 | ...
1
vote
0answers
36 views

Why does shrinking the transaction log generate lots of log (LOP_SHRINK_NOOP) and not shrink the log?

I just tried shrinking an overly big log file (FULL recovery model). This operation is not expected to always succeed and indeed the log was not shrunk. But I observed that a lot of new log was ...
0
votes
1answer
18 views

How to set up an SQL Server authentication login for a database instead of using Windows Authentication

Not sure what I am doing wrong so I have included the parameters I used which I used the existing login and this article for reference: ...
2
votes
1answer
48 views

How to grant permissions on a table-valued function

Am I doing it right...? I have a function that returns money... CREATE FUNCTION functionName( @a_principal money, @a_from_date datetime, @a_to_date datetime, @a_rate float ) RETURNS money AS ...
0
votes
0answers
24 views

High Availability Error “An error occurred while receiving data: '10054(An existing connection was forcibly closed by the remote host.)'.”

I have trouble in configuring High Availability, I searched a lot but I was unsuccessful in fixing it. I got this error : "An error occurred while receiving data: '10054(An existing connection ...
0
votes
0answers
28 views

Sleeping queries blocking rebuild index and update statistics job in Always on

At one of your client sides we have configured Always on with synchronous mode.Also we have schedule rebuild index and update statistics job which runs in night every alternate day. the issue is ...
2
votes
1answer
69 views

SET CONTEXT_INFO for tracking specific SQL requests

I've got a problem where I'm seeing some very strange lock waits, with the process at the top of the lock wait tree in the 'sleeping' 'AWAITING COMMAND' state. I can see the machine name and ...
0
votes
0answers
24 views

Can I implement Intellisense into my stored procedure with custom constants?

I created a stored proc to do some cleanup on some orphaned temp tables by issuing a DROP. However, I want to vary the time threshold so I have a stored procedure that accepts a time unit (e.g. hours, ...
2
votes
0answers
35 views

Why would a default constraint be missing an index?

I have a query that looks at the sys.dm_db_missing_index_group_stats system view to determine what missing indexes there are for maintenance purposes. If I remove the filter from the query that ...
2
votes
1answer
33 views

SQL Maintenance Rebuild Fails

I am pretty new to SQL and I have this maintenance job that keeps failing and I am not sure how to troubleshoot this. I have troubleshot other job failures with google help to success but this one is ...
2
votes
0answers
41 views

Filtered Index is not selected once an identical, non-filtered, index is made [duplicate]

I have a lot of historical data, but 98% of the time, my data entry team only looks up data from the last 5 days. So I added a filtered index to help those lookups be faster. My test query looks ...
2
votes
1answer
48 views

SQL Server stored procedures fast in SQL but slow when called by ASP.NET

I am using ASP.NET with MVC3 with a SQL server database. From time to time, one of our stored procedures become incredibly slow when called by the web platform, but stay as fast when called directly ...
0
votes
0answers
15 views

Use trigger to update SCD2 End date and IsCurrentRow flag

I'm implementing a data warehouse that has type 2 slowly changing dimensions. When a change is made to a SCD type 2 column, I need to insert a new row into the dimension for that entity and also ...
0
votes
0answers
20 views

SQL Server Merge Replication Two Publishers

Here's the issue. Our current replication setup uses merge replication and the publisher is running SQL Server 2005. We need to add another server as a subscriber but it is running Windows Server ...