sql-server-2005

SQL Server Express DB is 'in recovery' - how to detect / know when it is

when an SQL Server Express DB is 'in recovery', you are unable to connect using SQL Authentication. Is there a simple way of determining the stat of the DB prior to connecting to it? (Using .Net) ...

Sql server triggers - order of execution

Does anyone know how Sql server determines the order triggers (of same type, i.e. before triggers) are executed. And is there anyway of changing this so that I can specify the order I want. If not, why not. Thanks. ...

Method to generate pdf from access+vb6 or just sql 2005?

The setup: Multiple computers using an adp file to access a sql 2005 database. Most don't have a pdf distiller. An access form (plain form, not crystal) is created that needs to be saved as a pdf. The only way I can think of is send a request from access to the sql server for a web page. Something like: "http://sqlserver/generatepdf.ph...

How do I attach an .mdf to sql2005?

Running sp_attach_single_file_db gives this error: The log scan number (10913:125:2) passed to log scan in database 'myDB' is not valid Isn't it supposed to re-create the log file? How else would I be able to attach/repair that .mdf file? ...

How do you priortize multiple triggers of a table?

I have a couple of triggers on a table that I want to keep separate and would like to priortize them. I could have just one trigger and do the logic there, but I was wondering if there was an easier/logical way of accomplishing this of having it in a pre-defined order. ...

ASP.Net application cannot Login to SQL Server Database when deployed to Web Server

I am having a problem with deploying a ASP.NET V2 web application to our deployment environment and am having trouble with the sql server setup . When I run the website I get a Login failed for user 'MOETP\MOERSVPWLG$'. error when it tries to connect to the database. This seems to be the network service user which is the behaviour I wa...

SQL Server Reporting Services shows DTD prohibited in XML document error

I am getting the following error when running a reporting services report. Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: XmlException Exception message: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on Xm...

How do I figure out who has a SQL Server 2005 database in Single User Mode?

I have a database in single user mode and I am trying to drop it so I can re-run the creation scripts on it, but I'm being locked out from it. How do I figure out who has the lock on it? How do I disable that lock? ...

SQL Server 2005 - clicking on job->Properties yields "New Job" window.

Recently, I've started having a problem with my SQL Server 2005 client running on Windows XP where right-clicking on any job and selecting Properties instead brings me to the New Job window. Also, if I select "View History", I get the history for all jobs, instead of the one I right-clicked on. This happened to me once before, and I ...

Anyone know of any good Database Diff tools?

I can't find any good ones in sourceforge :( Anyone has any success with open source (or retail) database diff tool? EDIT: for sqlserver 2005 ...

Is there a tool to monitor the SQL statements being executed by an .EXE ?

I'd like to be able to hook into a 3rd party application to see what SQL Statements are being executed. Specifically, it is a VB6 application running on SQL Server 2005. For example, when the application fills out a grid, I'd like to be able to see exactly what query produced that data. ...

Restore a SQL Server database from single instance to cluster

I need to transfer a database from a SQL Server instance test server to a production environment that is clustered. But SQL Server doesn't allow you to use backup/restore to do it from single instance to cluster. I'm talking about a Microsoft CRM complex database here. Your help is greatly appreciated. ...

How do I perform a case-sensitive search and replace in SQL 2000/2005?

In order to perform a case-sensitive search/replace on a table in a SQL 2000/2005 database, you must use the correct collation. How do you determine whether the default collation for a database is case-sensitive, and if it isn't, how to perform a case-sensitive search/replace? ...

In SQL Server 2005, can I do a cascade delete without setting the property on my tables?

I have a database full of customer data. It's so big that it's really cumbersome to operate on, and I'd rather just slim it down to 10% of the customers, which is plenty for development. I have an awful lot of tables and I don't want to alter them all with "ON DELETE CASCADE", especially because this is a one-time deal. Can I do a del...

SQL Server 2005 / XML Stored Proc - Unicode to ascii? (Exception 0xc00ce508)

Hello! I have an MSSQL2005 stored procedure here, which is supposed to take an XML message as input, and store it's content into a table. The table fields are varchars, because our delphi backend application could not handle unicode. Now, the messages that come in, are encoded ISO-8859-1. All is fine until characters over the > 128 stan...

Stored Procedure Syntax

My stored procedure is called as below from an SQL instegartion package within SQL Server 2005 EXEC ? = Validation.PopulateFaultsFileDetails ? , 0 Though i'm not sure what the ? means ...

SQL Server 2005: Importing data from SQL Server 2000

In SQL Server 2000, you have the "All Tasks... - Export Data" option. Where is this option the SQL Server 2005 Management Studio? Or, is there a SQL Server 2005 way of doing this? EDIT: I am using the Express edition. EDIT: Joel's response answers my question but Mike's answer gives a great alternative to those of us using the Ex...

How to return multiple values in one column (T-SQL)?

I have [UserAliases] (UserId, Alias) table with multiple Aliases per user. I need to query it and return all aliases for a given user, the trick is to return them all in one column. Example: UserId/Alias 1/MrX 1/MrY 1/MrA 2/Abc 2/Xyz I want the query result in the following format: UserId/Alias 1/ MrX, MrY, MrA 2/ Abc, Xyz Thank you...

SQL Server 2005: T-SQL to temporarily disable a trigger

Is it possible to disable a trigger for a batch of commands and then enable it when the batch is done? I'm sure I could drop the trigger and re-add it but I was wondering if there was another way. ...

SQL Server Management Studio 2005 - Change Default Directory for Backup Location

Using MS SQL Server Management Studio 2005 - To Restore a Database: Restore Database (*) From Device: Click "..." Button Backup media: File Click "Add" Button Popup Window: "Locate Backup File" That window Defaults to C:\Program Files\Microsoft SQL Server\MSSQL.1\Backup How do I configure MS SQL Server Management Studio to look i...