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

learn more… | top users | synonyms

0
votes
0answers
55 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
39 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
61 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
149 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 ...
1
vote
0answers
69 views

MYOB ODBC crashes SQL Server

A sister company of ours uses MYOB AccountRight Enterprise and has the read-only ODBC license available. The thing that is annoying them the most is what apparently annoys many a MYOB user: its ...
4
votes
1answer
318 views

Sql Server - Select while insert on another transaction gives unexpected results

I stumbled at situation that changes my knowledge about transactions and locking fundamentally (I don't know much though), and I need help to understand it. Let's say I have a table like this: ...
0
votes
0answers
43 views

Find all possible combinations for each group [duplicate]

I have a table like as: ________________________ |ID| Table1ID| Table2ID| |1 | 1 | 1 | |2 | 2 | 1 | |3 | 2 | 2 | |4 | 3 | 1 | |5 | 3 | 2 | ...
0
votes
1answer
61 views

how to restore?

I am not sure if this has been addressed already. I have been a long time reader but this is my fifth post. I need assistance with a database restore solution. I receive a full BAK and the transaction ...
0
votes
1answer
41 views

Does SQL server 2008 log instance level security permission changes

I just recently logged onto one of our Test environments to find i did not have permissions, turns out my instance security Login had been disabled I have a feeling towards whom may have done this ...
2
votes
3answers
53 views

Monitor SQLAgent

I detected that SQLAgent was not running on one of our servers due to a unexpected memory leak error that caused SQL Agent to shutdown. There were not alerts configured so one main job that was ...
0
votes
1answer
72 views

Attempt to add DQS Cleansing Connection Manager to SSIS results in error

I reopened an SSIS project in SSDT-BI (with VS2013 Shell) which had been dormant for ~3 months to see the dreaded red "x" had appeared on my DQS Data Flow Component: I attempted to replace the ...
0
votes
2answers
48 views

Triggers not reflecting on procedure

I have a trigger create trigger flightinput2 on reservation after insert as begin update reservation set Departure_Airport='LDN', Arrival_Airport='KUL' where Flight_Code='EM0088' end ...
1
vote
2answers
403 views

How do you create a job in SQL server 2008 R2 that will clear transaction logs?

I have created a maintenance plan in SQL Server 2008 to delete transaction logs backups older than 3 days. Every day I look in the folder designated and the logs are still there. The job states it has ...
-1
votes
1answer
34 views

Issues with procedures, setting multiple values [closed]

I am trying to set multiple values but I am only able to set one value. This code fails: alter procedure modifyvalue @ID int, @flight varchar(6), @destination char(10) as begin update ...
7
votes
1answer
128 views

Lower performance on newest servers

We have several db servers on production, 4 of them with very similar hardware configuration. Dell PowerEdge R620, only difference is that 2 newest ones (bought and configured 3 months ago) have RAID ...
0
votes
1answer
53 views

Accessing Master database data into my database table

my database name LCMC i put a trigger on one table on update. and i want to insert the last 15 executed queries into a table. last executed queries are in the MASTER database as SELECT top(15) ...
1
vote
1answer
86 views

SQL Server 2008 R2 on production — is it worth to upgrade to SP1/SP2

One of my company's mission-critical database is running SQL Server 2008 R2. SELECT serverproperty('ProductVersion') returns 10.50.1600.1. So, yeah, RTM. Now, long story short, this database is not ...
0
votes
0answers
543 views

SQL Server 2008 R2 backup fails to restore on SQL Server 2008 R2 SP2

My DR SQL Server got automatically updated by Windows update from 2008 R2 to 2008 R2 SP2 and since then I can't restore backups from my production machine which is still on 2008 R2. 10 percent ...
2
votes
1answer
753 views

Join tables in two databases make query slow? is better to partition db?

I have a table1 in db1 and table2 in db2 on SQL Server 2008 R2. If I make a select query joining both tables, it's really slow to get the results. A simple query like SELECT * FROM db1.dbo.table1 ...
1
vote
0answers
41 views

Low batch Batchrequests/sec

I am running this query to do massive deletion in my database. I am looking at Batchrequests/sec and it is quite low (like 15% of what my server can handle) Is there any way to rewrite this query to ...
0
votes
0answers
495 views

Login failed for user 'x'. Reason: Could not find a login matching the name provided

I get this error Login failed for user '****'. Reason: Could not find a login matching the name provided. [CLIENT: 10.4.3.5] Right around 3 AM ish but the application connecting to sql server ...
0
votes
1answer
239 views

Pivoting some row data into columns (SQL Server 2008 R2)

Sorry if this has been answered before but I'm exhausted and on a time line. Maybe I'm just an idiot. I'm designing a data export from One application to import into another. Full-Disclosure: I did ...
1
vote
1answer
65 views

Am I using the correct data types on SQL Server side to call an Oracle 10g function?

When calling an Oracle function with the following in parameter types NUMBER(7,0) VARCHAR2(8 BYTE) VARCHAR2(4 BYTE) DATE and return type NUMBER(14,5) from SQL Server 2008R2 via a linked Oracle ...
0
votes
2answers
728 views

Reducing database size to restore to SQL Server Express

I have a SQL Server 2008 R2 database, about 15 GB. I want to copy it for a partner, who is using SQL Server 2008 R2 Express. I deleted many tables and rows, and now I am sure that the data is ...
0
votes
0answers
50 views

table check constraint, greater than > not accepting

CONSTRAINT CK_BABY_YOUTH_CHILD CHECK (case when Passenger_Type='Baby' then Reference_ID >=0) This is my table check constraint, i have no idea why sql server is not accepting ">". Please ...
2
votes
1answer
130 views

How to find number of days since beginning of fiscal month?

This relates to my question How to find XXth day of previous month in SQL server? The fiscal month starts on 26th of each month. I need to find out from any date: The date of the start of the ...
2
votes
3answers
248 views

Using expressions in the SELECT list to thin down a CASE statement

I have a query I'm working through rewriting - it has a huge bunch of case statements in the select list that all basically look like this: select Column1 = case when (Something = 2) and ...
0
votes
0answers
52 views

Installer Error while Installing SQL Server Reporting Services

I have a Windows 2008 R2 Server 64bit, I have already installed SQL Server 2008 R2 SP2 64bit Enterprise Edition, Which is working fine, without any issues. Now when I am trying to install Reporting ...
0
votes
1answer
124 views

Lost DMK encryption password for master database

Back story: My company has TDE encryption enabled for some of our databases. The password that the master key was encrypted by for one of our servers is lost. We do have the backup .key file, however, ...
3
votes
1answer
252 views

How to find XXth day of previous month in SQL server?

I have 2 parameters, an input date (DATETIME) input day of month (TINYINT) If I enter 11 MAR 2014 as the DATETIME and 26 as the input day of month, I would like to select 26 FEB 2014 as the ...
2
votes
0answers
74 views

Avoiding Functions() in the Where clause

Okay, while analyzing queries against a SQL Server 2008 R2 database, I happened upon the following query: (@p__linq__0 nvarchar(4000)) SELECT TOP (1) [Extent1].[OrderSOId] AS [OrderSOId], [Extent1] ...
2
votes
2answers
61 views

Specific user can't view database contents

I have a particular user, let's call it TheUser. This user is able to connect to my SQL Server instance and view a list of the databases. However, upon expanding a database to view tables, stored ...
0
votes
1answer
59 views

How to identify unused tables

We are planning to merge 2 or 3 region databases who are using almost the same version of SQL Server 2008 R2, have exact tables and most stored procedures for our end users reports.. in the process, ...
1
vote
2answers
99 views

Is there a more efficient way to run this query for first/max transaction?

For each account, I need the first transaction date, the largest transaction amount, and the time taken to get from first to largest. Data is truncated and reloaded frequently, and I have read-only ...
-1
votes
1answer
57 views

Does changing the collation of a column change TIMESTAMP (rowversion) values?

I need to run ALTER TABLE ... ALTER COLUMN ... COLLATE Czech_CI_AS ... for multiple columns in a database. All those tables have TIMESTAMP column which is used for database synchronization. Will ...
1
vote
2answers
100 views

Reduce space used on C drive

I have installed SQL Server 2008 R2 on my laptop, under 32-bit Windows 7. The SQL Server installation is using approximately 30GB of space on my C: drive. Why is it using so much space, and how can I ...
1
vote
1answer
67 views

Slow SQL Server authentication, but fast SAN, fast querying?

I am asking you after days of research but I think I don't have required skills to understand what is happening. I have a slow authentication on a SQL Server 2008R2, which leads to a timeout for the ...
2
votes
1answer
91 views

Finding rows with duplicate values

I have a one to many relationship between the Account table and a ScheduledPayment table. One account can have many payments but there should be a maximum of one payment per day. Although unlikely, ...
0
votes
0answers
55 views

Python - ascii encoding error when updating field content in SQL Server table

I know there are plenty of posts and blog explanations about unicode errors, but I still can't figure out to handle it in my particular case. I've already asked this question on GIS.StackExchange but ...
1
vote
2answers
98 views

Trying to filter msdb..sysjobs by job_id

I'm attempting to determine the name of the SQL Server Agent Job that is currently running by comparing the output of master.sys.dm_exec_sessions.program_name to msdb..sysjobs.job_id I'm using the ...
0
votes
0answers
44 views

Unknown Error when attempting to run Import Data wizard

In SQL Server Mgmt Studio, when right-clicking on a database, choosing Tasks and selecting Import Data, we receive the below error message. Any idea what might be causing this? We are running SQL ...
-1
votes
1answer
35 views

Displaying records in a SQL Server #temp_table [closed]

what's the select query syntax for displaying the content/records in a #temp_table on a SQL Server
0
votes
2answers
273 views

SSIS Package truncation and possible data loss (error code: 0xC020901C)

Good morning all, It's been 2 days now trying to figure out how to solve this issue, still no answer. Maybe you can help me out. Here is the thing. I have created an SSIS package to import data from ...
3
votes
1answer
111 views

SQL Query Optimizer - how does cost vary with resource availability

When the query optimizer calculates the cost of an execution plan, can you expect the plan to differ depending on the amount of resource available to it? Take the following scenario: You have a ...
1
vote
1answer
64 views

Cursors and concurrent users

I typically avoid cursor operations like the plaque, however, I have come across my first problem where using a cursor outperforms a query. So I am forced to use it. I have created an elaborate ...
1
vote
1answer
33 views

Change Data Capture missing changes for a specific record

I have enabled CDC in SQL Server and it generally works well but sometimes the changes are not recorded for some reason. And only for a couple of records. But then if I issue an UPDATE from SSMS, the ...
1
vote
1answer
74 views

Linked Server using ODBC too slow

The scenario is that developers used a linked server object on ServerM to reach ServerST. This linked server was setup as a "SQL Server" type using a domain login that exists as a login on ServerST. ...
2
votes
1answer
120 views

Scripting a maintenance plan

I created a maintenance plan for my SQL Server 2008 R2 using SQL Server Management Studio (SSMS). However, I am unable to export/convert it to a script, in case I need to redo it on another server. ...
1
vote
1answer
117 views

Restoring a database, changing recovery model

I regularly make a backup of my production database, then restore the same onto a test database, so developers can always have recent data for testing. The production database uses full recovery ...
0
votes
1answer
631 views

Why straight SQL query run faster than stored procedure?

I am facing-out a very surprising problem in SQL Server. The problem is when the query run in SSMS window it will return result in ~1 sec and when the query run through a stored procedure it will ...