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)

0
votes
1answer
68 views

“Replicate” sql structure between testing and staging on same database instance

On my local development server I have a database set up which gets hooked into Entity-Framework and is then used for unit testing. Let's call it COMPANY\Database On the same server (and same database ...
2
votes
3answers
985 views

Working Linked Server Query fails in sp_send_dbmail

Take the following example: EXEC msdb.dbo.sp_send_dbmail @recipients = 'me@whatever.co.uk' , @query = 'SELECT TOP 10 * FROM LINKEDSERVERA.DATABASE.dbo.TABLE' , @attach_query_result_as_file = N'True' ...
3
votes
1answer
192 views

Is there an effective way to create extended event data that includes stacktraces in SQL Server on a local db instance?

I read Paul Randal's article on getting the symbols for SQL Server. I have a theory that I could get the extended events to read the symbols from the symbol server catch directory by setting the ...
2
votes
1answer
927 views

The job failed. The owner (pc\user) of job FULL DB BACKUP does not have server access

SQL Server 2008R2 is failing to execute log backup hourly. Date 5/2/2013 10:22:19 PM Log Job History (LOG BACKUP) Step ID 0 Server pc Job Name LOG BACKUP Step ...
0
votes
1answer
936 views

Real-time merge of two databases on different servers

One of the requirements our customer has given is to merge two databases running on two different machines in real time. This means that we have to build some sync policy (or use SQL Server tools to ...
2
votes
2answers
2k views

Restoring differential backup from SQL Server 2005 to SQL Server 2012

We are migrating a client to a new server. Their old server has SQL Server 2005. I have attempted to perform a differential backup however I received an error about the LSN chain being broken. Please ...
3
votes
1answer
2k views

SSMS 2012 is not showing the tables of the system databases

I have SQL Server Management Studio 2012 on my laptop connected to a SQL Server 2012. If I go in System Databases and then any of the 4 (master, model, msdb, tempdb) I don't have the Tables folder. ...
2
votes
2answers
2k views

Is it possible to backup a database that is not ONLINE?

We have a job which backs up all ONLINE databases nightly, but for some reason it didn't back up msdb. So the issue is at that time msdb was in some status was other then 0. So my question is : is it ...
5
votes
1answer
124 views

Many:Many with Shared Relation

I'm modelling data with multiplicity like this: Each Composition/Anthology related pair must share a Composer. Also, each Anthology must contain at least one Composition. How would you recommend I ...
4
votes
1answer
71 views

Error statement is not logged, only *password-— with many dashes

I use extended events to store database errors, like this: CREATE EVENT SESSION [ErrorCapture] ON SERVER ADD EVENT sqlserver.error_reported ( ACTION ( sqlserver.client_hostname, ...
3
votes
1answer
65 views

CPU column 5x higher on one machine vs another?

We're running into a strange issue in a deployed version of our product where the performance is just not very good. When we restore a backup of their DB on one of our machines, it performs as we ...
1
vote
1answer
761 views

Service accounts for SQL Server 2012 only allow pre-Windows 2000 name?

I've just set up SQL Server 2012 with domain service accounts. I found that the account name would not validate unless I used the shorter user name. Is there any way of using the full names?
2
votes
2answers
794 views

The multi-part identifier “xxx” could not be bound

The following is a HAVING clause from a small part of a very large stored procedure which I have inherited from some other devs (external); HAVING (SELECT COUNT(*) FROM ( SELECT * FROM ...
0
votes
1answer
76 views

Migration of SQL Server to Oracle Database

In Sql server, My Procedure will create temporary tables where column names are dynamically comes from every user, then inserts the data into the temporary tables and i use the data further based on ...
1
vote
3answers
187 views

DB comparer field by field for all tables

I have a liveDB and I have a development DB. Now when I make a change to development DB, I want to find out the changes later when I am deploying my application on server. For eg. I may have added ...
2
votes
2answers
1k views

Trying to write a function that doesn't require dbo. prefix

I am trying to write a simple system function so that the dbo. prefix is NOT required to access the function. I have found an example of this for SQL Server 2000 but when I run EXEC SP_CONFIGURE ...
9
votes
5answers
1k views

Force sql server to run query conditions as written?

Im using Sql server 2008 R2 And I have this pseudo query (SP) : select ... from ... WHERE @LinkMode IS NULL AND (myColumn IN (...very long time exeted query...)) ... ... The ...
1
vote
2answers
156 views

Why does this 120 GB insert grow the log by over 780 GB?

A table [tbl_old] has about 3 billion rows and about 120 GB for disk space, and then created a [tbl_new] with the same schema (actually, just dumped the script of [tbl_old], then rename the table name ...
2
votes
1answer
117 views

What are the risks for logging across databases via a trigger?

I've searched for this online and had mixed or unclear responses, and after posting on superuser, was directed over here. On SQL Server 2005, we currently log certain table changes via triggers using ...
1
vote
1answer
63 views

SSRS Deployment

I have developed and deploy my reports on report server in LAN. but I want to deploy my reports on report server which is not in LAN. means I need a setup or package which can run at client end ...
0
votes
4answers
3k views

Database Restore Failed Due to Incompatible Version of SQL Server [duplicate]

I am working on different two SQL Server , I need to transfer database from one server to another but problem is both server has different version. Below is Image of Error message. Using SELECT ...
0
votes
2answers
457 views

Sync Indexes between two tables

I need to automate and Sync only indexes between two tables ( Primary and Stage_Table) within the same database. I tried using SSIS SQL Server Objects Task, but looks like it works only when we sync ...
4
votes
1answer
237 views

Is there a behavior change between SQL Server 2000 and SQL Server 2008 R2 OPTION (FAST 1)?

This is question 2 of 2 related to the FAST query hint. Background Information (as an aside, I'm not trying to garner more rep, I'm trying to be true to only asking one question per question). Our ...
5
votes
1answer
873 views

How does OPTION (FAST 1) actually interact with a client?

This is question 1 of 2 related to OPTION (FAST 1); We've just upgraded our ERP database from SQL 2000 EE to 2008 R2 EE and we've been noticing increased blocking in the database. I've narrowed it ...
1
vote
1answer
484 views

Publishing stored proc execution in transactional replication

In SQL 2008 R2, I am going to update a table which will affect 25 million rows, table is currently replicated (transactional replication). To minimize the impact on replication can I create a stored ...
4
votes
1answer
480 views

Indexes file damaged, was on ramdisk

I have put some of my indexes into a filegroup that contains one file, that file is on the ramdisk, the performance is great, but the problem is that the file was deleted incorrectly (the file ...
2
votes
0answers
254 views

Multithreading caching in SQL CLR

Is there any mechanism available to a SQLCLR assembly for caching that will still work when the assembly is registered as "safe"? The cache needs to be thread-safe, so it can be shared by multiple ...
1
vote
0answers
511 views

Asynchronous processing of SQL CLR results that can dynamically add more work [closed]

I have an application that consists of Web-services that make calls to a sharded SQL Server database. Each database node has a SQL CLR stored procedures, which given some number of records to process, ...
-3
votes
1answer
2k views

Difference between accessing SQL Server by instance name and cluster name [closed]

I have installed failover clustering feature on two servers with Windows Server 2012 and then I installed SQL Server 2012 on both of them. I also enabled SQL Server 2012 AlwaysOn feature. Now I can ...
8
votes
3answers
654 views

Worse performance on a new server

We've been on a dedicated server (single quad-core, 6 GB RAM) and are moving to a new dedicated server (2x hex-core, 32 GB RAM). Both are Windows Server 2008, SQL Server 2008. The performance on the ...
4
votes
5answers
11k views

Shrinking the log file does not reduce size

I have a database which had mdf size of 350 MB and ldf size 4.9 GB When i try to shrink the log file it's not shrinking. I know shrinking a database is not good and it should not be done. But still i ...
1
vote
0answers
437 views

Denying direct remote access to SQL Server

I am trying to stop our valid database users accessing our SQL Server remotely via applications other than our system application (e.g., MS Excel). These accesses need to be prevented because they ...
3
votes
1answer
571 views

Create SQL Script for Statistics

I wanna create script my whole table, including all statistics and indexes. In SSM, When I right click table and create script, it gives me script for Indexes for not for statistics. If I right ...
1
vote
0answers
97 views

Monitor For Disabled Queue On RDS SQL Server

I would like to somehow get notification of a queue being disabled due to poisoned messages. (The issue is occasional resource contention. Until we solve it, monitoring would help us be aware.) In my ...
5
votes
1answer
3k views

Why does CREATE INDEX … WITH ONLINE=ON block access to the table over a period of minutes?

I have an existing table: CREATE TABLE dbo.ProofDetails ( ProofDetailsID int NOT NULL CONSTRAINT PK_ProofDetails PRIMARY KEY CLUSTERED IDENTITY(1,1), ProofID int NULL, ...
5
votes
1answer
191 views

Transactional replication creating a fixup index that's sleeping, but blocking other processes

I've just migrated my ERP database server from SQL Server 2000 to SQL Server 2008 R2 (both Enterprise Edition) and that migration went fairly smoothly. However, now that I'm trying to recreate ...
0
votes
1answer
126 views

What is the correct model for related tables with millions of rows?

I need to create a question and answer tables that will have millions (maybe billions) of rows. The current model is: Question Table id_question (PK, auto increment) id_user question_content ...
5
votes
3answers
1k views

How does “Be made using the login's current security context” pass the users password to remote server

Say you have a SQL Server with a "Linked Server" to another server - said "Linked Server" is set to use "Be made using the login's current security context" as its authentication model. How does the ...
0
votes
1answer
564 views

How to access SQL Server 2012 on EC2 server from my ASP.NET website published on the same EC2 server?

My site is not able to establish a connection to the SQL Server 2012 from EC2. My connection string is as follows: Data Source=AMAZONA-2SSRDM3;Initial Catalog=MyDatabase;Integrated Security=SSPI; ...
5
votes
2answers
666 views

“Arithmetic overflow” when initializing SQL Server 2012 replication from backup [on hold]

I'm initializing SQL Server replication from a backup, by following instructions from here: http://www.mssqltips.com/sqlservertip/2386/initialize-sql-server-replication-using-a-database-backup/ ...
1
vote
3answers
409 views

Performance issues moving 1 million rows between tables

I want to replicate 1 million rows from table1 to table2. I have written a job with a query like this: delete from table1 OUTPUT *.delete into table2 I am executing this job every hour, but it ...
1
vote
2answers
642 views

From SQL Server to NuoDB: Common Table Expressions, Stored Procedures and Bulk Uploads

I am currently evaluating NuoDB as a replacement for SQL Server. The application is written in C#, .NET 4.0. Now I am using features of SQL Server like: Common Table Expressions (I have a table ...
-1
votes
3answers
113 views

Add Contents in a Column and make them 0 [closed]

http://sqlfiddle.com/#!3/96f11/3 In the above fiddle, I need the required output in the Fiddle. ie., The UserID column in Filtered Table and Main table are equal. I need to get the Amt column data ...
1
vote
4answers
3k views

Speed up large clustered index creation?

I have a large table, the row count of the table is more than 3 billion, the data space for this table is about 120 GB. And Intel Xeon CPU E5645 @2.4GHz(2 processors), 24 CPUs, 64G memory, 64bit ...
2
votes
1answer
451 views

Visualiser for spatial query results

This question Whats the easiest way to get sql 08 spatial data onto a map? (and many other articles) recommends Craig Dunn's Geoquery, but all the download links appear to be kaput. SQL Server ...
4
votes
2answers
392 views

Total Memory capped far below available memory

We are testing out a new install of SQL Server 2012 on a virtual server and the memory allocated to SQL Server seems to be capped around 16 GB even though much more is available. What could cause ...
2
votes
1answer
519 views

Rebuilding Unique Index with uniqueidentifier in SQL Azure never succeeds

We have a number of tables (~1M records) that have a column on them defined as: [GlobalID] [uniqueidentifier] NOT NULL that gets auto-populated with newid(). We use this ID for synchronizing data ...
1
vote
1answer
537 views

Composite field in SQL Server, does it exist?

I'm designing a table to be used by a Web App, and my framework requires that the primary key be a surrogate key. But I also need an extra field which will be a composite of 2 other fields. In other ...
2
votes
2answers
481 views

limit the number of rows returned when a condition is met?

Is it possible to limit the number of rows returned when a condition is met? I am working on a query to check if a student is ready to graduate, and they need to meet a certain number of credits per ...
0
votes
3answers
2k views

Easier way to handle so many isnull() situation

Is there any good way to avoid writing so many times isnull() function inside sproc ? I have stored procedure that use almost 30 times isnull() function, I think that I am miss a concept , but until I ...