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
vote
1answer
876 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
284 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
739 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
660 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
750 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
787 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
544 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
654 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 ...
-4
votes
1answer
173 views

Update date Column values? any please help? [closed]

I Want to copy and data in same Table and Update date Column values? any please help?
-1
votes
1answer
147 views

Retrieve 5th highest salary in table [closed]

How to get the 5th highest salary from the table. Suppose, I have 100 rows and I want to display details of 5th highest salary of the individual then how to write that query in T-SQL using SQL Server ...
2
votes
2answers
168 views

Auto Disable a SQL Server User

I have a SQL Authentication User: JOHNDOE I would like this account to auto-expire or auto-disable after X days or at a certain date/time. Any suggestions or best practices to do this?
6
votes
1answer
491 views

When performing a cross-database transaction, in which transaction log(s) is the information stored?

Given the following snippet: -- error checking omitted for brevity begin tran exec database1..my_stored_procedure exec database2..my_other_stored_procedure if (@@error <> 0) rollback ...
5
votes
4answers
94 views

How do I check if a certain SQL statement is being run?

Using SQL Server Management Studio, how can check or see who is running a certain SQL statement?
1
vote
1answer
504 views

How do I refresh SQL server cross database references after a database is reattached with a different name? (Are there hidden synonyms?)

I have 2 seperate SQL databases on the same SQL instance. Database1 references tables on Database2 in its views and stored procedures. Everything was working fine until we had to create a fresh ...
2
votes
1answer
125 views

WorldWide site - should I save UTC or in fixed time?

Let's say I have a world wide website ( I mean it has uses from all around the world). I have 1 server which is in germany ( at some city). it will never be moved from germany - ever. My question ...
1
vote
1answer
64 views

Inhibit Sql Server Log Shipping Alerts during certain times

There are batch jobs that occur in the middle of the night, which cause log shipping backups to be delayed such that they exceed the alert threshold, and alerts are then emailed. How can I disable ...
2
votes
2answers
1k views

Is there a difference in performance between @date and getdate()?

Usually I use the getdate() function in my where clauses to go back in time. Something like: DOC.DATUM >= DATEADD(DD,-1*SSN_SDO.DANA_ZA_POVRAT,GETDATE()) Will SQL Server 2008R2 perform faster ...
0
votes
1answer
172 views

Tool to view intermediate query results

I am using SQL Server 2008 Express edition and I've worked two days on a problem where seems to be a cross join in running a query. I would want to know the set returned per join operation visually. ...
0
votes
2answers
182 views

Can I recover CDC tables from transaction logs?

Is there anyway to restore CDC tables from transaction logs? My basic understanding is that CDC reads these logs, and entries that are specially marked, are grabbed by CDC. Once this has happened ...
3
votes
3answers
154 views

pros/cons of different ways to store whether a record is one of two options?

I am trying to store whether an address is a Work address or a Home address. There will never be another type of address. I'm wondering what the pros/cons are of the different ways to store this, ...
2
votes
4answers
5k views

How can I query data from a linked server, and pass it parameters to filter by?

I have a really big query that needs to be run on multiple databases, and the results appended to a temp table and returned. The basic syntax looks something like this: INSERT INTO #tmpTable (Id, ...
2
votes
1answer
808 views

Is replication from SQL Server 2008 to PostgreSql possible?

Is it possible ? Sql Server as publisher(master) and PostgreSql as slave(subscriber) ? Any type of replication really.
3
votes
2answers
5k views

Total Memory used by SQL Server (64 bit)

My knowledge on the subject suggests that perf counter SQL Server:Memory Manager: Total Server Memory only gives you buffer pool memory. There is a column called physical_memory_in_use in a DMV named ...
2
votes
1answer
101 views

Backing up SQL Server 2008 database in different recovery model

We currently have a production environment with 10 SQL Server 2008 databases in Full recovery mode (for obvious reasons). We back these databases up fully at a frequent interval, but due to the Full ...
3
votes
1answer
117 views

SQL Server database schema (and likely, some data changes) - how to auto-distribute over many database instances

Our development involves a SQL Server database (also might be Oracle or Postgres later) and we would sometimes make database schema changes or some other interventions in database. What solutions ...
0
votes
1answer
712 views

Is it there anyway to restore updated records in Microsoft SQL Server 2008 R2?

We have an test database configured with our web application. Due to internal web application error the entries were get updated in the database. Is it there any way to recover the updated records? ...
0
votes
1answer
3k views

How to connect a SQL Server 2012 to the internet [closed]

As you know you can create a database with SQL Server using the SQL Server configuration manager and SQL Server Management Studio. You know this - just typing that to tell that I checked the whole ...
7
votes
2answers
7k views

Maximum memory setting in SQL Server

I'm running SQL Server 2008 and a web based application, on a single dedicated server, with only 2Gb of memory available. As is noted elsewhere, SQL Server regularly takes up to 98% of physical ...
2
votes
2answers
621 views

Modifying replication distributor & publisher

I have a SQL Server 2008 transactional replication setup as follows: 192.168.100.1 <-- Distributor 192.168.100.2 <-- Publisher 192.168.100.3 <-- Subscriber Our network team want to change ...
6
votes
1answer
3k views

Why disabling a clustered index makes the table inaccessible?

When an index is disabled, the definition remains in the system catalog but is no longer used. SQL Server does not maintain the index (as data in the table changes), and the index cannot be used to ...
0
votes
1answer
280 views

DR - Moving databases from Active/Active cluster to Standalone server with LUN sync

We have an active/active cluster on LUNs (with one named instance on each node and a total of an 100 DBs) For DR purpose, LUNs will be replicated (with same drive letters) and attached to a ...
1
vote
3answers
205 views

What is the optimal response time for file growth

We normally set our file growth in percent (10%,20%) or fixed size (10 MB, 20 MB etc). If the disk response time is too high for the requested size to grow, then users will be affected and have to ...
1
vote
1answer
109 views

Can I use Try_Cast to give me a query result column with different datatypes?

I have a column that is varchar(max). It contains mostly valid XML. But sometimes it has invalid xml (that I still need). I am trying to make a view for this table that allows the value to display ...
4
votes
1answer
145 views

Selective Xml Indexing

I have recently been researching Selective Xml Indexing and have been trying to figure out how to index a .query method If I have the below query WITH XMLNAMESPACES (Default ...
2
votes
2answers
1k views

What's the meaning of the Collation Code (blank, 90, 100, 110) in SQL Server 2012

During the installation of SQL Server 2012, in the Collation tab, i can choose between French_CI_AS and French_100_CI_AS. What do they mean and which one is newer? When there's no Code, is it newer ...