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

learn more… | top users | synonyms

0
votes
1answer
37 views

READ_COMMITTED_SNAPSHOT locking on Non-Clustered Index

I'm in big trouble with one database instance of SQL Server 2008 R2. I have this structure that I've created it to simulate my real problem: USE [sor] GO ALTER DATABASE [sor] SET ...
0
votes
1answer
30 views

How can I log the way in which a job was started?

Using SQL Server Agent, I've created a Job that runs some SQL. This SQL does some work on one database, then adds a row to a logging table on a separate database. The Job is run on a couple of ...
1
vote
1answer
23 views

Unable to view SQL Server services

Whenever I enter SQL Server Configuration Manager and choose SQL Server Services I would always get the following error message: "The remote Procedure call failed. [0x800706be]" everything else works ...
1
vote
2answers
36 views

SQL Server TempDB Growth issue

We have an OLTP database (running SQL Server 2008 R2) that has 6 tempdb files. All of them have an Autogrowth by 10%, restricted growth to 10000mb. At one point, someone changed one of the growths to ...
0
votes
0answers
29 views

why I can't delete old transaction log backup files with an existing scheduled job?

I have a job scheduled in my SQL Server Agent 2008 R2 that runs every 30 minutes, Its part of a maintenance plan that runs: A daily full database backups, differential every hour, and transaction log ...
1
vote
0answers
54 views

Odd Execution Plan

I have a table in SQL Server that is performing very slowly and I have been trying different indexing options to try to speed it up to no avail. I suspect all of the varchar(max) fields may be a ...
3
votes
2answers
46 views

What permissions should the account for MS SQL Server Agent have?

I'm in a situation where I need to change the account for the Server Agent of SQL Server from NETWORK SERVICE to an AD domain account. All I'm doing is making the domain account sysadmin in the ...
-3
votes
0answers
24 views

How to speed sql query during fetching data [on hold]

I have tired with client. Every time they reporting me, we are getting timeout in the report. This happens due to slow execution of SQL Query. I am using following things in query. using PIVOT Case ...
1
vote
0answers
29 views

Understanding “Date Last Modified” for “System Stored Procedures”

Whilst reviewing code on a SQL 2008R2 Instance I inspected the Date Last Modified of the System Stored Procedures of the databases. The ones in the DBO schema had a datetime that predates the ...
1
vote
1answer
43 views

Perfmon and SQL Server Clustering

I'll be going onsite to run some performance tests for a client. They have a Windows Failover Cluster, which has a clustered instance of SQL Server. Let's assume for this post that my client's ...
7
votes
1answer
96 views

SQL Server trace based on client TCP port

I have a Windows terminal server with many different users logging in via RDP to run an application. The application makes one or more connections per user to a SQL Server 2008 R2 instance. All users ...
2
votes
1answer
69 views

SQL User with only access to maintain indexes and statistics

I need to have an AD user account with access to all databases on a specific instance of SQL Server 2008 R2, and the only thing that user will be doing is; Reorganize indexes Database integrity ...
2
votes
2answers
78 views

Reviewing all code on a SQL Server Instance

Shortly our development team will be moving an existing SQL Server 2008R2 instance into our Production environment. Ahead of this I have been asked to review all the code on it for anything malacious ...
2
votes
0answers
49 views

SQL Server not starting at Windows startup but starts manually

My SQL Server instance's (SQL Server 2008 R2 Express) service has Startup Type = Automatic. The past couple of times I've restarted my computer the service has failed to start on its own, but it ...
0
votes
0answers
42 views

Splitting of database in SQL Server [closed]

One of our clients has a database larger than 3 GB and is facing performance problems. Sometimes applications will not only open because of heavy data load. How can I overcome this problem? If I ...
1
vote
2answers
100 views

Disabling certain steps in a job

I have a project coming this weekend where all the jobs has to be stopped but only 1 step in a particular job has to be run. for eg: i have a a 2 step job and the second step must run and the first ...
0
votes
1answer
25 views

SQL Server, firewall and linked servers

I have: SQL Server 2008R2 database server in my LAN and under my control (call it LOCALSQL) remote SQL Server, on which I have much less control (call it REMOTESQL), for which I only have IP, ...
1
vote
1answer
18 views

Separating system databases from MDW SQL Server 2008 R2

We have the Management Datawarehouse feature configure on two of our SQL Servers. Both point to the same central database and upload their results to it. Everything works fine with the built in ...
1
vote
0answers
12 views

update new ID_MergeTo from operation table ID if MergeFlag is true and MergeTo defined?

I have problem I don't know how to solve it. I have two tables Staging and Operation.I create Data Flow Task using SSIS to move data columns from ...
0
votes
1answer
33 views

Missing Database Mail Configuration Wizard in SQL Server 2008 R2

I was able to verify that Database Mail is installed and running but when I expand the management folder there is no Database Mail Configuration Wizard.
0
votes
1answer
31 views

How to delay replication start

I'm creating a new publication for replication using the @allow_initialize_from_backup option to avoid the snapshot immediate creation and therefore locking all objects replicated on articles. The ...
3
votes
1answer
75 views

Total Fragments 99% and I cant get it to stay down [on hold]

I have a SQL Server 2008 R2 database it is of size 13000.31 MB and my largest table has around half a million records. It is a database that I have bought. It already has indexes but when I run the ...
1
vote
2answers
63 views

How to make sqlcmd return an ERRORLEVEL other than 0 when the .sql script fails?

I'm running sqlcmd from a batch file and I was wondering how to make it return an ERRORLEVEL other than 0 when something goes wrong with the backup.
0
votes
1answer
32 views

SQL Server: compare names ignoring non-alpha

I have a database table with a text column "title". New rows are inserted all the time, and every time I would like to check for potential duplicates on this column. I define duplicate by "having the ...
1
vote
1answer
36 views

Dynamic Number of Columns in Pivot Table

I have a table to store StudentID, SubjectID, ObtainedMarks. Now I have to create a pivot table to show studentID and obtainedMarks in different subject. Number of subject may differ. I could generate ...
4
votes
2answers
101 views

SQL Server cluster resource won't come online unless its on port 1433

The 2-node SQL Server 2008 R2 cluster works fine until one of the resources got removed. I successfully added it back. However, the cluster is not able to online the SQL Service unless it is on 1433 ...
4
votes
1answer
96 views

Find reason long running stored proc SQL Server

I have a stored proc which is called every 2.5 seconds by a program, 24-7. This proc normally runs under the 10 milliseconds. A few times a day (3 -5 times) it takes around 42953 milliseconds to run ...
2
votes
0answers
31 views

Unable to Update on SQL Server 2008 R2

This is a bit strange so bear with me please. After installing a new SQL Server 2008 R2 on a new server (Windows 2012 Standard) just like the production one, I tried to connect my web aplication ...
2
votes
1answer
151 views

Why dropping all foreign keys from a script is not working? [closed]

I have sysadmin rights on a SQL Server 2008 R2 box. I found a script that can drop all foreign keys and re-add them for us when we need to after a testing import. So I execute the below code with no ...
2
votes
0answers
93 views

Why does a simple select query produce a deadlock?

I am trying to analyze randomly occurring deadlock problems on an SQL Server 2008 R2 database. The deadlocks occur in very rare cases when SSRS tries to access one of 5 different stored procedures. ...
1
vote
2answers
38 views

Single Virtual Drive Vs Multiple Virtual Drives for SQL Server files

Hi guys I have question about how two different Hard disk setups can possibly affect performance of my database. I have two Options. Option 1: One Physical Harddisk and then Multiple Virtual hard ...
1
vote
1answer
89 views

Removing secondary data files. DBCC SHRINKFILE: Page could not be moved because it is a work table page

I have too many secondary data files (.ndf) created for tempdb. To remove the excess files, I need to empty the file (content will be moved to other files): DBCC SHRINKFILE('tempdbfile8', EMPTYFILE); ...
0
votes
0answers
17 views

Run a script before UnitTesting

The Test Initialize script in the SQL Server Unit Tests runs before each test methods and Test Clean up runs after each test methods. So for example I have this structure UnitTests -- Main ...
1
vote
1answer
159 views

What is the possibility that mirroring a database will damage, corrupt, or erase either the primary or target database? [closed]

The last time my company had tried to mirror some databases, everything worked great until one morning they came in and the primary database in one of the mirroring schemes was just blank. They had ...
2
votes
0answers
57 views

Implementation of SSL ON SQL SERVER DEFAULT INSTANCE

We've purchased an SSL certificate for our Server with a specific CN and implemented the certificate on IIS. We imported the same certificate on the SQL Server machine. However, when trying to ...
4
votes
1answer
49 views

Encoding Debug UTF8 & Latin 1

We have on our DB some international people that got some characters saved incorrectly on our DB (MS SQL-Server 2008 R2). For example we have strings like 'WilcoxonÃ'. We got this data into ...
0
votes
1answer
25 views

SQLCMD - add date to CSV. When run inside Command Prompt it works, when in Job then %date

I've been battling for hours to add a date to a CSV name: For brevity, Im just taking the first character of the date here. In SQL Command, this works: sqlcmd -S localhost -d master -E -W -w 999 -s ...
0
votes
1answer
44 views

Find Without primary key Table in SQL Server 2008 R2? [duplicate]

This is my query to find out primary key, foreign key in SQL Server 2008 R2: select * from information_schema.table_constraints where constraint_type = 'PRIMARY KEY' Know I need to select without ...
1
vote
0answers
39 views

What will do After Press F5? [closed]

select * from Employee; Name id Col1 Col2 Row1 1 11 1 Row2 2 12 3 Row3 3 13 30 Row4 4 14 44 Above is my table After PRESS F5 What process is running in Background ...
9
votes
1answer
144 views

Can you use COUNT DISTINCT with an OVER clause?

I'm trying to improve the performance of the following query: UPDATE [#TempTable] SET Received = r.Number FROM [#TempTable] INNER JOIN (SELECT AgentID, ...
0
votes
1answer
33 views

SSMS 2008 / 2014 showing different values for TempDB file sizes

Here's a fun one. Last week I reconfigured the initial file sizes in our tempdb database to 1GB each. We had an event a few weeks back that locked up our server due to a table with no indexes ...
2
votes
1answer
46 views

SQL Server 2008 R2 - remove line below heading (which has ----,----) - dont have SSIS

I have found this line of code online sqlcmd -S localhost -d master -E -W -w 999 -s "," -Q "SELECT D.* FROM sys.databases D" -o "C:\sqlcmd.csv" This is used in a SQL job, to export to a CSV file. ...
0
votes
1answer
85 views

Duplicate login details per user in SQL Server 2008 R2 Error Log

Being able to view details of who successfully logs into a database and which user's login failed via the error logs is a good thing. However i have a scenario that i need help with - for some reason ...
0
votes
1answer
52 views

How can I reseed all identity columns?

I deleted all rows from 20 tables after disabling the constraints, triggers using the stored proc SP_MsForEachTable. Now before the import happens, I need to reseed all the identity columns back to ...
0
votes
1answer
44 views

I see a constraint in my table thats not in INFORMATION SCHEMA?

When I expand the database "Constraints" object, I see 2 of them named DF_DocumentD_Docum_3F466844 and df_documentdistqty, but when I select to view everything from the "Information Schema.TABLE ...
1
vote
2answers
44 views

Merge Table Row Values to Header of Another Table

Table 1 id | Field | Values ---------------------------------------- 1 | 'Field01' |Name 2 | 'Field02' |Age 3 | 'Field03' |Gender 4 ...
0
votes
0answers
41 views

Why would call to scalar function inside a Table Value Function be slower than outside the TVF?

I am writing a Table Value Function, calling the function takes 10x as long as directly running the code. I traced this to a call to a multi-line scalar function inside the TVF. The call to the ...
1
vote
1answer
24 views

Print, transaction and cursor performance in Transact-sql

I'm having some performance issues when I run a script. I was reading about the problem with print and its performance, but I cannot figure out how to reduce the impact. The algorithm is O(n^2). The ...
1
vote
2answers
44 views

How can I generate an .mdf file containing a subset of my tables and rows?

I need to provide some data to an organisation (lets call them DataCo) that we're working with. Since we're both SQL server shops, my counterpart at DataCo requested an .mdf file. However, our ...
2
votes
2answers
95 views

CHECKDB fails on MSDB and Master system databases

I get the following error within my maintenance plans: Executing the query "DBCC CHECKDB(N'master') WITH NO_INFOMSGS " failed with the following error: "The database could not be exclusively ...