This Tag is for SQL Server 2008 R2, major build version 10.50.xxxx

learn more… | top users | synonyms

1
vote
2answers
934 views

What am I doing wrong with the Database Tuning Advisor?

My background: I'm a dev/architect, not a DBA. Sorry! So we have a ~400 table 75GB database. I ran Profiler for ~24 hours ("Tuning" template minus LoginName) and have ~7GB of usage recorded in a ...
0
votes
1answer
607 views

Deploying to an existing database from VS 2010 on TFS

I am trying to find a way in VS2010 to add a few objects to an existing database without scripting out all of the existing objects. This is a maintenance project that is adding a table, altering an ...
6
votes
1answer
805 views

Getting Identity values to use as FK in an INSTEAD OF trigger

I have a series of updateable views we are exposing to end users as the interface for a back end process. One of these views references two tables and requires an INSTEAD OF trigger for UPDATE and ...
0
votes
1answer
308 views

Server default collation change or not change

The default collation of our new server is SQL_Latin1_General_CP1_CI_AS. However the collation of the other databases which are used as the source to migrate data into the target databases on this ...
8
votes
1answer
592 views

Should I be alarmed by this NO JOIN PREDICATE warning?

I'm troubleshooting the bits and pieces of a poorly-performing stored procedure. This section of the procedure is throwing a NO JOIN PREDICATE warning select method = case ...
5
votes
1answer
194 views

Unexpected Unique Constraint Violation

Given the following CREATE TABLE statement: CREATE TABLE [dbo].[Unit] ( [id] SMALLINT NOT NULL IDENTITY(1,1), [name] VARCHAR(100) NOT NULL, CONSTRAINT ...
4
votes
1answer
123 views

comma delimited column fix

At my current place of employment someone made a decision to put IDs into a comma delimited column. I'm looking to break these out into a proper many to many relationship. However; it is not in the ...
9
votes
4answers
15k views

How export a sql server 2008 diagram to PDF filetype?

I want to have an export from my database diagram to PDF or image types. How can I do this? I worked with SQL Server 2008 R2.
3
votes
3answers
876 views

Identify applications with locks

In my environment there is a database Sybase ASE 15, that I need to replace with a Microsoft SQL Server 2000-r2. Many users access this database via some applications, that sometimes "forget" to ...
3
votes
1answer
8k views

Error 9001, Severity: 21, State: 1 The log for database 'DB_NAME' is not available [closed]

I have a SQL Server 2008 R2. I got a mail that the backup had failed, I opened the SQL log viewer and started browsing. And i found these two errors a bunch of times. error 1: Date ...
2
votes
2answers
135 views

SQL Server: reset all database tables

I have a SQL Server 2008 R2 database with about 60 tables and around 300 columns. I want to reset all the data and auto increments, I found a question somehow similar but the answer there is to ...
2
votes
0answers
234 views

Simple Select * on SQL Server 2008 R2 table of 1812 rows is taking 3 minutes to load

A query on a table of 1812 rows is taking over 3 minutes to execute. Is there a reason this should be happening? If I execute a SELECT * statement on any other table the results pop back ...
2
votes
1answer
749 views

error altering database collation

Due to a database-restore, collation has been changed. If I try to alter database <xyz> collate <xyz> I get an error, that no exclusive lock to database to fulfil this operation can be ...
6
votes
1answer
260 views

Steal ownership on database from user that no longer exists

We have a few SQL Server 2008 R2 databases where its member domain was changed (i.e. it was connected to DOMAINA and is now on DOMAINB). We have three databases where the owner of the database is ...
2
votes
1answer
204 views

SQL Server Alert - Description (None) [closed]

For every system Alert defined to send an email, we receive a 2 alerts with the following bodies. How do I stop the message with the empty (None) description? Empty Alert SQL Server Alert System: ...
2
votes
1answer
534 views

Disadvantages of reorganizing all tables nightly

I consider scheduling a SQL Server job that reorganizes all tables nightly. We don't have enterprise, so we cannot rebuild online (this means we need to reorganize). We also don't want to invest too ...
6
votes
3answers
6k views

SQL update satement taking a very long time / high disk usage for hours

Yes it sounds like a very generic issue, but I have not been able to narrow it down very much yet. So I have an UPDATE statement in a sql batch file: UPDATE A SET A.X = B.X FROM A JOIN B ON A.B_ID = ...
5
votes
1answer
1k views

How can I determine the date of a snapshot in SQL Server 2008r2?

I am working on implementing an ETL process to load data into a warehouse. Part of this process is pulling data from our production server (Server P) to a staging server where the actual load into ...
17
votes
1answer
4k views

Is there an analog of GETDATE() that returns DATETIME2

According to MSDN, Getdate(), GetUtcDate(), and CURRENT_TIMESTAMP all return DATETIME. I ran a short test, which confirms that: CREATE TABLE #t(T DATETIME2(7)); GO DECLARE @i INT ; SET @i=1; WHILE ...
2
votes
1answer
6k views

How to login with Windows Authentication mode after domain name changes in SQL Server?

I am using SQL Servre 2008 R2. I recently changed my domain name and after that when I try to login to SSMS using Windows authentication, I get an error Login Failed For User UserName Microsoft ...
5
votes
1answer
410 views

Why did my transaction log grow so much? [duplicate]

Possible Duplicate: Why Does the Transaction Log Keep Growing or Run Out of Space? About a month ago I migrated my SQL Server 2008 R2 database to a new schema. I ran scripts to migrate the ...
3
votes
1answer
332 views

Query Performance Issue

I have this below query which is behaving bit weird . well Weird in the sense that I couldn't find complete explanation for this. Version : Sql Server 2008 R2 Enterprise No fragmentation . ...
2
votes
1answer
5k views

Active/active SQL Server Clustering in Installation Center (setup.exe)

I like to know which option to choose in the setup.exe in SQL Server 2012/2008? What I have here is Windows Active/Active Cluster setup with one quorum and one msdtc configured. I installed my first ...
2
votes
1answer
8k views

invalid object on a table that exists

I am getting an "invalid object" warning error in the Management Studio query. Any query against the table works and it links correctly to another table. I am investigating an error that I'm getting ...
7
votes
2answers
679 views

Increased RAM, Worse Performance

Setup: Windows Server 2008 R2 SQL Server 2008 R2 SP1 240GB RAM TempDB is 8x16GB data files w/out auto-grow (128GB total) Physical/Stand-alone Server This server is used for ETL processing. We ...
4
votes
1answer
1k views

Why can't I read my transaction log backup file using fn_dump_dblog?

I'm using this blog on sqlskills.com as a guide to practice finding the relevant LSN in a transaction log backup for point in time recovery. After backing up the transaction log, I attempt to read it ...
4
votes
2answers
4k views

Splitting TempDB into multiples files equal to number of CPUs

The article SQL Server tempdb Best Practices Increase Performance suggests that I should split tempdb into a number of files equal to the number of cores. So for 4 cores you get 4 files. By ...
1
vote
2answers
468 views

Should a SQL Server TempDB space be allowed to be reclaimed?

If I don't have space concerns at the moment, should I size my TempDB as a large space initially and not let it's space be reclaimed? What's the best way determine what the optimal initial size for ...
7
votes
2answers
632 views

How should I configure these disks on a SQL Server for a BI configuration?

Assuming constant memory (32gb) and CPU (4), 2 x disk arrays, I have the following disks 2 x 150 (10k) 6 x 150 (15k) They are all local disks. My requirements My DB is 350gb and set to default ...
5
votes
1answer
385 views

Best way to index a table with two datetime columns that are equally queried

Sql Server 2008 R2. I have a table with ~70m records, about 10 inserts per second. It's currently clustered on a CreatedAt datetime column, which always increases. 50% of queries involve this ...
2
votes
1answer
680 views

SQL Server Error 833 On LDF File

I'm getting error 833 on my ldf file and i'm getting it a lot. Please see the following. When this happens, my application is hang already. I know error 833 has been reported a lot, but what does it ...
1
vote
1answer
58 views

Does implicit casting negatively affect index usage?

I have a query similar to the following: SELECT id FROM MyTable WHERE eventCount > eventCutoff * eventFactor eventCount and eventCutoff are defined as a smallint, and eventFactor as a float. I ...
3
votes
2answers
2k views

SQL Server Agent - Run Query at the end of each month with date variable

I am running SQL Server 2008 R2, and I need to create a new job that will basically run a query at the start of each month (at the 1st of each month at 01:00 AM). Here is the query: INSERT INTO ...
5
votes
1answer
1k views

SSIS package with BULK data load

I analyzed a C# program over the weekend for a customer that basically does the following: Truncate Table Fetch Data (source on these is either remote database or local database where job runs) ...
10
votes
1answer
655 views

Why don't SQL Server queries use more than 7MB/sec of disk I/O

I have an SSD that, using IOmeter test, shows performance over 200MB/s. However when I run any SQL query from local machine the windows resource monitor never shows disk IO above 7MB/sec. This holds ...
1
vote
1answer
3k views

Read only/Standby database - Set user permissions

Example database: WarehouseDB Example user: reporting Database state: Read only/Standby mode How do I give the user 'reporting' access to only WarehouseDB without giving them sysadmin privileges? ...
1
vote
2answers
1k views

How to identify the db orphan mdf and ldf files

I want to identify the orphan mdf and ldf files on the disk and remove them. After searching on the internet, found the script below on MSDN forum. But when I run the script it returns many ...
1
vote
1answer
2k views

Is it bad to assign specific processors to SQL Server 2008 R2 cluster instances?

I have a SQL Server 2008 R2 failover cluster with a passive node and an active node. The servers are physically identical. I have two instances of SQL Server, one set to use all the CPUs in the ...
3
votes
2answers
237 views

Find top by values by percents using range in SQL Server

What will be easier way to group records by range of percents. Here what I try to accomplish Select top percents between 50 and 75 * from myTable order by PKI Here is way I did this but I have ...
2
votes
0answers
103 views

Find out who/what logged in via a DAC connection

My SQL Server just died due to a DAC connection being established. I need to find out how/who or what caused this connection? Is this logged anywhere? Can anyone shine any light on this?
1
vote
1answer
377 views

Row_number and wrapping select ?

I have this code : Select name, age , row_number() over (partition by name order by age desc) rn from my table (goal : select the oldest guy among same names) If I want to select all the row ...
2
votes
1answer
179 views

Unique Non Clustered Column in Partitioned table

We have partitioned one of our SQL Server tables on a Clustered Index datetime column, we have a Primary key Non-clustered index column with Identity data type and this column is setup as a ...
2
votes
4answers
369 views

SQL Server BPA 2008R2

I have been using SQL server BPA for getting good information from Microsoft. I was using its 2005 version in which i used to export the results in csv format but recently I got two new servers which ...
2
votes
1answer
937 views

Restore only one datafile in SQL Server 2008 from partitioned database

We have a partitioned database that I'd like to get copied over on a semi-regular basis to another server for testing updates. Since the partitioning is based on a date column, the most current data ...
4
votes
1answer
184 views

Same Query takes 0 seconds on Server A, 7.5 minutes on Server B (same db/hardware/config)

I have a query (sql below) that is nearly instantaneous on 1 server, but takes 7.5 minutes on another virtually (key point) identical server. The estimated query execution plans have one obvious ...
2
votes
1answer
479 views

SQL Server 2008 R2 Database Diagram Error Code

I have sysadmin privileges on a SQL Server 2008 R2 server. I'm working with the development database and want to save a database diagram I created. When I try to save I get the following error ...
3
votes
1answer
972 views

Error while restoring database in SQL Server 2008 R2

This error occurs while I restore database from .bak file A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software ...
0
votes
1answer
156 views

How to create an index view?

I have a view which is doing summation of several columns: Select cola, colb, cola + colb + colc from table tbl_a Can I know what are the indexes I should create for the view to improve its ...
1
vote
1answer
159 views

SQL Server 2008 - get current LOCK_ESCALATION on particular table

Is there a way to find the current setting for LOCK_ESCALATION on particular table? Can it be found through system views?
2
votes
2answers
101 views

Advice about Backup Solution

Our database Server is being hosted by another company. They provide a file level backup that occurs once per day. They also allow for Log Shipping. My company is taking advantage of their ...