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)

-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
817 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
333 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
256 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
535 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
213 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
583 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
159 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
141 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
870 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 ...
1
vote
1answer
283 views

Merge Statement + Replication difference for SQL Server 2012

We have a SSIS package that will pull from a source database and run a merge statement to put the data into a "Master" database. (Eventually the "Master" database will be the source of truth, but we ...
9
votes
2answers
735 views

If I fail over one database, do the others that share the same mirror endpoint fail over as well?

We have two databases setup for mirroring on a single SQL Server instance: a test database and a production database. Both get mirrored to another server using the exact same endpoints. If I go into ...
4
votes
1answer
654 views

What is the safest way to run SSIS on Multiple Named SQL Server Instances?

I have an Active/Active SQL Server 2008 R2 cluster. There are two named instances on each node and no default instance. I need to deploy SSIS packages to the different instances. To do this, I ...
0
votes
1answer
4k views

SSIS convert DT_WSTR to date

I'm new to SSIS trying to covert data types. I'm pulling data from Google Analytics and loading data into a SQL 2008 database. The date column from Google analytics appears as "DT_WSTR" and the values ...
4
votes
0answers
1k views

SQL Server Browser uses NT AUTHORITY\SYSTEM account and logon failure error in SQL Log [closed]

Using SQL Server 2012 on Windows 2008 R2 I have been getting errors in SQL Logs for failed login for NT AUTHORITY\SYSTEM. All of SQL Server's services are running under their own Domain accounts, ...
1
vote
3answers
744 views

Restore database with zero size log file [duplicate]

SQL Server backups contain meta-data about the size of the original log (LDF) file. So if you backup a database that has a 5GB LDF file, when you restore it, you will get an (empty) 5GB LDF file. ...
5
votes
2answers
784 views

How can I reliably track stored procedure ( and functions ) use over time?

I have a lot of stored procedures and functions in database, many are not used any more and I want to remove them. How can I find them reliably ? I have seen answer that suggests looking into plan ...
1
vote
0answers
2k views

DELETE failed because the following SET options have incorrect settings: 'ANSI_NULLS'

I have inherited a few scripts that are pumped through a c#.NET custom app to update a SQL2005 SP3 database. One of these scripts does a deletion on a user table called msw_timer_task, based on a ...
1
vote
1answer
229 views

Startup procedure for availability replica becoming primary

Is there any way how to create a startup T-SQL script/procedure for starting availability replica (when state has changed from secondary to primary)? I want to disable SSIS jobs specific for related ...
1
vote
1answer
121 views

mdw_purge_data_ long runtime

I have a SQL Server 2008 R2 that is running several databases and has also been configured as our central MDW. When the management data warehouse is created it creates a number of agent jobs one of ...
16
votes
1answer
6k views

Connection pools being reset with Error: 18056, Severity: 20, State: 46. & Perfmon Counters not showing

We are using SQL authentication & .net 4.0 Connection strings to connect to an Enterprise Edition 2012 SP1 SQL Server on a windows 2008r2 Enterprise Server. We use about 50 Servers split into 8 ...
0
votes
1answer
528 views

IIS Application pool running under network service can't connect to SQL Server

I just deployed an ASP.NET MVC 4 application to IIS 7 but when I browse it i get the following error: Cannot open database "PCSPI" requested by the login. The login failed. Login failed for user 'NT ...
6
votes
3answers
644 views

Are SQL Server statistics stored in database or buffer pool?

Just wondering are statistics kept in the database but not in the memory? If I backup/restore the database from a prod server to a development server, would it keep the same statistics so that ...
4
votes
2answers
400 views

General tool to load dump files

I am a big fan of Postgres both for its price but also for its features. I am going to have to need to upload into it both Oracle dump and SQL Server files. I will try to ask and beg for plain .csv ...
6
votes
4answers
5k views

Restore exceeds licensed limit of 10240 MB per database. All I really need is the DB structure

I received a .bak file from a customer that I need to Restore, but the Restore exceeds licensed limit of SQL Server 2008 R2 10240 MB per database. All I really need is the DB structure. Is there a ...
-2
votes
2answers
2k views

Export complete database to a remote server including (Tables, Stored Procedures, Triggers)

How do we "export" a complete Microsoft SQL server database from one server to a "remote" server (including all the "stored procedures" and "triggers"). The export facility provided in the management ...
4
votes
1answer
109 views

How can I minimize SQL Server data loss in AWS in the event of failure?

If I am running a SQL Server in AWS. What is a low cost solution to minimize my risk of data loss in the event of failure at the database level? Lets assume I am performing backups every 6 hours so ...
0
votes
1answer
49 views

Should I favor using a param or a scalar function result within a SELECT?

I have a select statement in SQL Server that must compare a large set of rows against a single calculated date. The calculation itself is negligible; just looking for the prior Monday. Given that the ...
3
votes
3answers
4k views

How can I search the full text of a stored procedure for a value?

I use the following script to search the text of all stored procedures when I want to find specific values. SELECT ROUTINE_NAME, ROUTINE_TYPE FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION ...
1
vote
2answers
106 views

Saving a SQL Server database to a file and opening it on another server under any database name

I am trying to find an efficient way of being able to physically save and open a SQL Server database like how it's done with Access. I would like to be able to save my entire database into a file ...
2
votes
0answers
101 views

Combining full-text-search queries

I have two tables in a SQL Server database with basic fulltext indexes: CREATE FULLTEXT CATALOG table1_catalog; CREATE FULLTEXT INDEX ON table1 ( name1 ) KEY INDEX pk_table1 ON ...
7
votes
1answer
5k views

Automatic decimal rounding issue

The question is relatively simple. I need to calculate 3 columns where the mid results are huge decimals, and I'm running into a problem early on with SQL Server basically rounding the decimals ...