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

learn more… | top users | synonyms

1
vote
2answers
558 views

SQL Server 2008 R2 recognizes a domain account as a SQL Server account

After migrating from SQL Server 2000 to SQL Server 2008 R2, we have a few domain accounts that appear to the new server as SQL Server accounts. These accounts can SELECT from tables in the database ...
6
votes
1answer
10k views

SQL Server 2012 performance v SQL Server 2008 R2

Does anyone have any links to performance benchmarking of the database engine, or any anecdotal reports of the performance improvements in SQL Server 2012. We are only using the DB engine,not ...
0
votes
1answer
2k views

Recover registered servers in SQL Server Management Studio 2012

My computer died so it's be reinstalled. Previously I had SQL Server 2008 R2 installed. On the new system I have SQL Server 2012. I have the old RegSrvr.xml file (that contains the list of ...
2
votes
1answer
2k views

Prevent a single query from hogging all resources

I have a production database server running SQL Server 2008 R2. How can I keep a user query on one database from hogging all the system resources and bogging down all the databases on the server? The ...
2
votes
1answer
517 views

SQL 2012: Import DB changes original data scheme

I'm migrating data from SQL 2008 R2 Servers to SQL 2012. Therefore I'm using SSMS Import Data Task on the SQL 2012 machines. As a test I copied the data files of one of the DBs, did an "Attach ...
3
votes
2answers
258 views

SQL database backups methods-tools-procedures

Currently, I am investigating some way to more efficiently backup 4 Production SQL Databases (3 different servers/instances) and would like to know if anyone else has had the problems we are having ...
5
votes
1answer
645 views

Custom aggregation for non-leaf level nodes to avoid double counting

I have a fact table with the following columns: WorkerName OrderId NumberOfPackagesPerOrder Note that neither WorkerName nor OrderId is unique in this fact table. Multiple users could work on a ...
1
vote
1answer
933 views

SQL Server 2008 R2 : multiple files and filegroup

I am getting bit confused regarding advantages of multiple files and filegroups in SQL Server Using SQL Server 2008 R2, I have following filegroups and files configuration Drive D: Primary Filegroup ...
3
votes
2answers
5k views

Create new function by code if it doesn't exist

I want to create new function by script in my database. The script code is below: IF Exists(Select * From sys.sysobjects A Where A.name =N'fn_myfunc' and xtype=N'FN') return; CREATE FUNCTION ...
5
votes
1answer
273 views

difference of left join and left outer join

In SQL Server join syntax we can use LEFT JOIN or LEFT OUTER JOIN and query result with each of above join not difference. this is a question for me that which are more useful.
2
votes
1answer
746 views

Cannot CAST '33.33' to INT

I have encountered a problem where the WHERE clause is causing a problem. The varcharColumn is of datatype VARCHAR and contains numbers as well as text. The query looks to be averaging this column, ...
1
vote
0answers
255 views

SQL Server 2008 R2 DeadLock on query Notification

for the first time, I'm running into a deadlock on ...The deadlock graph doesn't help me much except the fact the query notification system seems to responsible. <resource-list> ...
1
vote
2answers
266 views

Tools for Identifying Needed Indexes

I want to create the best indexes for each table in my database. Is there a query or tool in SQL Server to help with this process?
2
votes
1answer
271 views

Calculate number for each row

My table structure is below: CREATE TABLE [ACC].[Document]( [DocumentID] [int] IDENTITY(1,1) NOT NULL, [Date] [date] NOT NULL, [SalesCompanyFinancialPeriodID] [int] NOT NULL, ...
5
votes
1answer
541 views

Release SQL Server Memory usage

How can release memory usage of sql server by command. my system have 16GB RAM, but when get huge query by sql server, memory usage become full. if I restart SQL Server service memory usage become ...
3
votes
3answers
5k views

How to get last identity row Inserted when using instead of trigger

When I inserted on tables that exists instead of triggers on those. @@Identity , IDENT_CURRENT('Table') and SCOPE_IDENTITY() return null. How I can get last identity of inserted row
6
votes
1answer
1k views

Recursive CTE performance

Need help with recursive CTE performance. Below CTE is running very slow as it is trying to pull heirarchical data recusively. Table is big with every root id having upto 3 recursive itemid. There ...
2
votes
1answer
571 views

Ordering with custom paging when using pivot to convert a query

This is a follow up to my question on changing a flat result set into a different column set using Pivot. Scripts for test DB can be found in that link Ordering works just fine like this: SELECT ...
1
vote
1answer
598 views

How many files should I create for one filegroup and 9 weekly partitions?

I have 9 weekly partitions on one filegroup. How many files do I need to create? There are 3 tables containing 46 million, 16 million and 10 million rows.
5
votes
1answer
209 views

Electricity off while shrinking database, how can I recover my database?

While i execute shrink database, the electricity has been gone down, I can't access my database now, it is (In Recovery), how can i recover it?? Note: it is a very huge database: 25 GB. EDIT: My ...
28
votes
3answers
2k views

Unexpected scans during delete operation using WHERE IN

I've got a query like the following: DELETE FROM tblFEStatsBrowsers WHERE BrowserID NOT IN ( SELECT DISTINCT BrowserID FROM tblFEStatsPaperHits WITH (NOLOCK) WHERE BrowserID IS NOT NULL ) ...
2
votes
1answer
1k views

SSIS PL/SQL task hangs with message “Multiple-step OLE DB operation generated errors.”

I've configured a Microsoft SQL Server 2008 R2 SSIS package with an Execute SQL Task to run a PL/SQL query on an Oracle 10.2 database. The Execute SQL Task (named "SQL Update MY_STATUS flag") is ...
2
votes
0answers
342 views

What is causing all of the msrepl_tran_version columns to become out-of-sync between locations in transactional replication setup?

I have been having a recurring issue with transactional replication setups at the firm I work for. We use SQL 2008 R2. Seemingly without warning or any replication errors, all of the ...
7
votes
3answers
6k views

View delete statements in the Transaction log

Is it possible to view delete statements that have recently occurred in the Transaction Log?
4
votes
1answer
650 views

Does SQL Server evaluate functions once for every row?

I have a query like this: SELECT col1 FROM MyTable WHERE DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) BETWEEN col2 AND col3 ; This gives a tooltip on the execution plan ...
6
votes
1answer
3k views

Why does SQL Browser service get disabled?

I have an intermittent problem with a software installation package that installs our product (written using InstallShield/InstallScript). During the process of the installation, we restart the SQL ...
6
votes
1answer
414 views

Is there a way to DENY CRUD operations on connections from linked server?

I have a SQL Server instance, RPT1 (2008 R2), that was set up for "power users" to run their own queries. This server is linked to our production reporting server, PRD1 (SQL Server 2008 instance), ...
15
votes
2answers
3k views

Restore database excluding FILESTREAM data

Context We are developing a system with a large-ish database in the bottom. It is an MS SQL database running on SQL Server 2008 R2. The total size of the database is about 12 GB. Out of these, ...
2
votes
2answers
2k views

Replace cursor with set-based approach

I am looking to replace my cursor-based solution if possible in a particular stored procedure. If it makes any difference, this is running on SQL Server 2008 R2. I am looking more for an algorithm ...
2
votes
1answer
1k views

Connection to localhost dramatically slower than to network server

I have an Excel VBA application that connects to a SQL Server 2008 R2 database through ADODB. When I'm on the network at work, the connection is almost instantaneous. When I am at home working with ...
3
votes
1answer
420 views

Transaction log growing on a mirrored principal

I have a pair of SQL Server 2008 R2 servers hosting a synchronously mirrored database with no witness. This weekend, we had to do some network maintenance so I paused the mirroring. Upon resuming, the ...
3
votes
1answer
1k views

Where do I find the meaning of TdsInputBufferError numbers?

We are having some sporadic connection errors on some of our SQL servers. I did some searching and found out about the Ring Buffer in SQL 2008 R2 and found some information, but I am not entirely sure ...
8
votes
3answers
4k views

How to boost performance of virgin queries in MS SQL Server?

I have ASP.NET web site that does it's own independent caching of data and data does not change for long periods of time, so it does not need to query SQL Server second time with same query. I need to ...
4
votes
1answer
829 views

Mitigate negative effects of shrinking

Closely related to this question from a few weeks ago, but the answers didn't discuss how to do the dirty deed. Here's the situation: We now 15 GB data in a database, but a logging bug in an ...
0
votes
2answers
137 views

full outer join where join key in result always has value [closed]

I wish to do a full outer join between two tables A, B joining on A.ID = B.ID. Now, it is quite easy to include A.ID and B.ID in a result set. this will include rows where: A.ID is null, B.ID is not ...
-1
votes
2answers
379 views

Parsing a string result from a query

My sql server 2008 query returns a very long strings such as: GET ...
5
votes
2answers
272 views

Performing data update operations while backing up a large SQL Server database

I have a large (in the tens of millions of records) database that I am going to perform a full database backup on. However, the database is large enough that transactions can start before and during, ...
5
votes
1answer
1k views

SSAS Cube in Excel - Show only applicable rows with KPI?

I have a cube built in SSAS 2008r2. I'm exposing it for the moment through an excel PivotTable. I recently added a KPI to the cube, and when I show the KPI in my PivotTable interface it causes ...
3
votes
5answers
8k views

Convert varchar column to datetime

In SQL Server, I have a varchar column with value such as: 07/May/2012:00:06:22 07/May/2012:00:06:22 07/May/2012:00:06:22 07/May/2012:00:06:22 07/May/2012:00:06:22 QUESTIONS How do I convert ...
4
votes
1answer
378 views

SQL Server Partitioning - Parent / Child tables

I'm currently investigating implementing partitioning for a fairly hefty (800GB and growing) SQL Server database. All of the data in the tables is relatable to a date/time, however this date/time is ...
1
vote
2answers
677 views

Does Sql Server 2008 support Database Sharding

Does Microsoft support implementing Database Sharding using Sql Server 2008 R2 (any edition). From my limited understanding of it, I think, we could probably implement it using Sql Server Express. But ...
4
votes
2answers
2k views

Recover deleted records [duplicate]

Possible Duplicate: How do I get back some deleted records? Our C#.NET application mistakenly deleted all records from all tables of its database. The application automatically takes ...
2
votes
1answer
224 views

How to split tables without affecting all stored procedures

We have merge replication setup between corporate database and remote clients. Lately we realized that people working on the corporate server do not need data to be tracked by merge replication as ...
7
votes
1answer
822 views

Why does the order of parameters matter for sp_trace_create?

The first batch of the following script calls stored procedure sp_trace_create with parameters in documentation order; the second batch swaps the positions of parameters @tracefile and @options: ...
2
votes
2answers
216 views

Is it possible to retrieve the specific databases selected in a maintenance plan step?

I would like to use a tsql query to retrieve the databases involved in one of the steps in a database backup plan I've created. From a previous question, I understand that somehow, the data is ...
9
votes
2answers
364 views

Is there a set based way to load/read a tree branch with HierarchyId

I am playing around with HierarchyId, and I have not figured out a set based way to do the following: insert all subtree at once retrieve all subtree at once This question is related to my ...
5
votes
2answers
884 views

Error handling in container procedures

I'm aware of and use the techniques in this question. In my environment we have a lot of container procedures that call subprocedures, that may call other procedures, ad infinitum. For me ...
2
votes
1answer
63 views

SQL Server Cache population on server / service startup

We have upgraded our SQL Server instance with buckets of RAM, so it can now much more effectively cache . The issue is that it takes time (days) to populate the cache. As far as I understand this is ...
1
vote
1answer
242 views

I cannot write into SQL Server 2008 R2 express edition from C#

There is no error, the dataset is getting updated, but the database is not updated. I am using Windows authentication in connection string to the database. I have given accept changes on update.
4
votes
5answers
2k views

Automatically Execute Stored Procedure After Any RESTORE DATABASE Event

Is it possible to have SQL Server 2008 R2 Standard automatically execute a stored procedure in any given database that is restored or attachced to the instance? I've got close to a solution by ...