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
2answers
2k views

SQL Server clustered index high fragmentation

I've got a Table with an Integer (4bytes) as primary key. it's defined as an identity. it is also the clustered index. Inserts are working perfectly fine. After inserting 2000 rows the fragmentation ...
2
votes
2answers
755 views

How to rollback the identity seed after deadlock

Now that's an approximate sequence of operations Im performing: SET IDENTITY_INSERT <table-name> ON; INSERT SOMETHING to <table-name> with explicitly specifyed id DECLARE @oldID bigint ...
5
votes
1answer
475 views

Recommendations on how to organize Queues in Service Broker

I have a service broker application that currently has 5 or 6 queues on two servers. The general workflow is: Server A User populates some tables User fires stored proc which puts a message into ...
2
votes
1answer
1k views

Cannot connect to SQL Server after setting sa password to blank

I have installed SQL Server 2008 R2 on a Windows 2008 server. I need to set the sa password to blank for some reasons to make an application works; but it seems like the password changes automatically ...
4
votes
3answers
1k views

Auditing specific database events

For auditing purposes, we have a requirement in which we have to enable Auditing for theses events: DBA Logins Changes made by DBAs LIKE INSERT, DELETE, UPDATE, ALTER (etc.) Changes made by our ...
2
votes
1answer
13k views

CREATE DATABASE permission denied in database 'master'

I've developed a desktop application using WPF and Entity Framework code-first. In my application the user can create multiple databases at run-time. But Entity Framework can't create database if ...
-1
votes
2answers
84 views

SQL Server installation prerequisite fails

When I install SQL Server 2008 R2, I get this message: Previous release of Microsoft Visual Studio 2008 -- Failed (screen shot) I can't proceed to the next step. How can I fix this?
2
votes
1answer
157 views

excessive CPU utilization by SQL server

I have an issue with SQL server 2000. Its CPU utilization is high from 9.00 AM to 5.00 PM. Three applications use this server through three different instances but when the CPU utilization is high one ...
1
vote
3answers
272 views

Improve performance by partitioning

I'm using SQL Server 2012. I’m using CTE to create an orders table from the items table. The final count for the orders table is around 120 million. It is taking about 2 hours for the whole process. ...
1
vote
2answers
871 views

Missing or lost transaction and no errors to show what went wrong

I have 2 missing records in SQL Server and I am trying to identify the problem that caused this issue. New records are inserted using a stored procedure, which will return an error code to the ...
-2
votes
3answers
168 views

Left Join not giving desired result

I have two Datasets FEES PAYMENTS CrsCode InstNo FEE Regno CRSCODE Instno Payment CA1 -2 100 R1 CA1 -2 100 CA1 -1 200 ...
-1
votes
2answers
3k views

How to do division from select statements in sql server?

I am trying to create a select statement that can return a table of 1 column. Basically, I am looping through all the records of NewHire, and then using its id, to select stuff from another table. I ...
2
votes
1answer
770 views

Reorganize full text catalog is offline or online?

I need to schedule a Full Text Search Maintenance and I was reading this link: http://msdn.microsoft.com/en-us/library/ms176095.aspx. Reading this documentation I am supposing that I need to ...
3
votes
3answers
1k views

Fixed length text file insert into SQL table

I am not a DBA on this one and I will not have access to BCP or anything like that. So I'm wondering if there is still a way to do it in SQL keeping it very basic. I have 100's of text files that ...
2
votes
1answer
161 views

Check programmatically if SQL Server needs restarting

I have to check programmatically if the SQL Server service needs restarting after series of changes in configuration. Is there any indicator (e.g. in the system registry) that allows to obtain this ...
1
vote
0answers
70 views

Coerce columnstore to operate in batch mode [closed]

I want to try the column store index in SQL Server and im trying to get my queries to run in batch mode, i rewrote my query this way( it had an outer join before) but the execution plan still show ...
0
votes
0answers
52 views

Transfer tables from multiple servers into one single server [duplicate]

I have to migrate similar tables present in multiple different servers (30+) into our new server using SSIS package. What would be the right approach towards this? I was successfully able to transfer ...
-1
votes
1answer
191 views

Validate each parent intermediary is also a parent to itself

I want to validate where each parent intermediary is also a parent to itself. So this query should return invalid parents in SELECT if table has any. I need to do is first of all get all parents ...
4
votes
1answer
283 views

Where and how to store my weird datamart

I could really use some help here. Here's my situation. I'm building a datamart in SQL Server 2005, which will furnish a single report (for now). We have 26 clients (medical organizations) that ...
2
votes
1answer
697 views

If the users need INSERT/UPDATE/DELETE permissions, is Windows auth still more secure than SQL Server auth?

Some background first: The problem described below wouldn't exist at all if the database in question would have been built with a DBA's mindset: Data access only through views and stored procs --> ...
3
votes
3answers
4k views

How to check if I am hitting the Express Edition size limit?

I am confused. AFAIK SQL Server 2005 Express has a limit of 4GB database data size. However I have the following results from sp_spaceused: How can I check if my DB is hitting the size limit? Is ...
4
votes
1answer
709 views

When SQL Server uses Multi Page Allocations

What are the consumers of MPA (multi page allocations) in SQL Server? I know data pages are always 8K. Is there a situation where data/index page make use of MPA? It makes sense that execution plans ...
-1
votes
1answer
199 views

How to merge data from 2 databases [duplicate]

I have a SQL-Server database that crashed while I was away on vacation. All info from 5/2/13 is missing from our current database because my replacement implemented a back-up of the database from ...
7
votes
3answers
1k views

SQL Server 2012 Simple Recovery Model with LOG_BACKUP log_reuse_wait_desc

While I'm doing my own investigation, does anyone know why a database in SIMPLE recovery model has a LOG_BACKUP for the log_reuse_wait_desc? SQL Server 2012 SP1. No replication, no mirroring, no log ...
3
votes
2answers
822 views

Execute a T-SQL job with a different connection string

Is it possible to execute a stored procedure from a SQL agent job while specifying a custom Application Name, similar to specifying the Application Name in a connection string? The reason I want to ...
0
votes
2answers
165 views

Change SQL Server settings without restarting services

I can change SQL Server settings using Management Studio or programmatically as described e.g. here. I would like to make this changes WITHOUT the need to restart SQL Server services. Is there any ...
3
votes
1answer
77 views

Scheduled stored procedure on all databases in my server

On SQL Server 2012 (not express edition) I'd like to schedule the execution of a stored procedure every hour. On the same server I have lot of databases with the same structure, and I'm constantly ...
3
votes
1answer
226 views

Create File Stream Enabled Database in Network File (NAS Server)

I want to create a filestream enabled SqlServer database using NAS server as the storage. I already passed the creation of DB step. Look at my previous question Creating SQL Server database with data ...
4
votes
1answer
104 views

How can I enforce data integrity in this model with a M:2 relationship?

This model describes a part of my database (somewhat simplified): A "Tumor model" describes an experiment a researcher does on animals. The "Animal line" is a breed of lab animals, e.g. a Black 6 ...
0
votes
1answer
136 views

distribution.dbo.MSdistribution_history comments explanation

The comment column of distributor.dbo.MSdistribution_history contains comments such as <stats state="2" fetch="11554" wait="214007" cmds="17898546" callstogetreplcmds="106880"> ...
4
votes
1answer
107 views

One database or multiple referencing one?

Database design: one database or multiple databases, which is best? We have a database which has about a 100 or so tables, accessed by about five different applications. Five different applications ...
1
vote
4answers
338 views

Document database structure for auditors

I am DBA for a Microsoft SQL Server 2008r2. Due to an audition, I need to provide data structure of my database, to people without an explicit IT background. I guess they would like the traditional ...
6
votes
1answer
257 views

BM25 (full-text search) implementation in SQL Server

I've hit a stump, while trying to implement the BM25 algorithm in SQL Server 2008 R2. I know that SQL Server includes the Full-Text Search option, which already implements a variant of BM25, but I ...
0
votes
2answers
3k views

Remove collation from all database columns

I have a SQL Server database where the collation is set on it. However I am running into problems as the collation on some columns in the database varies from the database collation. I would like to ...
6
votes
1answer
536 views

How to shred .docx XML?

I am trying to import a xml (actually a docx file) to a sql server 2008 database. I am almost a novice in XML programming. I googled a lot but almost all the examples there are with simple xml file. ...
3
votes
2answers
3k views

Disk space full but logical space available in database

We have a fairly big MS SQL 2008R2 database that resides on a SSD drive. The drive itself only has ~110Gb of space, and the database files are the only files on the drive. The database is in "Simple" ...
0
votes
2answers
508 views

how to find similar word with more similarities

how to Find words with length less than or equal... declare @inp nvarchar(max),@data nvarchar(max) set @inp='You can dance, you can jive, having .... jove... jve, ...' set @data = 'jeve' ...
0
votes
1answer
267 views

File locations for Full Text Catalogs using SQL Server 2005 on VMware

I have an issue with one of our development SQL Server Servers. We have databases that use full text search catalogs. Just some background info, our servers are configured to use separate drives for ...
0
votes
3answers
3k views

How to find all positions of a string within another string

How can I find all the positions with patindex in a table or variable? declare @name nvarchar(max) set @name ='ali reza dar yek shabe barani ba yek ' + 'dokhtare khoshkel be disco raft va ali ...
0
votes
3answers
362 views

AlwaysOn Architecture - SQL Server 2012 for creating a dev environment?

I was thinking if the AlwaysOn architecture in SQL Server 2012 can be leveraged somehow to create a replica for DEV and QA environment properly in addition to setting up HADR using the same ...
7
votes
3answers
6k views

Installation of SQL Server RAID 10 vs RAID 5

I am new to setting up SQL Servers and Vms. My predecessor used Raid 5 for C Drive where the SQL installation resided and RAID 10 for both database files and database logs. I was wondering whether ...
0
votes
0answers
150 views

SSRS 2008 R2 setup issue

I have installed SSRS 2008 R2 on my desktop and server. When I hit the reports link on my desktop http://mypc/Reports_mypc/Pages/Folder.aspx all I get to see is this I cant create a new folder ...
1
vote
3answers
215 views

SQL Server Import Job Removed Data After Job Failed

I have a SQL Server Job set up to import data from a table to a table on another server, using the Import/Export data wizard. In one instance, the job failed (with, I believe a SQL connection issue), ...
0
votes
0answers
586 views

SSMS 2012 error message: evaluation period expired despite Edition Upgrade

Problem similar to this one only with SQL Server 2012. None of the suggested registry edits have worked. This problem was supposed to have been fixed back in 2008 SP1. Here's the sequence of ...
1
vote
2answers
157 views

Use a condition to limit the databases a policy checks

I'd like to create a Policy that checks, on demand, one database in an instance for tables that have no index. I can see how to create a Condition, linked to the 'Database' Facet and checks for my ...
1
vote
1answer
1k views

SQL Server-MySQL master-master replication

We are looking into setting up a master-master replicated MSSQL database and I am interested to hear of any potential pitfalls that we may run into along the way and generally any advice that you ...
1
vote
0answers
160 views

Concurrent Access causing deadlock on the same table [closed]

Transaction 1 : SELECT distinct column_id from grid where row_id = @P0 Transaction 2 : INSERT INTO grid (grid_id, row_id, column_id) In this table grid grid_id is primary key clustered. ...
-1
votes
2answers
168 views

Validate every client has a valid gender

I have table CLIENT which have columns are COLUMN_NAME DATA_TYPE DESCRIPTION SOURCE TABLE ClientPK int Identity column ClientID int Client ID PARTY ...
2
votes
2answers
142 views

sysjobhistory “sql_severity” codes

Where can I find out what the different "sql_severity" codes mean in the sysjobhistory table? Eg what does 0 mean? I've inherited a report that excludes ones with a 0 as "0 is not a real error"? I ...
1
vote
1answer
875 views

Full-text search migration 2005 -> 2012 (.ndf file?)

So I'm trying to figure out the details for migrating from SQL Server 2005 to SQL Server 2012. I tried to do restore and backup of a DB from 2005 to 2012. This worked well and for the text search ...