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
32 views

Does DBCC TRACEON() invalidate cached execution plans?

In Microsoft SQL Server, does DBCC TRACEON() invalidate cached execution plans, same as SP_Configure invalidates all stored procedure plans ?
0
votes
0answers
37 views

Database Hangs while trying to run sql

I have a challenge with SQL Server. We are running SQL with an inhouse developed application. Lately we have been having a challenge where the DB hangs and users are unable to access the application. ...
1
vote
1answer
49 views

What causes 'Recovery completed for database …' log messages?

I am running an MS SQL Server Express (64-bit v11.0.2100.60) database and now and then I get problems that my connections times out when I want to connect. In the server log I can see that at that ...
0
votes
1answer
49 views

Some data is missing in the table of SQL

I have given a description column datatype as NVARCHAR(MAX) but when I add the data it shows me only half data. Not full data. For Example:- If I have two para like below:- As the saying goes ...
1
vote
0answers
29 views

Restore Database w Master Key and storing password in plain text

We have a (SQL Agent)job that backs up our production db nightly(and restores to a test db server) and we're adding encryption to some of the columns in our tables. I created a master key and bound ...
1
vote
2answers
38 views

Understanding deadlock XML

Recently a clients website has been receiving many deadlocks. The website and CMS is custom built on asp.net MVC 3. The database is SQL Server 2008. I believe this started occurring when there was ...
0
votes
1answer
67 views

What is the correct SQL for using where ID in List and the items are with AND operator

I need a SQL Statement to use IN operator within the items with "And" connected. SELECT * from tbl_Users WHERE id in [1,2,3] is equivalent to: SELECT * from tbl_Users WHERE (id=1) or (id = 2) or ...
6
votes
1answer
137 views

SQL server service won’t start after disabling TLS 1.0 and SSL 3.0

Because of security reasons, we disabled TLS 1.0 and older protocols on our windows, and enabled just TLS 1.1 and TLS 1.2 under the following registry path: ...
2
votes
3answers
291 views

How to speed up a multiple select query

EDIT - Putting my whole stored procedure: I have the below stored procedure: CREATE PROCEDURE [dbo].[data_Update] @Owner NVARCHAR(255), @ID VARCHAR(255), @Division VARCHAR(255), @Manager ...
2
votes
1answer
232 views

Why does SUM() return 0 when no rows in table?

I've been saying for years that if you are assigning an aggregate value to a variable that you need to handle if there are no rows returned. ie: DECLARE @MyVar INT SELECT @MyVar = SUM(t.MyValue) ...
0
votes
1answer
19 views

Rank function creating duplicate partitions? (two rank 1's for the same key)

The below query is outputting two rows. Given that I am partitioning on ref_number and also have ref_number in the where clause, I believe I should only ever get a single row back. WITH rank_cte AS ...
1
vote
1answer
28 views

Unable to ping/connect to azure sql server from sql server management studio

I created a database in azure and assigned a new server to it. I entered my ip address in the firewall and tried to connect to the server in Sql Server Management Studio but no success. I tried to ...
1
vote
1answer
27 views

Query to List Encryption Certificate for Databases

What certificate is being used to encrypt each of the databases on the instances. I can get the data using the following but how do I write the queries USE master GO -- this provides the list of ...
1
vote
1answer
74 views

Work queue with complex select and long processing: Ensuring concurrency

I have a queue table from which worker processes claim records, one at a time. It is crucial that no two workers claim same item to process. Normally this kind of thing is done with select top (1) ...
1
vote
2answers
201 views

List Active Directory Users

My boss sent to request me that: I want to a SQL query, that lists all domain users of a specific group. I began to search query. I found several solutions using Linked Server. EXEC ...
2
votes
0answers
34 views

SQL Server 2008 R2 - Should I be worried at this statistics regarding indices causing locks?

We have some mild table locking issue during our peak hours so I figured the following query query taken from this site would be a good start. And boy, does it show me some seriously concerning ...
1
vote
1answer
31 views

Preventing orphaned users in SQL Server 2008 R2

I've recently had a situation where a database was refreshed from production to staging, and the users on the database ended up orphaned. These are sql server users, not mapped to windows ...
0
votes
1answer
59 views

Error while running SSIS Package job in SSMS

Error while running SSIS Package job in SSMS Hi! A SSIS package named "My_Package" has been scheduled as a job in SSMS to be executed daily at 5:00 AM daily. SQL Server Version : Microsoft SQL ...
0
votes
1answer
39 views

How to remove the duplicate records from primary filegroup after partitioning?

Basically, our database is created based on primary filegroup alone. Now, I have done partitioning for a large table which was approx 25 GB. The partitioning was done on secondary filegroups which ...
0
votes
0answers
44 views

Database (Suspect) Data Lost after using Repair allow data loss

I'm currently suffer with data lost for my database.. Hope that you could help me to recover the files.. Thank you the error looks as below:- Msg 8909, Level 16, State 1, Line 2 Table error: ...
0
votes
0answers
21 views

sql agent job: How to set max run time for powershell step

sql server 2014 We hvae a powershell step that does a robocopy operation that sometimes hangs for unknown reasons. Can we set a max run time, either at the robocopy command level, or at the job step ...
2
votes
1answer
114 views

Select a range of values

I have the following data in rows: 1 2 3 6 7 15 16 I want to write a SELECT statement to return contiguous ranges. Given the sample data above, the output would be: 1,2,3 6,7 15,16
1
vote
1answer
62 views

SQL Server differential backup LSN values

I'm looking at restoring databases on SQL Server and I'm not understanding something related to the LSNs. Here is a screenshot from the Restore Database dialog in Management Studio for a sample ...
0
votes
2answers
62 views

Creating joined rows from multiple tables on date field

I need to be able to take Table A and find the records that match in Table B and Table C based on its ID and add them together. The trick is that I only want to add the results from Table B and Table ...
2
votes
1answer
83 views

How to see entire job step output?

We have a powershell job that creates a pretty long output (it has robocopy output, among other things). In the SQL Agent Job History, we only see the first 1k or so of this output. 1) Is there ...
-1
votes
1answer
33 views

System.Data.SqlClient.SqlException when try to run simply queries

I've installed SQL Server 2012 Express. I'm doing some test with this and Server 2008 Express. With 2008, all is ok. But with the 2012, I get some troubles. I'm using it from my c# app, with code ...
0
votes
1answer
51 views

How to lift a nested windowed query from a left outer join?

So... I came across the following view. Aside for table design (some names and variables changed to protect the innocent), joins etc. I would like to simplify the query by lifting the two nested ...
-3
votes
1answer
66 views

Insert value to only one column of the table [closed]

I have a table of which I added the column name now. I want to add the data for that row only, currently it is showing me NULL My table name is tbl_ngoname I already had column like ID, ...
0
votes
1answer
38 views

Mirror / replicate only 1 table of a database

I need a good way to replicate a single table in SQL Server 2012 between different servers and different databases. I tried replica which works just fine, but there might be a much better / easier way ...
1
vote
1answer
49 views

Duplicate non-clustered index on Primary Key, can I drop one of them?

Looking over on of our older databases I noticed that several large tables had duplicate indexes on the Primary Key. Both indexes are Non-clustered, Unique and only includes the PK-column. The ...
0
votes
1answer
20 views

Can we have OLAP cubes with same OBJECT NAME and ID at different database?

I have olap database for both production and test. Fortunately I noticed that cube under both production and test olap database has the same object name and Id. But DataSource for production and test ...
0
votes
0answers
58 views

how to restrict user to run sql server database only on partiular ip only?

How to restrict user to run a SQL server database on in particular IP only? I have one database I just want to give to clients. But I wont Restrict that the database should run only on one ...
0
votes
0answers
50 views

SQL Server 2012 Installation failing on Windows 8.1

I keep on getting the following error message: Came across several articles where they are asking to start from Group Policy Editor , however, since mine is Windows 8.1 and not pro version of ...
1
vote
0answers
19 views

Does XP_API deprecation announcement mean that sp_executesql will not be supported in the future?

I have setup an Extended Events session in SQL 2008 R2 to track the deprecation_final_support and deprecation_announcement events. I noticed some "deprecation_announcement" events in my log with ...
3
votes
1answer
64 views

Transactional Replication to DB on Same Server instance

We have a SQL Server 2012 instance that contains a database with data for many product lines. We are looking for a way to take subsets of this data into another database on the same instance. This ...
0
votes
1answer
28 views

How can a primary key be inserted as foreign key?

Hi I am building an order intake form that will have information submitted belonging to 3 tables. The order table will have the primary key used for the property and customer table. How can I ...
-1
votes
0answers
38 views

Converting Script from Teradata to SQL Server

I am currently working on moving a database, and all of its related scripts, off of Teradata 13 and into SQL Server 2012, and am having an issue with just one of the scripts. In the script, the ...
1
vote
0answers
20 views

How to group SQL Server files for restoring database [duplicate]

I have a SQL Server database that is creating full backups once a week, differential backups once a day, and transaction log backups hourly. These are being FTP'd to another box, where I would like an ...
0
votes
2answers
58 views

Process staging table by getting unique rows only (incremential)

I had simple problem with etl on staging table that was answered here: Process staging table by getting unique rows only Now after apllying solution I spotted that will be unusable in production ...
-4
votes
1answer
40 views

Who is depends on specific column? [closed]

I want to alter column table from varchar X to Y. And for that I need to know who is depend on this column . Any suggestion?
0
votes
0answers
25 views

Where is the SQLS database backup virtual device string stored in the system tables?

In my SQLS Server 2005 log, when backups occur, I see something like: Database backed up. Database: blahblah, creation date(time): 2011/08/11(15:49:19), pages dumped: 1, first LSN: 142:489:1, ...
-2
votes
1answer
39 views

Process staging table by getting unique rows only [closed]

I have several staging tables where I bulk import data with duplicates and sometimes I upload historical data mixed with real-time data, just importing everything without caring if it is already in ...
1
vote
0answers
51 views

Too big database file 90GB [closed]

I just found that one of database growth to size of 90 GB (one file) The biggest table is about 23 GB , mostly containing integer data. Till now I dont have performance problems, but I think that ...
3
votes
1answer
51 views

Full to Simple recovery mode during massive data update?

I`ve got a 50 Gb database, in which a table takes up 43 GB, and it's full of bad data(over 90%), and i plan to clean it. Database is in Full recovery mode. My plan is: 0 - take a backup for safety ...
1
vote
2answers
61 views

How do I prevent my clients viewing my database definition when it is installed on their server?

I want to give my database to the client to install on their server. However, I want to deny the client rights to see the tables and stored procedures and also want to restrict that database to run ...
0
votes
0answers
16 views

Could not find the Database Engine startup handle [duplicate]

I have a SQL server with deafult 2012 instance. I tried to install a new named instance, it started the installed and after long time it failed with error "Could not find the Database Engine startup ...
0
votes
2answers
56 views

SQL Server log file is too big [duplicate]

We are using SQL Server 2008 with full recovery model, the database size is 10 GB and the log file is 172 GB, we want to clear up the space of the log file internally ,we did transaction log file ...
0
votes
1answer
29 views

How to delete the old backup differencial files?

I'm (trying) managing a large number of sql server instances among a number of machinces running SQL Server 2005 and 2008. Almost all the DB are in Simple Recovery Model. I'm doing full backups every ...
4
votes
2answers
132 views

Execute SP whenever any job is finished

I have many SQL Server jobs on the server. I need to execute a SP whenever any job execution is done. One hard way is to create a step on every job which calls that SP. Is there any simple way to do ...
0
votes
0answers
13 views

Why are foreign keys ignored on subscribers?

We have a merge replication set up on Sql Server 2008 R2. There are many tables with foreign keys providing a logical dependence on each other. For this question, let's say there are the "User" and ...