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

learn more… | top users | synonyms

4
votes
1answer
939 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
411 views

Parsing a string result from a query

My sql server 2008 query returns a very long strings such as: GET ...
5
votes
2answers
283 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
10k 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
399 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
757 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
3k 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
226 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
876 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
227 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
384 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 ...
6
votes
2answers
919 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
64 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
247 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 ...
3
votes
2answers
345 views

How do I count rows with two properties in one index scan in SQL?

I have a table Units where I have rows ItemId, ItemCreationDate, ItemUnitsCount. ItemId is a primary key and I have a clustered index over it. I need to output the following: for each day I need to ...
5
votes
2answers
3k views

Find the disk size of specific rows

I am trying to figure out the disk size a number of rows in various tables take up. I can define this rows by a query. How can I find out the actual disk size that corresponds to the result set in ...
9
votes
0answers
2k views

Deploying dacpac application to SQL Server 2008 R2 [closed]

I cannot get dacpac working on my installation of MS SQL Server 2008 R2. I am using Visual Studio 2010 Shell with MS SQL Server Data Tools to build a project into a dacpac file. However, when I try to ...
2
votes
1answer
952 views

Mysterious disappearing consistency errors in SharePoint DBs

We have a pre-production SharePoint SQL server which threw an 824 error yesterday evening on the Content DB. As part of my investigation today, I ran DBCC CHECKDB on this DB and it came up clean. ...
0
votes
1answer
85 views

Copy snapshot files from Publisher, Paste and Apply on subscriber in SQL Merge Replication

I read an excellent article about copying the snapshot files for Transactional replication from Publisher to Subscriber and Apply them on subscriber. ...
14
votes
1answer
1k views

Recalculate Time Dimension in BIDS

I'm using BIDS to create a cube in SSAS 2008 r2. I used the wizard to create a time dimension. Part of that configuration is selecting a date range. After creation, I realized that I needed a wider ...
1
vote
1answer
442 views

Microsoft SQL Server 2008 R2 Subscriptions

I have an installation of SQL Server 2008 R2. In the subscriptions section I do not see an icon or button to create data driven subscriptions; in the previous installation of SQL Server 2008, I do ...
5
votes
2answers
3k views

REBUILD - Clustered Index, TABLE, or both?

I'm having trouble finding a definitive resource on this anywhere, so hopefully a guru can give me an answer here. I have a very large table that we had to add a column to. The clustered index is ...
2
votes
2answers
168 views

Impact of using mirroring to migrate between SQL Server 2005 and SQL Server 2008 R2

I've got a DB which sits on a machine (SQL Server 2005) due for replacement very soon. I'm planning on having the database mirrored to the replacement machine (SQL Server 2008 R2) so that when the ...
3
votes
1answer
249 views

Why might a table scan have a huge I/O Cost?

I know that table scans are bad, and that every table should have a primary key and clustered index, but I'm wondering what might cause the spectacularly bad performance that I'm seeing below in SQL ...
2
votes
2answers
628 views

In trying to setup back up device, net use command throws operating system error 53 when passing in a unc

So I'm trying to use XP_CMDSHELL to set up my drive for using a backup. I already have the drive mapped, but per ...
1
vote
0answers
70 views

Drill down report links fall outside cell [closed]

Apologies for the vague title, not sure how to summarise the problem... I'm creating a dashboard report showing server state for a group of SQL servers, the problem is that the links for the drill ...
4
votes
1answer
2k views

Cross-database call fails in a job but succeeds in SSMS

I create two databases, a table in the second database and a stored procedure in the first database. The stored procedure cross-database accesses the table. I create a sql server login and I also map ...
2
votes
1answer
348 views

Not able to attach database file without transaction log file [duplicate]

Possible Duplicate: How do I attach a database in SQL Server? I lost the transaction log file. I tried re-attaching the data file without the log file, to create a new log file, SQL Server ...
5
votes
1answer
925 views

sp_ExecuteSQL, performance and table variables

Is anyone able to explain some behaviour I'm seeing with SQL Profiler? Taking the following two batches: exec sp_executesql N' declare @t table ( x int ) insert into @t (x) ...
4
votes
1answer
1k views

Exporting SQL Server 2008 R2 Activity Monitor Log

In SQL Server 2008 R2, admin users are allowed to view the Activity Monitor and under "Recent Expensive Queries", there is a list of SQL statements being ran on the server. Is there a way to export ...
4
votes
2answers
5k views

SQL Server 2008 R2 - Set tempDB size on full disk

One of my SQL Server 2008 R2 instances had a job that went mad last night, ended up with the job auto-growing tempDB until it ran out of disk space. To compound the issue I noticed that tempDB is ...
3
votes
1answer
1k views

CROSS APPLY-ing a parameterised function

Given the following definitions: CREATE TABLE MyTable ( col1 int, col2 int, col3 int, col4 int ) CREATE FUNCTION fn_MyFunction ( @Param1 int, @Param2 int ) RETURNS TABLE AS ...
1
vote
1answer
194 views

Choosing the right field data type in SQL Server 2008

I got a request to create a new table that will store certain information for customers. The definition of the table is somewhat irrelevant except for one field. This field will store ANSI characters ...
2
votes
2answers
3k views

Linked servers: Transaction context in use by another session

I'm using linked servers to perform some queries in a distributed transaction. It doesn't work in a distributed transaction. I get the following error: Transaction context in use by another ...
8
votes
1answer
511 views

Are SQL Server Database writes slower with Snapshot Isolation?

I have a lot of deadlocks going on in my system. I would like to use Snapshot Isolation to fix them, but my DBA has reserves about it. One of his concerns is that Snapshot Isolation slows down ...
1
vote
3answers
439 views

Checking if the query is made async or sync on SQL Server 2008 R2

I have tried to make async calls to my SQL Server instance as you may see on my SO post: ASP.NET MVC 4 asyncronous database call: never returns the HTTP response I did a benchmarking and the sync ...
3
votes
1answer
144 views

ProcessID Owner with third party app

I am having problems trying to audit a third party app with a SQLServer backend. The app manages users and user access via a SQL table, using a single SQL login to access the databases. I am trying ...
1
vote
1answer
108 views

Requirement of SQL Server 2008

The software I am installing requires SQL Server 2008. I have SQL Server 2008 R2 Express Version. I am having problem in the setup and finally I am arriving on the conclusion that my SQL Express can ...
1
vote
1answer
185 views

Recommendations on creating user-objects on system database

I want to setup a bunch of Event Notifications on SQL Server using Service Broker for our production database. I've setup a new database on my testing machine, and everything works well. The problem ...
1
vote
2answers
2k views

Adding Row Version to SQL Server table

I have a table in a database with three columns: ID, Key and Value. Everytime I update the record, I have a trigger that sends these updates to another table and creates a new record in it, who's ...
1
vote
1answer
467 views

Setting Alerts for Autogrow

Can I set alerts for an autogrow event in SQL Server (2005 or 2008 R2)? I've searched around and haven't found the 'error number' for autogrowth, if there is one. In case this isn't possible, how ...
2
votes
0answers
1k views

Copy database wizard between servers results in Access Denied error. [closed]

I'm trying to copy a database from SQL Server 2008 R2 to another server, using the Copy Database Wizard in SQL Server Management Studio. I get an error telling me to check the error log on the ...
4
votes
3answers
462 views

Does Snapshot Isolation only give you what has been commited? (And General Snapshot Isolation questions.)

So, I have some deadlocking issues. I have seen two options to resolve it. Add read uncommitted to my db or do Snapshot Isolation and add read committed snapshot. After doing some research into ...
3
votes
2answers
191 views

What is the signifigance of a fillfactor of 20?

I have a database for our ticket system in SQL Server express. I was poking around and noticed that a lot of the indexes have a fillfactor set to 20. What is the signifigance of it being set to 20? ...
10
votes
1answer
591 views

Behavior of data in indexes based on fill factor

Let's say you have a database where the default fill factor is 20. Whenever data is inserted, does it only create pages filled up to 20%? From my understanding, when the data is inserted there ...
1
vote
1answer
1k views

Rights needed to see database files in Properties dialog?

I have a contractor setting up a database application. The database is set up, the login for the app is set as the database owner, but has only 'public' at the server level. When the contractor logs ...
8
votes
1answer
2k views

Trouble With Database Permissions for sp_send_mail

I am trying to send database mail but I am getting EXECUTE permission denied on the object 'sp_send_dbmail' database 'msdb', schema 'dbo'.. I code I am running is as follows: SELECT SUSER_NAME(), ...