sql-server-2005

How to get the dependency of jobs in SQL Server?

Hi, How can we find the job dependency in SQL server. Therotically basing on the success of first one job the other job begins. Thanks a lot in advance!! ...

Deadlock calling Membership.CreateUser on a Load Test

Hi, I am getting Sql deadlocks while calling aspnet_Users_CreateUser Api during load test (100+ concurrent users) I have wrapped the createUser, roles.AddUserToRole and another custom mapping procedure inside a Transaction Scope block. Once the deadlock is encountered no more user accounts are created. I am also using Enterprise Librar...

backup SQL Server 2005 database without data

I have one stored procedure to backup the database. It will backup metadata as well as data. Is there any option to back up the database with out data. ie, back up only the schema (Empty tables). I don't want to script the database. ...

Copy trigger from one database to another

Is it possible, in a script executed in MS SQL Server 2005, to copy a trigger from one database to another? I've been asked to write a test script for a trigger my project is using. Our test structure is to create an empty database containing only the object under test, then execute a script on that database that creates all the other o...

SQL Server FullText Search (Windows Service) - Failure

Hi all, I've been asked to look at a server issue but for some reason I am unable to track down the cause. Basically, they have SQL Server 2005 (Workgroup Ed) that has a number of databases running. One of which has Full Text indexing enabled on a table. When trying to read the data regardless of what client I use, I get Timeout ...

begin try catch on sql server 2005, how to send the ERROR_stuff to the calling parent?

you have this procedure CREATE PROCEDURE dbo.test1 AS BEGIN begin transaction begin try exec dbo.test2 commit transaction end try begin catch SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS ErrorSeverity ,ERROR_STATE() AS ErrorState ,ERROR_PROCEDURE() AS ErrorProcedure ,ERROR_LINE() AS...

"Index was outside the bounds of the array" while Compare SQL schema by SQL compare tool

I got one problem from comparing database schema as i use Red gate SQL Compare 6 , after initialization of the compare databases error is coming as following "Index was outside the bounds of the array". Please provide your valuable comments to get resolve this issue. ...

SQL Server constraint Help

Hello there, I'm having problems coming up with an adequate restraint in SQL Server 2005. My problem involves the following tables: Table PKTable { pk integer primary key, property integer, } Table FKTable { pk integer primary key, fk integer references PKTable(pk), } I really want to make it impossible for a record, fk_rec...

Can a SQL Server database answer during a transaction?

I'm using .Net 2.0, ADO.NET, a dataset and data adapters to manage my data, and Microsoft SQL Server 2005 as database manager. I have an application that generates a great number of results (500K+) and saves them in a database. If one result generation fails, I would like to not save any of the results. So I put all the database inserts...

SQL Server 2000 compatible script

Hi, this T-SQL script works fine in SQL Server 2005 but in SQL Server 2000 it says incorrect Syntax near 'Try' 'End'. Any help please? Begin Transaction Begin Try UPDATE Test SET RefID = 'bc27de13-2323-4ce8-8c87-0171efbd812a' WHERE RefID = 'bc27de13-2323-4ce8-8c87-0171ffbd812a'; DELETE FROM Physician WHERE RefID = 'bc27...

deploy SQL Server Express database with desktop app?

I've created my first database based desktop app in .NET and not able to understand how can I deploy the database with the application installer, so that the database, application and the SQL Server is installed in one go. If I only deploy the native client for SQL Server and the database with the installer, will it work? The applicati...

High performance ASP.NET setup

I would like to ask you what is the best setup for a following application: ASP.NET 3.5 Web site - used as a presentation layer, a lot of AJAX and JS. Will not hit the server a lot. ASP.NET WCF - sevice providing all data to the application. It's responsible for validation, data modeling / preparing and communication with the DB Server...

datetime vs smalldatetime

If I don't care about less than seconds, what should be the recommended type to store my datetime values in sql-server 2005, is it datetime or smalldatetime or else? ...

Is it wiser to use a function in between First and Next Insertions based on Select?

PROCEDURE add_values AS BEGIN INSERT INTO TableA SELECT id, name FROM TableC ("This selection will return multiple records") While it inserts in TableA i would like insert into another table(TableB) for that particular record which got inserted in tableA Note:The columns in TableA and TableB are different , is ...

sql server 2005 .mdf .ldf files

I have those 2 files (.MDF and .LDF) how could i attach them to microsoft sql server in order to see their content ? ...

Is there a way to track all the queries that has been executed by the server?

I want to be able to see all the queries that has been executed on the server last 2 days etc. see the script, date of execution, sender etc. is there any way? I am using SQL X 2005. ...

SQL Server 2005 T-SQL Problem: Need help in omitting records

Good day! I need help in writing a query.. I have records in a table below.. The condition would be no records should be displayed if the succeeding records' new_state was repeated from the previous records(new_state) and if it is changed in the same date.. here record_id 1 has gone through the ff states: 0->1->2->1->3->4->3 in the sam...

Sql Server 2005 Dev Edition Not connecting on Windows 2003 Server from Win 7

Management Studio of Sql Server Dev Edition 2005 installed on Win 7 is not able to connect on Windows 2003 Server where standard edition of sql server 2005 is installed. The connection is working when I use the Sa password but when I use windows authentication then it is showing err msg that "user is not associated with a trusted sql s...

SQL Server: How to tell if a database is a system database?

I know that so far (until MSSQL 2005 at least), system databases are master, model, msdb and tempdb. Thing is, as far as I can tell, this is not guaranteed to be preserved in the future. And neither the sys.databases view nor the sys.sysdatabases view tell me if a database is considered as a system database. Is there someplace where t...

The query has been canceled because the estimated cost of this query (1660) exceeds the configured threshold of 1500. Contact the system administrator.

"The query has been canceled because the estimated cost of this query (1660) exceeds the configured threshold of 1500. Contact the system administrator." I am getting error as above on live while running one of the stored procedure threads where parameter contain XML variable. I have checked the configuration value of QUERY_GOVERNOR_CO...