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

learn more… | top users | synonyms

3
votes
1answer
1k views

This backup cannot be restored using WITH STANDBY because a database upgrade is needed. Reissue the RESTORE without WITH STANDBY

I am creating log shipping for two databases, db1 and db2. It will be from SQL Server 2008 r2 to newer version, SQL Server 2012 On the SQL 2008R2, they are both dbi_version = 661: DBCC TRACEON ...
2
votes
1answer
279 views

sql script to export table's column data to another table's column

Let's say , I have two table with same schema but different data . Table_A and Table_B . Table_A -------- ID(p_key) Number(p_key) Column3 Column4 ...
3
votes
1answer
3k views

Rights to execute stored procedure, but not read underlying tables directly

I have a stored procedure that contains lots of different columns from many different tables; I want to give 20 users access to the results of the stored procedure via Excel. Is it possible to make ...
2
votes
0answers
232 views

database mirror problem with Network Service account

I have two SQL Server 2008 R2 instances installed on same Server and the engine log on as Network Service account which is set by installation. there is a database TestDB on both instances. I try to ...
1
vote
1answer
259 views

Select Most Recently Updated Row Based on Sequence ID with Three Tables

I've previously asked how to use a sequence ID to select the most recently updated row, but I'm not quite sure how to apply it to a more advanced query involving multiple joins. Here is my current ...
2
votes
1answer
589 views

Interpretation of a column in SQL Server profile trace

In a trace table generated by Profiler I tried to determine the origin of a lock using the column ObjectID2 joined to sys.allocation_units. The results are not good. It identifies many tables that ...
0
votes
0answers
67 views

“Show table data” option to edit compact database

I have installed sql server compact edition 3.5 and i am sql server management studio to edit table.I am using "Show table data" option which comes on right click to a table of compact database. But i ...
1
vote
1answer
125 views

Server audit with more than 1.000 entries

On my Mssql 2008r2 I created a server audit for all login and logout: USE MASTER GO CREATE SERVER AUDIT audit_test TO FILE (FILEPATH = 'D:\Audit') GO ...
1
vote
1answer
1k views

Strategy for Repair Database on SQL Server 2008 R2 Standard

(one guy pushed green button instead of blue, three racks left as was his original target, probably green is nicer then blue, on this SAN are saved database files) after this accident I'm run ...
0
votes
1answer
212 views

Should I use begin tran to do an alter table column that increases the column length?

I want to execute this statement in a production database to alter the length of a varchar column from 50 to 72: ALTER TABLE Users ALTER COLUMN LoginID varchar(72) NOT NULL The column is not null ...
1
vote
1answer
251 views

Language difference in full text search for numeric strings

If I create this table on SQL Server 10.50.2550 (SQL Server 2008 R2): CREATE TABLE test( id BIGINT IDENTITY NOT NULL, number VARCHAR(10), CONSTRAINT test_pk PRIMARY KEY (id) ); CREATE FULLTEXT ...
2
votes
1answer
609 views

T-SQL Query runs quickly on local PC, but slow on SQL Server?

I have a query with a few joins and a couple of basic SUM(...) statements, and no parameters. It's been running without issue for months - but has suddenly started running very slowly on the server ...
1
vote
2answers
15k views

OpenRowSet - How to configure OLE DB Provider to be used for for distributed queries

I have an Excel file with data and would like to update a table in database based on the data the Excel file contains. To do that I want to use OpenRowSet command. But I get the error below when even ...
5
votes
1answer
1k views

How to migrate between schemas in bulk in SQL Server?

We currently have multiple databases but would like to combine them and, instead, separate our domain contexts using schemas. In MS SQL Server 2008 R2, how can I relocate all the contents of one ...
2
votes
1answer
6k views

SQL Server : keep track of all connections/disconnections

I have a Microsoft SQL Server 2008r2 SP1. I need to know which users connect to, and disconnect from, database. Ideally, I would like a list of (datetime, username, connect/disconnect). Can this be ...
4
votes
2answers
602 views

SQL Server R2 Standard Edition MAXDOP setting

I'm looking for confirmation/guidance on setting MAXDOP in a SQL Server instance with the following config: Version : SQL Server 2008 R2 Standard Edition Processor : 2 x AMD Opteron(TM) ...
1
vote
1answer
15k views

SQL-Server - Grant user DBO permission on database

I have a reporting database that I restore every night from a backup of the production database. When I restore, I need to add a user to the DBO role for that database. I thought this would work: ...
2
votes
1answer
1k views

sql server 2008 r2 DBCC checktable error

This morning my database went into suspect mode. I reverted back to last night's full backup to get it back online. I went through the error log and found the last command that appeared to cause the ...
0
votes
2answers
501 views

Installing SQL Server Express in parallel of Standard

On a server I have a SQL Server 2008 r2 standard performing very bad. To make a quick & dirty test I would like to try to install express edition. This server is not administrated by me, it is a ...
1
vote
1answer
512 views

SSIS FTP Sending Blank Files

I'm supporting an existing data interface that is a series of SSIS packages (SQL 2008 R2) for sending and receiving data with a third party. The communication is being done through FTP, and it uses a ...
0
votes
2answers
369 views

What locking can I expect with DBCC CHECKIDENT(RESEED)

I'm working on a project that has hit a bit of a snag: I'm replacing some replication with a home built system so that if replication goes down we don't blow our SLAs with our customers and shell out ...
3
votes
2answers
2k views

Quickly restoring a backup over top of an existing database - error “database in use”

I'm working on a set of scripts (in SQL Server Management Studio) to fix certain data inconsistencies in a customer database (SQL Server 2008 R2). I got a .bak file with the database, and I restored ...
0
votes
1answer
140 views

Backup of Job's List only

Goal: Reuse the SQL server agent jobs list. Problem: The list contains a lot of jobs and I need to reuse the jobs list in a another time without recreating it. Based on the example of the picture, ...
0
votes
1answer
388 views

Need C# Sql Server Project Set Up Guide [closed]

I am creating a window application on c# .net and Sql Server 2008 R2. I will give the setup of this application to my client but I am little bit confuse about SQL Server Database. How the database is ...
1
vote
3answers
5k views

SSRS Reports Manager Security Configuration

I happen to be setting up a reporting server at work from scrach. Having very little almost no experience of sql server administration I am finding it really difficult to configure the security ...
0
votes
0answers
245 views

SQL Link Connection OLE DB provider Query Execution Failed

I have created linked connection in SQL and by which I am connecting Oracle server using OLE DB provider "OraOLEDB.Oracle". SQL Server = 2008 R2 Oracle = 10g Normally, When I am executing Insert or ...
3
votes
2answers
151 views

Post mortem on tempdb transaction log after instance restart?

TempDB transaction log filled up and I had to restart SQL Server as a result. After the restart, is there any way to see what caused the transaction log to fill up in the first place?
7
votes
1answer
2k views

Broken tempdb location and can't recover

Made a mistake and mistyped an alter database command for tempdb. Now the instance won't start. I can't start in single user mode using -m as it states the tempdb could not be found. I tried using: ...
5
votes
1answer
552 views

Don't rebuild indexes < 1000 pages - then why bother having them?

Microsoft recommends not bothering to rebuild indexes that have less than 1,000 pages (from memory I think it's because they are so small that they will be held in RAM). If I'm not rebuilding them, ...
10
votes
3answers
195 views

One index or two?

I have the following index created on a table in my database: CREATE INDEX [idx_index1] on [table1] (col1, col2, col3) The server is suggesting the following 'missing' index: CREATE INDEX ...
1
vote
1answer
72 views

Display a List of used Table and Column

Goal: Display detailed information if database A use database B:s table and its column. if yes, the list will display what is the name of the database B:s table and column that is being used in ...
1
vote
1answer
776 views

Finding rows where a column contains [ and ] characters

I need to get results where the column contains a string that includes [ ]. When I use LIKE, it takes the [] as a wildcard sequence, and doesn't work as I need. For example, I want to search through ...
3
votes
2answers
221 views

Prevent SysAdmin from doing a Database Restore

I am a sysadmin on my SQL Server 2008, and I need to be, but I would like to setup my security on the Production server to prevent me from accidentally restoring to the production database. I ...
2
votes
2answers
3k views

Update one instance of Sql Server 2008 R2 Standard to SP2?

We have one server with multiple Sq Server 2008 R2 instances installed. To support an application we need to upgrade to one instance to SP2. Can we only apply the service pack to the specific ...
0
votes
2answers
1k views

High Disk I/0 Issues

Our database has been giving this error occassionally... "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> ...
1
vote
1answer
970 views

SQL Server performance for tables having large number of columns [closed]

I have a requirement where I need to create a table with about 600 columns. Out of 600 columns about 200 columns will be XML columns. Other column will be of other datatypes such as int, varchar, ...
1
vote
1answer
237 views

Using OLE DB Source SQL command vs desinging the query using the object tools

In SSIS, we can use the OLE DB Source SQL command to run a T-SQL script on the database and then use the output as the source. For example the a complex query can be wrapped in the OLD DB source SQL ...
2
votes
1answer
2k views

How bad is query plan pollution (too many equivalent plans in cache)?

Question currently affects C#/.NET, DB access based on ADO.NET and SQL Server 2008 R2, but I think it applies to other databases as well. I noticed some old modules of a system have non-optimal SQL ...
0
votes
1answer
1k views

Why are timestamps not always increasing with concurrent inserts?

I'm seeing some unexpected behavior with timestamp (rowversion) columns . I created a test table: create table Test ( Test_Key int identity(1,1) primary key clustered, Test_Value int, ...
3
votes
1answer
296 views

SQL Server: Can Page Verify be set to Checksum on any database, or must I check compatibility?

In Microsoft SQL Server, I have some older databases set to "Torn Page Detection" rather than "Checksum" page verify. Do I need to determine if a given SQL Server database is 'compatible' with the ...
21
votes
3answers
2k views

difference in execution plans on UAT and PROD server

I want to understand why there would be such a huge difference in execution of the same query on UAT (runs in 3 sec) vs PROD (run in 23 secs). Both UAT and PROD are having exactly data and indexes. ...
2
votes
1answer
166 views

Optimizing query on a partitioned table

Tried to find an answer for this, but couldn't. So bear with me and apologies if this has been answered elsewhere. It may be just me not being able to find it. Here's the setup: SQL 2008 R2 EE. Table ...
0
votes
1answer
62 views

SSMS gives error if column name is “MERGE” where as other keywords works

IN SSMS create table if we include sql keywords in column name then it will be wrapped around square brackets "[]" automatically and the table gets created without any error generally. But if we ...
0
votes
2answers
97 views

Can I improve this query?

SELECT * FROM SameLogTable WHERE ID_Table IN (SELECT ID_Table-1 FROM SameLogTable WHERE <SameCondition>) OR ID_Table IN (SELECT ID_Table ...
2
votes
1answer
291 views

NEWSEQUENTIALID() resets sequence on server restart

MSDN learns me that NEWSEQUENTIALID(): Creates a GUID that is greater than any GUID previously generated by this function on a specified computer since Windows was started. After restarting ...
2
votes
1answer
77 views

What is the appropriate SQL method for “Safe to SUM”?

In SQL Server 2008 R2+ we, unfortunately, have some nvarchar columns storing numeric data. In some cases we want to SUM the data when it can be summed. The problem is that ISNUMERIC() returns 1 for a ...
2
votes
1answer
363 views

SQL Server Replication - setting up scheduler issue

We have tasked to set up a scheduler to synchronize data between a publisher and subscriber on daily basis. The subscription was set using windows sync manager and it runs just fine when run manually. ...
1
vote
1answer
227 views

What is the default value of ANSI Padding Enabled, and what should value should I set it to?

When creating a new database, ANSI Padding Enabled is set to False by default. According to this however, the default is ON (which I assume is the same as True). They also recommend to set it to ON ...
1
vote
0answers
445 views

Log file growth due to replication issue

I have one primary database and it's getting replicated to another server. Both servers are SQL Server 2008 R2 with SP1. Replication was running fine till last week. We have transaction log backup ...
1
vote
0answers
2k views

Strange error with restoring database

Some times ago I have done backup my MS SQL Server database and then I restore it (on other computer and server). Today I would make just like two weeks ago. But when I choose file to restore from ...