SQL Server 2005 (major build version 9.00.xxxx). Please also tag sql-server.

learn more… | top users | synonyms (2)

0
votes
0answers
1 view

sp_procoption seems to be failing on SQL 2005 instance

We have a SQL script that creates a Stored Procedure which is responsible for creating a SQL trace. On SQL Server 2008, the script runs fine, the SP gets created and the SP is configured to ...
4
votes
1answer
130 views

Actual Number of rows is too high even with new tables

I have a query based on two newly created tables in SQL Server 2005. I have index created on these tables. But when I write a query with JOIN condition, the number of actual rows returned is too high ...
2
votes
3answers
66 views

TSQL for “Ignore databases were the state is not online”

I have a few custom jobs on a mirrored SQL Server 2005 and they fail from time to time because of automatic failover. Is there some T-SQL code that I can write into my automated jobs or do I just ...
2
votes
2answers
62 views

Deleting multiple rows based on the first instance of the value

I have a table with the below structure. I would like to delete all of the records that records that match ColA for any of the ColB's that have a ColC that has an even-numbered value. But only for the ...
1
vote
0answers
16 views

Server error in reports application

I have a server with SQL Server 2005 installed with the latest service packs. SQL Server 2012 express was been installed on same machine and seems to have broken the Reporting services service. When I ...
-1
votes
1answer
20 views

Jobs scheduling to fetch data from multiple servers using SQL Server Agent [closed]

I have 2 servers - server-1 and server-2, both have an identical database. I have scheduled a job on server-1 thru SQL Server Agent (both servers have SQL Server 2005) which will open table1 on ...
1
vote
1answer
23 views

How to convert different string value to respective 'YYYY' int format?

I'm inserting values into table from xml as: DECLARE @XMLRESULT XML DECLARE @tbl_XMLResult TABLE ( RowID INT IDENTITY(1,1), Status VARCHAR(50), Address VARCHAR(250), ListPrice INT, ...
2
votes
0answers
35 views

how to get column name from cross reference query

I used a script from here: http://stackoverflow.com/questions/13757387/getting-sql-server-cross-database-dependencies that Milica Medic posted and it works GREAT thank you :) my question is how do I ...
0
votes
0answers
31 views

Transactional replication with push subscriptions (No errors but not working)

I have a very simple replication process set up. SQL Server 2005 One publisher, one distributor and two subscriptions Subscriptions are push I created the snapshot, it reinitialized to the ...
3
votes
1answer
63 views

Index fragmentation increased significantly after rebuild

I've googled this and I know that some people say index fragmentation doesn't matter, but they go on to describe scenarios where it might matter. Mine might be such a scenario. I have an index on a ...
1
vote
1answer
25 views

Run subquery once / optimize join with subquery without needing to use temporary table

Until today I thought I had the hang of optimizing queries with joins on subqueries. But I've been trying to optimize a query and on a whim I tried an old method that I thought I didn't need to use ...
2
votes
1answer
52 views

stored procedure can select and update tables in other databases - minimal permissions granted

I recently had to make the stored procedure spPartyOrderAllocation_AllocateItems to select and update tables in other databases, while keeping the pemissions levels to the minimum. This was ...
2
votes
1answer
24 views

ON clause of JOIN specific syntax?

I've been a bit curious about the syntax of the JOIN operation, especifically the ON clause where we set the condition. Let's say we are performing a join on an existing table and a table we have just ...
0
votes
0answers
36 views

How to drop partitioned index in SQL Server 2005

I am unable to drop partitioned index due to partition scheme and partition function existence. Table has a Primary Key, a Clustered Index and non clustered indexes. I am running the following ...
2
votes
2answers
55 views

How to create a range of dates

I have a table named CN in SQL Server 2005: ID Startdate Enddate 1417 2015-09-30 09:45:00.000 2015-10-10 09:45:00.000 973 2015-09-14 11:03:00.000 2015-09-24 11:03:00.000 I ...
4
votes
1answer
102 views

Datetime as date only

I understand SQL Server 2005 doesn't support DATE and so casting a datetime as a date is not possible. What I want to do is list all records with a datetime within an entire day of the current week. ...
0
votes
0answers
40 views

SQL server is replicating to wrong subscriber

I have a publication which is intended to push data to a subscriber over the internet from a remote server to our onsite local subscriber but it ends up on a wrong subscriber.Here is the scenario: ...
3
votes
1answer
48 views

Grant Permission to Execute Set Transaction Isolation Level

I'm a part-time accidental SQL Server 2005 DBA whose full-time job is developing business intelligence solutions, but where the BI intersects with the database, it falls in my 'stack'. We have a ...
7
votes
3answers
426 views

Risks involved in upgrading to SQL Server 2008 R2

We have quite a number of SQL Servers that need to be upgraded from version 2005 to 2008 R2. Work is planned before the middle of the year as Microsoft is ending its support for the same. The 2005 ...
-4
votes
1answer
59 views

Unable to create a table type on SQL Server 2005

I have created a type defined as following: CREATE TYPE [dbo].[TypeListingDatePrice] AS TABLE( [RowID] [int] NULL, [ListPrice] [int] NULL, [SoldPrice] [int] NULL, [PendStatusDOM] ...
6
votes
3answers
229 views

Updating a view on multiple joined tables

Since MSDN does not say much, what happens exactly if I execute the following query? update claims set status='Awaiting Auth.' where status = 'Approved' Can I use the ClaimStatusName column of the ...
3
votes
1answer
45 views

SQL Server Service Broker - CHECKDB found consistency errors, how could this happen?

I encountered a weird SQL Server Service Broker consistency problem, namely I have a queue that holds messages (status=1, Ready to receive) which are lying there for a very long time. In the ...
0
votes
0answers
20 views

Mirror Suspended - can't detatch

We have a site where they have MS SQL 2005 and we are mirroring a database. At some point around Xmas it's stopped mirroring after an unscheduled reboot. Trying to resume just throws an error, and ...
1
vote
2answers
115 views

Transforming multiple rows into a single row

In my company, I need to join table A to table B: Table A is the sources table Table B is the empty table I want to know that how can I do it and the result like table B? Source table A: ID ...
1
vote
0answers
28 views

Design improvement on multiple references

Im having some 'perception' problem, maybe... I got this table linked multiple times with another small table and maybe is more of a personal problem with the way it looks but I feel there might be a ...
1
vote
1answer
71 views

Will transactional replication break if there is a heavy update/delete query run on the publisher DB

For these specifications: Publisher: (prod OLTP DB server) SQL Server 2005, database size : 220 GB also acts as the distributor Subscriber (Prod reporting DB server): SQL Server 2005, DB gets ...
3
votes
1answer
156 views

Reattaching MDF files recovered from RAID 5

We had been running a SQL Server 2005 server for many years at our company when just recently, we ran into some trouble. The server was configured with RAID 5 and had one hot spare disk in the array. ...
5
votes
2answers
314 views

Insert custom header row in BCP output

Long story short we have a database here that manages some employee data such as email, first name, last name, etc. Our company bought into this SAP Based expense report system :| that needs an ...
2
votes
3answers
123 views

Replicating data between SQL Server 2014 to SQL Server 2005 - temporary solution

I will be installing a new SQL Server 2014 database system, which is based on our current SQL Server 2005 database system. The new system will be on a completely new infrastructure when we go live, ...
3
votes
2answers
291 views

Find the days difference between two dates per month

I have a table 'data' in which there are two columns i.e. Startdate and Enddate. Startdate is the date when an employee joined working in a company and Enddate is the date when he left. I need to ...
1
vote
2answers
57 views

Getting Only What Changed from SQL Server 2005

We have a 17 store system which are on SQL Server 2005 Standard Edition and on Windows 2003 server. We currently have the following process: At each store we have an SQL job which runs a procedure ...
7
votes
1answer
112 views

Unique identifier field with a conditional

I have a database that's not in production, so the main table being CustodyDetails, this table has a ID int IDENTITY(1,1) PRIMARY KEY column and I'm looking for a way of adding another unique ...
2
votes
1answer
90 views

Can I truncate log in simple recovery mode? [duplicate]

I have a few SQL Server 2005 databases in simple recovery mode. The disk volume in which my transaction logs are stored had only 1GB free, when I started a stored procedure (massive delete in a single ...
7
votes
1answer
384 views

Is it possible to restore SQL Server DB from transaction log (no MDF)?

We had a SQL Server 2005 server that housed roughly 200 low/no traffic archive databases, and that server was not backed up to any other device. The database files (MDF and LDF) were stored on a RAID ...
0
votes
0answers
39 views

sqlevn70.rll - Failed to Load Format String for Error 345

I have been receiving the following alerts from this error message as shown below: Operating system error: 317(The system cannot find message text for message number 0x345 in the message file for ...
3
votes
0answers
51 views

Proc Cache Drop Assistance [duplicate]

We are noticing performance issues with one of our applications. When the application issues begin the procedure cache size goes from 4.5GB to 0. The plans are then rebuilt and still the application ...
2
votes
1answer
86 views

Script file execution through Power shell

We are trying to automate few things, one of them is to deploy patch in one go on selected DBs of SQL Server, as per my knowledge Powershell is an option. But I have zero taste buds of Power shell. ...
2
votes
2answers
89 views

Find the first datetime interval

I have a table in SQL with a column Recordtime and valueasreal RecordTime ValueAsReal 2015-11-30 12:59:00 195,6907 2015-11-30 13:00:00 203,8667 2015-11-30 13:01:00 198,0907 2015-11-30 ...
1
vote
1answer
160 views

all tables used by a stored procedure and all sps that use a particular table - recursive cte

I am working on a script that gives me a list of tables that use a specific stored procedure. It also works on all tables used by a stored procedure. on the example below, all stored procedures that ...
3
votes
1answer
66 views

Unpivot with rows converted to columns as well as columns converted to rows

I've tried to understand unpivot examples on the web but they don't quite result in what I'm trying to do, which is to have specific rows turned into columns and columns turned into rows. To try and ...
0
votes
1answer
105 views

Multiple criteria for including / excluding rows

CLARIFICATION UPDATE Unfortunately we report based on the 3rd party application and database so we cannot modify the datatypes since we do not own it. To help clarify, This report basically shows us ...
8
votes
2answers
230 views

Moving Databases to New Datacenters

My company is moving our infrastructure to new data center and I am trying to figure out the best way to keep the database on the new server in sync with the current production database until the new ...
0
votes
0answers
47 views

SQL Server Error Number 825 how to proceed

I have a Windows Server 2003 running on VMWare with an SQL Server 2005 installed. This morning I received 2 warning mails 4 hours apart about error 825. Both times the error was about an incorrect ...
2
votes
1answer
31 views

Track write requests on Read-only database

I have changed one of the databases to read-only in SQL Server 2005. I would like to track if someone tries to write to the database. Any suggestions on how to track such requests (end user write ...
1
vote
2answers
64 views

SQL Server - cannot drop idle job

Currently, I am transitioning a server from a company to another. They want to keep SQL Server installed on the server so we are wiping clean all the databases, maintenance plans and jobs. I'm ...
2
votes
1answer
42 views

Questions about DBCC FREEPROCCACHE

I used spAskBrent for troubleshooting a SQL Server 2005 performance issue. I found the problem was someone had ran DBCC FREEPROCCACHE. It caused low performance (very low PLE) on my database and ...
1
vote
0answers
113 views

SQL Server Alert System: 'Severity 17 - Potentially Fatal Error Insufficient Resources' occurred on myserver

I get a alert email with the title: SQL Server Alert System: 'Severity 17 - Potentially Fatal Error Insufficient Resources' occurred on myserver as 12:02 when I connect to myserver to check ...
2
votes
3answers
114 views

SQL Server Pagination using CTE

I have to apply paging on query as per requirement i need two extra columns other than query result 1. Total Records 2. Total Pages but i am trying to confirm that this the right way to retrieve ...
1
vote
1answer
32 views

Report rollbacks to log file

There are several reasons for SQL transactions to rollback. I want to log all of them to the SQL Server Log File so that I can find information about them at a later time in the SQL Server Log File ...
0
votes
2answers
49 views

From SQL Server 2005 to SQL Server 2012

I need to convert some databases from SQL Server 2005 to 2012; I know that you must convert it into 2008 before, but I can't rely on a SQL Server 2008 Enterprise installation: is there a faster way ...