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

learn more… | top users | synonyms

1
vote
0answers
45 views

Can High CPU be triggered by Login Failures?

On our SQL Server (used for TFS) we have recently had the CPU pegged at 100% (with a few occasional dips) for nearly a day and a half. Looking at the SQL Logs, there appears to be a correlation in ...
4
votes
2answers
191 views

How can I reliably determine if a given SQL Server instance has the “Lock Pages in Memory” right?

The "Lock Pages in Memory" right can be granted to the service account used by SQL Server. This allows SQL Server to prevent memory being paged to disk. I've noticed several of our SQL Server ...
1
vote
1answer
27 views

SQL Server 2008R2 - Replication - Log Files / Indexes

We have 4 SQL Servers engaged in Transactional Peer to Peer Replication. I am doing some work on the Indexes and have noticed 2 things I didn't expect: The Indexes have different fragmentation ...
0
votes
1answer
60 views

Removing some English token words (such as “are” or “or” etc.) from the system stoplist of full text search?

One of our table has full text catalog on it. It contains some data in a language other than English which makes some words such as "are", "or" useful. There is no stop list defined but these words ...
0
votes
0answers
34 views

Full text catalog missing a keyword

We have a full text catalog on one of our databases but one keyword does not work. e.g: select * from table where name = 'jon' -- result set returns as expected select * from table where ...
4
votes
0answers
124 views

Trace Flag 1222 Not Working?

I have a customer site with two similarly configured 2008r2 SQL Servers "A" and "C". On both servers the trace flags 1204 and 1222 are enabled and DBCC tracestatus shows the following on both ...
1
vote
1answer
29 views

user mapping is droped after swithing from principle server to mirror server

I have principal server:A and mirror server:B with DB Name: "DBTest" On the server A there is a username (SQL auth.) call: user1 and is mapped to "DBTest". the Same is on Server B, same username and ...
0
votes
0answers
10 views

Replication Latency as Explanation for Missing Rows between Databases

We use a third party database system that consists of two databases 1) A live database which users update via a black box interface 2) A reporting database which we access via management studio, SSRS ...
0
votes
1answer
64 views

Return rows one at a time from variable table

I have a database which contains job numbers, each job has a list of invoices and a list of journals. Its an IRQ request accounting system. In order to see which jobs have a zero balance I'm ...
0
votes
1answer
28 views

Only Filtered condition gets deleted from index after datatype change using SSMS

In SSMS if I create a filtered index we can see filtered condition in index properties. But if I change column type of a column involved in filtered index using SSMS , then after column type changes ...
0
votes
1answer
29 views

Reducing size of datatype involved in index fails where as increasing size work

This question is related to my previous question Database events that will cause deletion of index For example if i create a table like CREATE TABLE dbo.Customers (ID INT IDENTITY(1,1) PRIMARY KEY ...
2
votes
2answers
62 views

Strategies for “checking out” records for processing

I'm not sure if there is a named pattern for this, or if there isn't because it's a terrible idea. But I need my service to operate in an active/active load balanced environment. This is the ...
0
votes
0answers
36 views

sql server snapshot replication compatibility issue

I have 2 SQL Server 2008 R2 and I am trying to set up Snapshot Replication over the Internet. I have successfully managed to get the subscriber to connect, but now as the Job executes on the ...
1
vote
2answers
116 views

SQL Server 2008 R2 – Track Database Growth (Production Database)

My requirement is to get the database size information collected daily, I did not find any option to get database growth over a period of time. Someone please advise what the correct method for this ...
3
votes
1answer
69 views

Overlapping indexes

I have two non-clustered indexes on one of my dbs and their definition are: CREATE NONCLUSTERED INDEX [NC_Index1] ON [dbo].[anyTable] ( [X] ASC, [Y] ASC, [Z] ASC ) INCLUDE (A , ...
2
votes
2answers
132 views

SQL Server Backup Job failed multiple times

I am getting the same error as mentioned by Mr.Ali Sql Server Backup Job failed Can anyone please explain the possible ways to fix this error as the backup is failing since 1 month. Here is the ...
0
votes
0answers
54 views

SQL Server: efficient query with (double) linked servers

I am DBA of server A (SQL Server 2008R2), linked to server B (SQL Server 2012SP1), linked to server C (not sure which version). I have no control on server C, and I cannot contact its DBA. On server ...
1
vote
1answer
74 views

Sql Server 2008 R2 - Failed to send an environment change notification to a log shipping partner node

Login failed for user '*****'. Reason: Failed to send an environment change notification to a log shipping partner node while revalidating the login. I'm seeing a bunch of these errors on my ...
2
votes
4answers
221 views

Re-writing a sub-select as a condition on a column generated with 'over (partition by …)'

I am wondering if it would be possible to use over (partition by...) clause in order to avoid using a sub-select in the example below: declare @t table ( id int ,code char(2) ...
0
votes
0answers
79 views

SQL Server Replication Snapshot Agent login fails

I have setup TRANSACTIONAL REPLICATION from ServerA to ServerB ServerA = Primary Server = SQL Server 2008 R2 Enterprise ServerB = Secondary Server = SQL Server 2008 R2 Standard Edition. I ...
0
votes
1answer
39 views

Using pivot on datetime

I have the following table: Date,Type 2012-01-25 13:48:00.000,1 2012-01-25 13:49:00.000,2 2012-01-26 13:48:00.000,1 2012-01-26 13:49:00.000,2 I tried the pivot function to get this layout: 1,2 ...
2
votes
1answer
85 views

How to solve SIDs mistmatching in SQL or orphaned users?

I moved and restored a database from a backup into another SQL Server 2008R2 about a year ago. I wasn't aware of the concept of orphaned users. From what I understood, is that we can end up having ...
2
votes
0answers
56 views

work/cache table issues, heavy inserts with heavy reads

we have a work table that stores availability of products. This table is updated with millions of inserts every night and medium amounts of inserts throughout the day. during the updates, we delete ...
5
votes
1answer
200 views

What is a non-clustered index scan

I know what table scan, clustered index scan and index seek is but my google skills let me down to find a precise explanation into non clustered index scans. Why and when a query uses a non clustered ...
1
vote
1answer
36 views

What happens on the primary when log cannot be restored on the secondary on Log Shipping

I would like to setup a log shipping but I have a concern as to what would happen if the restore operation on the secondary would fail for some reason. I want the primary database keep working no ...
2
votes
2answers
192 views

Error during SQL Server 2008 R2 SP3 upgrade: MODIFY FILE failed. File 'MSDBLog' does not exist

I have just installed SQL Server 2008 R2 SP3 and after installing it and trying to start the SQL Server instance again, it won't come online. In the SQL Server error log I can see that the following ...
2
votes
2answers
229 views

How to get OUTPUT $action, Inserted.*,Deleted.* records in In SSIS

I was just wondering, in MERGE in T-SQL, you can output the OUTPUT $action, Inserted.* and Deleted.* records. I want to ask how can I get OUTPUT $action, Inserted.*, Deleted.* records in SSIS?
0
votes
1answer
84 views

How many LEFT JOINS make a VIEW unusable?

I have a view which involves LEFT JOINS on 20+ tables to a base table but when querying this view and looking at the execution plans I am getting something totally unexpected. For example, with the ...
1
vote
0answers
40 views

Getting insufficient memory available in the buffer pool [duplicate]

I'm trying to trim out most data across a few dozen tables in a copy of a database. This is an ad hoc need I'm performing on a local machine running SQL Server 2008R2 Standard SP1. Tables are ...
3
votes
1answer
114 views

Need help with a Running Total Issue

Using SQL-Server 2008 R2 and Report Builder 3.0 Here is my query without the running total column: SELECT CostManagement_CommitmentDetails.Id ,CostManagement_CommitmentDetails.LineNumber AS ...
1
vote
1answer
38 views

How to query a list of all the different errors?

I have a DB which is very big and stores a lot of eventlogs, around 15 million rows. When I try this query, it is totally impossible to get some results. Any idea how I could do this? Maybe indexed ...
1
vote
2answers
52 views

Export structure and data without a wizard [duplicate]

Using Sql Server 2008 R2 (but I could possibly upgrade if required). I want to generate scripts for the database structure as well as the data for a schema. The Generate Scripts wizard does what I ...
2
votes
1answer
25 views

Restore backup to different filegroup

Using Sql Server 2008R2. I have a backup of a filegroup. Is it possible to restore this to a different file group (possibly even on a different database)? I have tried RESTORE DATABASE my_database ...
1
vote
1answer
44 views

Log shipping option not showing

I am using SQL Server 2008 R2 Standard Edition. I am trying to implement log shipping, but the log shipping option is not showing in the database properties window. The database recovery option is ...
0
votes
2answers
58 views

Restore Database with Multiple Restore commands

For automation, I have to dynamically construct the restore commands and thus I have created a script. A .bak file is created on a remote server and I receive it daily. The script builds the restore ...
0
votes
1answer
24 views

Replicating tables from LAN database to web server?

I have an in-house database (that's actually part of a third-party product) running on 2008R2 Express. We'd like to display some of the data on a new website we're working on (running 2008R2). I'm ...
2
votes
2answers
64 views

Using collate: When to use and when not to use

In one of my applications we had tsql like shown below SELECT DISTINCT [Dblist].[DbName] AS [DbName] FROM [Common].dbo.[Dblist] WHERE dbname not in ( SELECT [name] FROM ...
1
vote
2answers
150 views

Why can't I obtain OBJECT_NAME() for a temporary table?

According to this MSDN article http://msdn.microsoft.com/en-us/library/ms190328.aspx When a temporary table name is specified, the database name must come before the temporary table name, unless ...
2
votes
3answers
443 views

Run multiple stored procedures in sequence

I have a stored procedure written in T-SQL (SQL Server 2008 R2). It is a master procedure that essentially call multiple other subprocedures in sequence. The call and error handling is identical for ...
0
votes
3answers
94 views

index rebuild/reorganize frequency

I am a dba by accident. I am doing index rebuild/reorganize. I would love to use some scripts once I become comfortable doing these tasks. I did go through some of the forum pages regarding this ...
1
vote
2answers
65 views

Indexed views on double linked server

A server SERVER_A has some data. A server SERVER_B defines A as a linked server, and defines some views on the data. The queries are like this: CREATE view myview as select * from openquery ( ...
1
vote
1answer
136 views

“Could not insert a backup or restore history/detail record in the msdb database” While restoring msdb

Today I found msdb database was in suspected mode, so I restored MSDB from my latest backup(As I have daily backup for this database). When I restore the MSDB database using Tsql i got below errors, ...
0
votes
0answers
84 views

Problem with EXEC MyLinkedServer…sp_executesql within transaction

I rather clueless about this so any help is appreciated. We have got a stored procedure that is running within a transaction. The stored procedure is called from a .NET program (via normal ADO.NET). ...
0
votes
1answer
98 views

Best approach to have a Live copy of a table in the same database

I have a table where 15,000 to 20,000 rows are being inserted every hour. Table Schema is something like ColumnName DataType ID BIGINT IDENTITY(1,1) Column1 INT Column2 INT ...
5
votes
3answers
362 views

Parallel Plan Selection

I have a weird query plan problem. I have two databases (Let's call them DB1 and DB2) where both are sitting in the same SQL-Server instance and have identical schema. In there, we have a couple ...
3
votes
1answer
50 views

How to join by most recent preceding date?

Imagine I have a database with historic price data and a second table with dates Item | Price | Date Customer | Item | date ------------------------- --------------------------- ...
1
vote
0answers
68 views

The replication Merge Agent failed to propagate a Publisher schema change to the Subscriber

We are running 2 Microsoft SQL Servers - publisher (2008R2) / subscriber (2008 Express) with merge replication. I tried to make some schema changes via Transact-SQL and partly failed. So tried to ...
0
votes
1answer
72 views

If you schedule a TSQL Job in SQL Server 2008 R2 and additionally need to copy files with it, is it better just to use a script?

I noticed that alot of backup jobs are scheduled using SQL Server 2008 R2, but we have a system here at work that also requires the backup of a directory in addition to the database contents. I've ...
4
votes
2answers
437 views

Restored Database is different from the original

I have recently performed a restore of our data-warehouse staging database onto a separate instance in our dev environment. After the restore I did a comparison and it looks like the database sizes ...
0
votes
1answer
56 views

how to select top ID from join operation and staging tables

I have this inner join from staging and operations table jobsCode I want to select the top surrogate key ID and get the Start_Date from this join my problem is my Query rerunning 2 records original ...