This tag is for SQL Server 2005, major build version 9.00.xxxx.

learn more… | top users | synonyms (2)

2
votes
5answers
193 views

How can I store function names to be executed on a subset of rows?

I have a table, accounts, which contains the vast majority of the data I am concerned with. accountTypes contains different types of accounts (Business, Personal, etc.). I want to perform calculations ...
1
vote
2answers
236 views

dm_db_missing_index_details - does the order of equality_columns matter

I've been investigating some databases using the dm_db_missing_index_group_stats DMV, and have a question about the equality_columns field in the dm_db_missing_index_details view. MSDN says that this ...
6
votes
5answers
6k views

SQL Select taking too much time to execute

It's a simple select from a temporary table, left joining an existing table on its primary key, with two sub selects using top 1 referring the joined table. In code: SELECT TempTable.Col1, ...
2
votes
1answer
2k views

Tool to Convert MySQL DB to MS SQL 2005 (Especially stored procedures) [closed]

Is there any tool to convert MySql db to MS SQL 2005. I am mostly interested in converting Stored Procedures. There are 100s of procedures and writing them again in T-SQL is a big job. Thanks.
1
vote
1answer
158 views

Duplicate record problem

create table #Personel ( Ad varchar(100) ) create table #Masa ( MasaAdi varchar(100) ) insert into #Personel values('deneme1') insert into #Personel values('deneme2') insert into #Personel ...
8
votes
2answers
1k views

SQL Agent powershell context reference

At my new job, we have multiple named instances on each servers. Server1\Dev Server1\DevIntegrated Server1\QA I have a SQL PowerShell script in the works that calls out to the OS, invokes ...
1
vote
1answer
762 views

Cartesian Product SQL / Inserts with multiple Values Clauses

I want to create cartesian product sql query.But,I'm getting the error.Where I wrong? alter table #Personel ( Ad varchar(100) ) alter table #Masa ( MasaAdi varchar(100) ) insert into #Personel ...
2
votes
2answers
409 views

How to query status changes in time series?

Given create table rating ( ID int identity(1,1) primary key, PersonID int, Ratingdate date, rating varchar(2) ); insert into rating values ( 1, '2010-08-04' , 'A3'); insert ...
1
vote
2answers
308 views

how to generate scripts for database objects specific to an application?

There was a application which, earlier, pointed to a database. It used a specific set of tables. Those tables had triggers, constraints, etc. There were also stored procs which insert data into these ...
4
votes
1answer
757 views

Need help with ASYNC_NETWORK_IO

We have a SQL Server 2005 server that is serving up 20 websites, one of which is our custom CMS, and a few other micro sites. I am new to this and just started looking at the databases here. The ...
3
votes
1answer
549 views

Sql Server Performance Degradation in moving from 2005 to 2008

I have sql server 2005 setup for my performance bench marking exercise and I have put same database on another server which has sql server 2008 and exact replica in terms of hardware configuration. ...
2
votes
2answers
262 views

SQL Server 2005 Row update problem

After I pulled these datas what I wanted from a SQL Server Database,I can't update on row.I'm receiving the following the error.
1
vote
2answers
340 views

SQL server 2005 SP4 differential backup is failing

We have an SQL server 2005 with SP4, x86. When we attempt to take the differential backup, we are getting the following error message. Cannot perform a differential backup for database "ABCD", ...
3
votes
1answer
2k views

MS Access displays alle columns in SQL Server tables as “deleted”

I have created an ODBC connection to a SQL Server 2005. When I link to the tables from MS Access, some tables have only "deleted" data. This means the rows and columns are displayed, but all data ...
5
votes
2answers
1k views

How can I corrupt a table in SQL Server?

I have to write a program that detects corrupted tables and tries to repair them. For this I need to corrupt tables regularly. Is there anyway to corrupt tables manually?
5
votes
5answers
614 views

SQL Server Backup Process Tuning

I am working for a small company that has 20 full time web sites. And another 20-30 micro sites. We are having issues with the sites freezing every day after the SQL Server Agent backup is running. ...
9
votes
4answers
12k views

Hard and Fast rule for include columns in index

Is there any hard and fast rule to decide what columns and in which order it should be put in Included in non clustered index. I was just reading this post Why use the INCLUDE clause when creating an ...
1
vote
1answer
158 views

Logical page error while attempting to insert data

I am getting the following error while trying to insert a row in a table: Attempt to fetch logical page (1:12032) in database 19 failed. It belongs to allocation unit 72057594069450752 not to ...
1
vote
1answer
248 views

Changed stored procedure causes VB runtime error

ALTER Procedure [dbo].[HRptForm3A] @StrCond Varchar(1000), @SelYear int, @Type varchar(1) as Declare @Tbl varchar(30) if ( @Type = 'O') begin set @Tbl = 'TblResult' ...
2
votes
2answers
359 views

update stored proc ony fields that are passed to the proc and leaving others alone

i have a stored proc that does a simple update (see below). i want to update only fields passed and not the ones that are null. that is to say if i dont get a parm value for somethign i dont want ...
2
votes
1answer
833 views

Are master/slave replication relationship between different versions of SQL Server possible?

I have a database server, SQL Server 2005, that's inside a private network. Now i need to make a database there available for a webserver, so i want to replicate this db to an external server, which ...
4
votes
2answers
4k views

stored proc to handle XML as input param for multiple record inserts

i have updated my proc from taking typical data types to take a single XML param so that i can call it once instead of multiple times for inserting multiple records. here is a sample of my proc that ...
3
votes
1answer
3k views

sqloledb vs sqlncli - Performance difference or just feature set?

I've been running through some Classic ASP code recently and was wondering if there was a performance difference between connecting using: ...
1
vote
2answers
3k views

how to get a boolean value into a select based on another table?

i have 2 tables Message and Attachments as follows (note: this is a one to many relationship: message: messageId, from, to, subject, body Attachments: messageId, filename i want to select the ...
2
votes
2answers
379 views

Should SQL full text search match the value test2 when searching for test?

if i have table data that is indexed using full text search in Microsoft SQL server 2005 that includes raw table data such as "test2" should a query using FTS find a match if the search string is ...
4
votes
2answers
7k views

SQL Server: index creation date

In SQL Server 2005 and above, how can I find when an index was created?
2
votes
1answer
247 views

Why doesn't FTS match any records?

I created an indexed view with a few fields that i created a full text search based on these fields. here is my view: alter VIEW vFullTextSearch WITH SCHEMABINDING AS SELECT M.Id as MessageId, ...
21
votes
4answers
54k views

Sql Server Maintenance Plan - Best Practices on Tasks and Scheduling

I am tasked with devising a maintenance plan for our Sql Server 2005 databases. I know for backups I want to do a daily full database backup and transactional log backups every 15 minutes. My problem ...
6
votes
2answers
418 views

Troubleshoot DBMail in Sql Server 2005

On a SQL Server 2005 machine, I have DBMail setup and correctly configured. I am able to use "Notify Operator" and EXEC msdb.dbo.sp_send_dbmail to queue emails. But the problem is the queued mails ...
2
votes
1answer
3k views

Location of Maintenance Plan's Back Up Database Tasks information (SQL Server 2005)

I would like to know where in the database or on the file system the information about Back Up Database Task in the Maintenance Plans Tasks. I can find the Job in msdb.dbo.sysjobs I can find the ...
3
votes
2answers
600 views

Combining retail sales and payment OLAP cubes

I'm using SQL Server 2005 Standard Edition Analysis Services (SSAS). I'm trying to build cubes from a retail OLTP database that can answer these kinds of questions: List down all products that were ...
7
votes
2answers
2k views

How to effectively query and aggregate a normalized SQL db?

In relation to Most efficient way to return multiple aggregates in a single stored proc? I have an email type application and want to select all the messages (inbox) for a user. The problem is that I ...
6
votes
2answers
644 views

Most efficient way to return multiple aggregates in a single stored proc?

What is the best or most efficient way to get multiple aggregate result values? Basically I have an email app and wanted to get all the numbers of messages for each type of folder (inbox, sent, ...
3
votes
2answers
3k views

Stored procedure parameters using tsql functions?

Environment sql server 2005 sp3 I have a stored proc that takes an INT as input. I want to CAST a CHAR to an INT during the call to the stored proc. it seems I cannot do that. I get a syntax error ...
0
votes
1answer
1k views

cant truncate tables with a pk/ fk relationship?

I have a table called Folder with 3 fields: Id (PK), Name, UserId (FK) and another table called User with two fields: Id (PK), UserName i am trying to run this sql: truncate table Folder truncate ...
5
votes
1answer
520 views

What are the common reasons for a Subscription to be deactivated in SQL Server 2005?

I am trying to manage database replication in SQL Server 2005. I have set up my publications, distributors and subscriptions and it seems to work properly at the start. However, after a period of ...
1
vote
1answer
2k views

“Request to run job dbxxxxx refused” error in merge replication

I'm doing merge replication whole of my database but when I create the subscription I encounter this error: SQLServerAgent Error: Request to run job DBXX-XX--bazresiostani2-2 (from User sa) refused ...
13
votes
8answers
31k views

SQL Server Cannot drop database <dbname> because it is currently in use… but no sessions displayed

When I try to drop a database I get the error "Cannot drop database "dbname" because it is currently in use". However, when I run sp_who2, there are definitely no sessions connected to this database. ...
4
votes
2answers
2k views

SQL Server 2005 Index Rebuild/Reorganize

I have checked my huge db and run some shrink tasks for 5 or 7 times. I got about 11 GB freespace. This DB is used for offline reporting operations. Before, when we create a report it was growing ...
2
votes
2answers
449 views

Calling a stored procedure in a stored procedure

Environment sql server 2005 My question is Calling a stored proc within a stored proc within another stored proc. When is this type of development detrimental? In order to promote code reusablity ...
8
votes
3answers
3k views

What is the best method to add error handling in SQL 2005 stored procs?

What’s a good way to make stored procs robust enough that they can scale very well and also contain error handling? Additionally, whats the best way to handle multiple error scenarios in a stored ...
1
vote
1answer
279 views

What's the best paradigm or design pattern for exception handling in a mission-critical DB driven web application?

I want to design a bullet-proof, fault tolerant, DB driven web application and was wondering on how to architect it. the system will have a asp.net UI, web services middle tier and SQL2005 back end. ...
4
votes
2answers
2k views

Can I have different publishers and one subscriber in replication?

I have the same databases in three cities which each database have three tables: 1- tbl_worker 2-tbl_workshop 3-tbl_users and cities are:city1,city2,city3 city2 and city3 insert informations in ...
1
vote
1answer
4k views

tsql to find users and database level permissions mapped to a certificate

On SQL 2005 and above, how can I find users and database level permissions mapped to a certificate? Story behing this: I copied a database from SQL 2005 to SQL 2008. It had a certificate inside the ...
3
votes
4answers
464 views

what is hitting your db?

What is a quick way of finding out what is hitting your database especially when the log files are going crazy. SQL profiler? If so, how?
8
votes
4answers
4k views

TSQL: Find Queries causing too many SQL Compilations and SQL ReCompilations seperately

I want to find out what is causing the high SQL Compilations (not re-compilations) I am seeing in performance monitor counters. Here is my take on it: If I am seeing a lot of SQl compilations, then ...
6
votes
6answers
2k views

SQL Server 2005 Huge DB issue

My DB files are growing very fast ( designer is not me and just a weekly report makes 7 GB growth ). And finally, I don't have enough space in the disk. And number of un-reported weeks counting up. ...
1
vote
1answer
855 views

Select statement to retrive xml output as below

Hi could someone provide me some clues or solution to retrive record sets like below note: i read the msdn documentation but leads me no where but hair loss :( Just for the assumption think i have 2 ...
2
votes
2answers
426 views

Database Mirroring Failure Reasons

I was wondering if there is any information on what scenarios might cause a DB Mirror to have to be recreated? I am attempting to research how sturdy the technology is and under what scenarios do we ...
3
votes
2answers
311 views

Comparing two XML query plans

Hopefully a simple one, if I have two (fairly complex, 30-40 node) .sqlplan files (from the same SQL text) what is a good way to compare them side by side? Or just have it tell me what it did ...