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)

4
votes
1answer
645 views

Determining whether column in view can only contain unique values

I have a SQL Server 2008 database with several views. I'm looking for a way to definitively determine whether a particular view has a column that can only contain unique values (i.e. can be used as a ...
0
votes
0answers
142 views

C:\Program Files\Microsoft SQL Server\MSSQL$SHAREPOINT\DATA [closed]

I am trying to query SharePoint list data from a database named like STS_bangbus_1 database, but there seem to be only one SQL Server instance with the named “bangbus” aka “SHAREPOINT”, with ...
2
votes
3answers
1k views

query processor ran out of internal resources and could not produce a query plan

This is showing up in the logs several times a night. How do I find the query causing the issue? SQL Server 2008 R2 Sp1. Thank you
3
votes
2answers
265 views

Backup SQL DataBase to C$

Another simple SQL backup question from me.... I've got a SQL Server database running on SSMS 2008 and am trying to configure some backup jobs. I am now seemingly fine with backing up and restoring ...
2
votes
2answers
1k views

SQL Server 2008 R2 DDL Trigger to create DML Triggers on all new user tables

As the title says I would like to create a DDL trigger which in turn creates DML triggers for most new tables. The trigger I have so far will create triggers on ALL tables, which is not what I'm ...
2
votes
1answer
244 views

Why 2 allocation units during online index rebuild to different file group?

I'm in the process of rebuilding the clustered index of a big table to a different file group. I'm monitoring the rebuild process using sys.system_internals_allocation_units. I'm 3h in but not done ...
3
votes
1answer
1k views

Move Primary Key to Filegroup (SQL Server 2012)

How can I move a clustered primary key to a new filegroup? I already have found a possible "algorithm" but it is horribly inefficient: Drop non-clustered indexed (requires them to be resorted and ...
8
votes
1answer
517 views

SQL Server 2008 R2 corrupted after changing MAXDOP [closed]

My SQL Server 2008 R2 doesn't work after changing the MAXDOP parameter on instances. I have 6 instances located on the same physical server and I changed MAXDOP from 1 to 2 on 5 instances. After ...
0
votes
0answers
242 views

Problem with PIVOT [closed]

I am facing a small issue while using PIVOT table. My problem is as following. I have a single table with the procedures id and their steps and i want all the steps needs to be displayed in 5 column ...
2
votes
2answers
1k views

Average Time to Load 1.2 million records from Oracle INTO SQL SERVER 2008R2

I have an ssis package which loads 1.2 million records of data from oracle into SQL SERVER 2008R2(with 32 GB RAM) dataware house table once every week. (truncating and loading) This process is taking ...
2
votes
1answer
179 views

clustered and covering index ignored on delete statement. Table scan occurs

Why would SQL Server 2005 find it more efficient to perform a table scan instead of using the available clustered index on the primary key (and only the primary key)? DISCLAIMER: There is also a ...
14
votes
2answers
758 views

Does varchar size matter in temporary tables?

There is a debate at my wife's work about just using varchar(255) for all varchar fields in temporary tables in stored procedures. Basically, one camp wants to use 255 because it will always work ...
3
votes
1answer
2k views

Finding exact statement causing error 3930

Lately I've been seeing errors in the SQL Server Log. Code:3930 Description:"The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the ...
6
votes
2answers
9k views

SQL Server NTFS allocation unit size

On Windows 2008 R2 running SQL Server 2008 R2 how imporatant is the NTFS allocation unit size on DISK IO performance. It appears to me that server admin who built the few servers for a mission ...
2
votes
0answers
667 views

SQL Server connection with multiSubnetFailover fails, claims mirroring is enabled

I have two SQL Server instances in an availability group. They are not mirrored. I'm trying to connect to the AG using the MS JDBC drivers (4.0) with a connection string including ...
2
votes
1answer
77 views

Selecting values that are not associated with one side of a many to many relationship

I have a junction table between categories and values that indicate which categories are associated with which each value. I would like to find the values that are not associated with each category. ...
2
votes
2answers
3k views

Create job to send alert using sp_send_dbmail when table value greater than x

PROBLEM The SMScounter.Counter is used to accumulate usage from a service. The service has a programmatic cap of 1000. I would like to alert users when this cap is breached. TABLE CREATE CREATE ...
2
votes
2answers
342 views

Problem with sp_Updatestats

I am having a problem when running sp_updatestats on my database it generates an error when my emp table is updating and disconnects I will paste the error here Updating [dbo].[emp] Msg 0, Level 11, ...
1
vote
1answer
247 views

Locking And Blocking With Merge Replication

I am using merge replication in SQL 2012 with web sync. When I insert records into the top tables in my filter hierarchy it causes a lot of locking on the tables, including the merge replication ...
5
votes
1answer
283 views

SQL Recover from .bak file with NOINIT

This will, hopefully, be a nice and quick question for someone out there. It continues from my previous question. I have a .BAK file that I'm trying to restore. The .BAK was created with the NOINIT ...
3
votes
3answers
396 views

Database IO comparison

We're running sql server on vmware. Our san is pretty new but still I think I/O is pretty crappy even though I'm supposed to be on separate spindels. Server speeds are: My client machine: Is our ...
1
vote
1answer
1k views

SQL Server: Simple database restore with overwrite

What I'm trying to do is backup one of our production databases and restore them as our dev database (overwriting what's been there). That's how I back up: backup database [authfx] to disk = ...
1
vote
1answer
275 views

Stuff function in T-SQL

select STUFF( STUFF(RIGHT('000000' + CAST([run_duration] AS VARCHAR(6)), 6) , 3, 0, ':') , 6, 0, ':') AS [LastRunDuration (HH:MM:SS)] from sysjobhistory The query I have ...
3
votes
1answer
3k views

How to connect multiple users/schemas in Oracle 11g?

I'm almost new user to databases, so I think I'm doing something wrong. I have the database created. I created 3 users, 1 it's an Admin, 2 are just users. I created 2 roles, 1 for the Admin and 2 ...
6
votes
0answers
883 views

SQL-08S01 error in FreeTDS/Azure when executing stored proc for a few minutes from Linux (but not from Windows)

I get this error on Linux (Ubuntu and CentOS) when executing a stored proc from Perl/DBI/ODBC/FreeTDS to SQL Azure: [unixODBC][FreeTDS][SQL Server]Read from the server failed (SQL-08S01) I don't ...
13
votes
1answer
2k views

Execution plan shows expensive CONVERT_IMPLICIT operation. Can I fix this with indexing or do I need to change the table?

I have a really important, really slow view which includes some really ugly conditions like this in its where clause. I am also aware that the joins are gross and slow joins on varchar(13) instead of ...
-1
votes
1answer
176 views

Is 2.23 mbs/sec for 8k random writes slow? [closed]

I have recently ran some hard drive benchmarks on one of my servers follow Brent Ozar's blog. For the random writes test, i got 86.52 ios/sec and 2.23mbs/sec. I am not a hardware person, and my sys ...
3
votes
1answer
331 views

Can indexing views in SQL Server 2005+ speed up SELECT count(*) from a View?

My initial question was How does someone determine if it is a good idea to index a view?. Update: My underlying assumption was that indexing views speeds them up. This is apparently not sensible, ...
1
vote
1answer
491 views

How to alter primary key constraint for 2 columns in same table in SQL Server?

In SQL Server, I already created a table called tblDatabase with some columns. I want to add a primary key on the two columns DatabaseName and Servername. I tried to add: ALTER TABLE tblDatabase ...
1
vote
3answers
349 views

tempdb usage in SQL Server

I have a SELECT INTO statement writing to a database which is in SIMPLE recovery mode, and is not tempdb. Will this use tempdb at all? The SQL is something like USE TGTDB GO SELECT * INTO ...
3
votes
1answer
241 views

Restrict record to be update or deleted according to dates inside row for SQL Server 2005

I have transaction replication between two SQL Servers. For testing purposes I deleted a lot of records at the subscriber that still existed at the publisher. I now know that if someone updates, ...
7
votes
1answer
142 views

Error in SSMS when attempting to restore a database

We have over a dozen SQL servers, one of which hosts a couple of hundred sage databases, when i right-click on the Databases node in SSMS there is a long delay then i get the following error (and the ...
4
votes
2answers
480 views

Integrated Security Success on Master, Fails on Other Database

I'm a bit perplexed as to why my connection string is selectively succeeding on the master database in SQL Server 2005. Here are the details of my app. Any ideas where to look? I'm clearly missing ...
3
votes
1answer
318 views

SQL Server 2008 R2 Express password overwrite

I'm using a program that requires SA log-in to SQL Server. We had issues where some 3rd party support numpty changed the SA password and never informed us, so the program couldn't log-in. I've ...
1
vote
4answers
133 views

Transfer selected information from a SQL Server business server to a MySQL web server?

I have a SQL Server dedicated server used for business information on service users etc, and a VPN with MySQL for the main website operation. I wish to transfer some selected tables from SQL Server to ...
1
vote
1answer
217 views

Using multiple Active Directory accounts to connect to SQL Server

I have web applications (Classic ASP and .NET) that connect to SQL Server using SQL authentication. Each one has their own login. I want to convert these to Windows Authentication. The new AD users (1 ...
2
votes
0answers
114 views

SQL Server fulltext_semantic_languages

When trying to install a semantic search example, I'm running into a problem. There are some steps in the example to check if the 'new' Semantic Search and Full Text Search are installed. ...
1
vote
1answer
421 views

Query to compare 2 table results and filter extra records found in a table

I have two queries that I want to compare and get the extra rows found in in the first query that are not in the second plus 1. I need the DocEntryCN to perform some work. E.g. Query 1 SELECT ...
3
votes
0answers
126 views

Is it useful to have the SQL Server instance root directory on a separate drive? [closed]

I know it's possible to change many of the default paths when installing SQL Server, and generally when I do an install I change the data and log folders to be on separate drives (typically D and E), ...
9
votes
2answers
7k views

Is it useful to have the SQL Server instance root directory on a separate drive?

I know it's possible to change many of the default paths when installing SQL Server, and generally when I do an install I change the data and log folders to be on separate drives (typically D and E), ...
0
votes
1answer
89 views

Setup logical Database model for measurements

I'm struggling to set up a logical model for the following spreadsheet: (See a close-up of the table here.) My problem is that it is not clear to me how to deal with the "gap" values where each ...
2
votes
2answers
581 views

SQL Server imports data in wrong charset with SSIS

I have a flat file which I am importing into a SQL Server table using a SSIS package. The code page is set to 65001. However, when I run a SELECT * FROM tableName the data appears mangled. For ...
1
vote
1answer
2k views

Restore msdb from SQL Server 2008 R2 to SQL Server 2012 instance

I'm moving from a SQL Server 2008 R2 instance to a SQL Server 2012 instance on a separate box. I want to restore msdb to get all my agent jobs and the like and I'm getting the following error: ...
1
vote
2answers
4k views

how to calculate difference of first row and last row fields value in each group

I have table with structure like this: +-------+------------------+ | Value | Date | +-------+------------------+ | 10 | 10/10/2010 10:00 | | 11 | 10/10/2010 10:15 | | 15 | ...
2
votes
1answer
3k views

Is there a backup operator role in Microsoft SQL Server 2008?

I have a Windows Server 2008 with Microsoft SQL Server 2008 and VERITAS NetBackup installed. Basically, this NetBackup requires a valid logon ID into the SQL Server that is powerful enough to do a ...
1
vote
2answers
171 views

Implications of Changing to a Static Port

I currently have an SQL Server hosting two production instances which have numerous web apps accessing them. As far as I know, none of these apps are using a specific port in their connection strings, ...
1
vote
2answers
2k views

How do I modify the user interface language in SSMS?

How do I modify the user interface language in SQL Server Management Studio? For instance, if I installed in English, but wish to view in Japanese (to name but one possible example). I am running ...
4
votes
2answers
4k views

How to recover a corrupted msdb database in SQL Server 2008?

One of our clients' SQL Servers got corrupted. we were forced to uninstall all instances and all SQL Server programs in add/remove programs and then reinstall SQL Server because their backups were ...
6
votes
1answer
4k views

Why do we need to rebuild and reorganize Indexes in SQL Server

After searching the internet i couldn't find the reason for Why do we need to rebuild and reorganize indexes in SQL Server ? what does internally happens when we rebuild and reorganize ? An ...
6
votes
1answer
549 views

TempDB Contention with 24 physical tempdb files on 48 core AMD Opteron box

I just received the following notification about an instance of SQL Server 2005. The instance has a core-to-tempdb-file ratio of 2:1 for a total tempdb file count of 24 files. Contention should not ...