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

learn more… | top users | synonyms (2)

0
votes
0answers
450 views

incorrect value from SUM Function

Has anyone seen this before? When doing a simple sum on a table: select sum(column) from table where column is not null I'm receiving the data 1558.39999999999 However, investigation of the ...
0
votes
0answers
228 views

SQL Server 2008 single-line PIVOT/UNPIVOT combo

I have a request to get information from a table with a stored procedure that shows all the necessary data for in one line. This table includes a hierarchyID, so I am trying to use the HID methods in ...
1
vote
2answers
128 views

Backing up my SQL Server System Databases

I'm trying to create a recurring scheduled job to fully backup the master, msdb and model databases, I'm using the Maintenance Plans for SQL Server 2008 R2, in the "Specific Databases to choose from ...
0
votes
2answers
980 views

How can I speed up this query on table with 65 million records

select hash_id, hash_value, substring(T.cri, 1, 7), substring(T.cri, 9, D2.Pos-9), substring(T.cri, D2.Pos + 1, D3.Pos - D2.Pos - 1), ...
10
votes
1answer
207 views

How can I interpret the results of these DMVs to help me evaluate our partitioning strategy?

Version: SQL Server 2008 R2 Enterprise Edtn. (10.50.4000) In attempt to evaluate our partitioning strategy, I wrote this query to get the access methods against indexes on partitions (in the broadest ...
0
votes
1answer
102 views

Rebuild Index in system database

I use SQL Server and have multiple indexes in system database whit index fragmentation 30% or more. I don't know that SQL server manage system database index automatically or I want to manage them. ...
1
vote
2answers
79 views

Known vulnerabilities for when a guest executes a stored procedure on SQL Server

I have a production database with crucial business information. Meanwhile, my company is involved in a project with some other company and we have to exchange some information on a regular basis. How ...
2
votes
1answer
50 views

Transaction Log Backups on SQL Server

Running SQL2008 R2 SP2, database is in FULL Mode Is it Possible to shrink the transaction log without putting it into SIMPLE mode? Temporarily cannot take log backus and don't want it to grow until I ...
3
votes
1answer
733 views

How to pinpoint root cause of excessive log file growth

The log file stays pretty small (~500MB) until about 11PM, and at that point it begins growing until no disk space is available. The log file reached it's maximum size at 12:39AM, so the growth took ...
0
votes
4answers
1k views

What can cause Reads to slow down on SQL Server 2008R2?

Our primary DB is 15GB in size. The server has 16GB of RAM. We are using the simple recovery model. Lately we've noticed that our custom apps lookups - just basic reads with adhoc SQL statements - ...
0
votes
1answer
8k views

How to convert sql server table data into MS Access(.mdb) file

I have SQL Database table with 6664055 rows, I want to convert this SQL Server table data to MS Access format(.MDB), How Can I do this?
3
votes
1answer
87 views

Count Data on Third Table Through Link

Suppose I have the following three tables: SupportTicket, Device, and Link. I've created these in SQL Fiddle. I want to display a list of support tickets within a time range that meet specified ...
0
votes
1answer
31 views

JOIN correctly no matter which end is linked [closed]

Suppose I have the following two tables: SupportTicket and Link. I also have other tables that Link can connect between. I've created these tables and a hypothetical third table that can be linked to ...
12
votes
1answer
612 views

SQL Server 2008 R2 index rebuild fails with severity 17

Occasionally during our index maintenance, the job will fail with a SEV 17 error where enough space can not be allocated for the object it is rebuilding. The database is laid out as such: Data_file1 ...
0
votes
1answer
308 views

SQL Server 2008R2 - Stored Procedure with 2 updates causing deadlocks

I have a web api web service that calls an authentication stored procedure. This stored procedure calls a different stored procedure that does 1 update: UPDATE ...
4
votes
1answer
153 views

Drastic performance difference in View Dependencies between SQL Server 2005 and 2008 R2

Background I am a fledgling DBA who was hired in the middle of a migration from SQL Server 2005 x64 to 2008 R2 x64. We also migrated from a local server to a colo virtual server, and moved some of ...
0
votes
0answers
165 views

How to configure log shipping in SQL Server 2008 R2 Standard Edition

Could you please guide me on how to configure log shipping in SQL Server 2008 R2 Standard Edition for same hostname with two different IP's. (Primary and Secondary server) example: Primary machine ...
0
votes
0answers
26 views

SQL Server query used new index until this morning [closed]

I created an index yesterday to fix a slow query where it was spilling into TempDB, this worked great and we had the best performance we have seen in a while, till this morning, now the query is using ...
4
votes
1answer
617 views

Deleting Rows is Increasing Index Size

We have a very large table in a SQL Server 2008 R2 Standard server which I am archiving rows by copying them into another database on a separate disk and then deleting them from the original table ...
-3
votes
2answers
1k views

How to calculate the hours worked by all employees in a day? [closed]

vinay_hours id cico 1 2014-02-20 10:31:00.503 1 2014-02-20 13:00:00.503 1 2014-02-20 15:31:02.503 1 2014-02-20 19:00:02.503 2 2014-02-20 10:00:02.503 2 2014-02-20 18:31:02.503 expected ...
0
votes
2answers
3k views

how to store multiple value in column in sql server [closed]

I am creating job post application. In my first table the columns are This is my master table ID Position jobDescription minExp maxExp LastDate InterviewDate Project HiringManager interviewer ...
3
votes
1answer
289 views

Are there reasons to not use SCHEMABINDING on database objects?

Not using schema binding seems like turning off compiler warnings - you don't find out you broke something until runtime. The benefit is that schema bound objects protects the database from ...
1
vote
1answer
439 views

CASE statement is returning different results within a COALESECE than it does outside it

We're using SQL Server 2008 R2 with database compatibility set to SQL Server 2000, and I've got a table with a few rows from which I'm assigning values to multiple variables. I'm looking to switch ...
3
votes
0answers
3k views

Getting “Attempt to fetch logical page in database” error when running query [closed]

When I run queries from one of my tables I get an error Msg 605, Level 21, State 3, Line 1 Attempt to fetch logical page (1:8687634) in database 7 failed. It belongs to allocation unit ...
7
votes
1answer
2k views

Free space of mdf and ldf does not match with database free space

In SSMS I saw file size related properties and found below details for one database. Here values does not match with other properties. Here size of the mdf, ldf and total size matches with other ...
2
votes
1answer
287 views

Is it possible to replicate wide table in MS SQL?

The reason of me using sparse columns is to overcome limit of 1024 columns in a table (I know that generally it's not a good reason and there are downsides, but in my situation it's good option ...
0
votes
1answer
1k views

HierarchyID--multiple root values in one table

Currently I am trying to work my way around the HierarchyID concept in order to convert a few tables for our programmers. I have the gist of it understood, but one of the cases I'm working on has me ...
1
vote
1answer
747 views

SQL Server 2008 mirroring migration to SQL Server 2012 always on

Quick question, request your input. I am migrating a SQL Server 2008 R2 instance with database mirroring to SQL Server 2012 with always on. Should I : Restore the SQL Server 2008 R2 backup to SQL ...
3
votes
2answers
2k views

Grouping by date range in a column

I have a table with data as: ID Action Date 1 Action1 2014-01-20 2 Action1 2014-01-22 3 Action1 2014-01-28 4 Action2 2014-01-20 5 Action2 2014-01-22 6 Action2 ...
0
votes
0answers
33 views

Post Database upgrade on new instance [duplicate]

I reviewed the SQL Server 2012 technical upgrade guide and also googled for more recommendations. I am migrating a SQL Server 2008 R2 instance to SQL Server 2012 on a separate machine. Here is what ...
1
vote
1answer
687 views

Free space from image column after update

I'm doing some cleanup on one of our database for development purposes on a test server. There are a couple of tables with one IMAGE column. Both tables take roughly 50Gb of space, being the image ...
5
votes
2answers
147 views

Why is an entire index that is infrequently used stored in the buffer pool?

I have been looking at the memory usage of a server and noticed something odd when drilling into the details. One index is eating up ~15GB of the buffer pool. That happens to be the size of the entire ...
1
vote
0answers
507 views

Error: 18456, Severity: 14, State: 11 [closed]

I have a brand new server (VM) just built. I installed SQL Server 2008 R2 and applied SP2. I opened an RDP session in console mode as myself. During installation I had the Windows AD group for the ...
1
vote
1answer
121 views

Create database before restore multiple files

I've several database, most of them have multiple files (both data and logs) and multiple diff and trn backups. I've already a restore script (scheduled and working on other server) that takes all the ...
3
votes
2answers
15k views

How can I dynamically alias columns?

I have a table (not designed by me) which has 20 variably named columns. That is, depending on what type of record you are looking at, the applicable name of the column can change. The possible ...
3
votes
1answer
459 views

Most efficient queries on flags in TSQL: bit field or table join?

Looking for the most efficient database structure for selecting rows from a large table based on one or more true/false values. For example, whether or not a user has opted in to marketing ...
3
votes
4answers
11k views

Changing IP address of SQL Server 2008 R2

I would like to know if there are any dangers or relevant precautions before changing the IP address of a SQL Server 2008 R2 box. We have a built a virtual PC with Windows Server 2008 R2 and SQL ...
1
vote
0answers
95 views

SQL Server replication - recommendations for stability

We have two SQL Server 2008R2 Standard servers, and we've set up replication of a single database between them. The replication is about as simple as it can get - it's a transactional replication from ...
0
votes
1answer
247 views

Unable to re-install an instance using the original instance name

We are trying to uninstall and re-install a 2008R2 instance. We have uninstalled the database engine but when we tried to re-install it we got the error "Original instance id\name in use". The ...
1
vote
1answer
498 views

Can I alter a view being referenced with schemabinding if the change fulfills the binding requirement?

In SQL Server 2008, I have views WITH SCHEMABINDING and I need to alter one. I am changing a column while not changing its alias so consumers will be unaffected. If I were to drop all my other views ...
1
vote
0answers
307 views

Timeout while using table valued parameter

I'm trying to find the cause for this error while calling a stored proc with a table valued parameter: Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target ...
2
votes
1answer
59 views

Single statement or batched delete?

I need to delete 6.3 million records from 25 tables in production. I have the following two queries, but I don't know which one will be best: delete jc from Jtable jc join J1Table j on j.JobId = ...
3
votes
2answers
45 views

Is my Publisher database my actual source database or is it a new database?

I am setting up transactional replication for the first time and am working through my backup policies I need to set. Is my Publisher database my actual source database? Or is it a new database that ...
1
vote
1answer
83 views

Return value formatted similar to if casted as money

My client's system is very outdated, and there is nothing I can do about it. What I'm trying to achieve is to extract values always with at least 2 decimal places. E.g. From 1826.5695600000 ...
0
votes
2answers
1k views

Can SQL Agent job notifications be sent to one operator for success and another for failure?

We have a requirement that some people are sent notification on success, and other on failure. But the UI seems to only allow a combination of 1 operator + 1 condition. So I was wondering if we ...
7
votes
2answers
437 views

Should I nest dependent outer joins in SQL Server?

I have heard mixed information on this and am hoping for a canonical or expert opinion. If I have multiple LEFT OUTER JOINs , each dependent on the last, is it better to nest them? For a contrived ...
2
votes
1answer
158 views

Turn Off Alerts

We have a SQL Server 2008 R2 database instance running on a VM. Nightly, between 10p and 12a, we are getting the following error message: DATE/TIME: 2/3/2014 10:16:37 PM DESCRIPTION: Database ...
2
votes
1answer
217 views

Copy FileGroup to Another FileGroup

we run Microsoft SQL Server 2008 R2 on production server. We need create new tables and load a big amount of data on them (roughly 1 TB!) I am wondering if it is possible to insert this dataset on ...
1
vote
1answer
381 views

Linked Server - login trying to access database that is not default

Trying to create a linked server from server A (2005) to B (2008 R2). Everything worked when created. The login on server B was mapped to two databases: DataBase1 and Database2. Database1 was the ...
6
votes
3answers
1k views

Cube processing either takes too long or fails

I have a SSAS Cube with 35 dimensions and 10 measures. Some of the dimensions are quite large in size. In almost all dimensions data either get updated and inserted. Measures have high volume of ...