sql-server-2005

How to set SSIS Http Connection Manager credentials with config file?

Within an SSIS package I have a Web Service task which uses an Http Connection Manager. I need to set credentials for the connection so that it will authenticate with the remote web service. I can set these at design time, however I would like these credentials to be provided to the package using an XML package configuration file. The p...

Validating UPDATE and INSERT statements against an entire table

I'm looking for the best way to go about adding a constraint to a table that is effectively a unique index on the relationship between the record and the rest of the records in that table. Imagine the following table describing the patrols of various guards (from the previous watchman scenario) PK PatrolID Integer FK GuardID Integer...

Generate resource free/busy query using SQL Server

In SQL Server 2005 I have a table with the following columns: Table Reservations: ID arrival datetime departure datetime reservation_object (FK to objects table) Now I need to generate a report that shows for a specified period the status of an object. This report will have to look like this: 6/1/09 6/2/09 6/3/09 6/4/0...

Entity Framework and Sql Server view question

Hi to all, For several reasons that I don't have the liberty to talk about, we are defining a view on our Sql Server 2005 database like so: CREATE VIEW [dbo].[MeterProvingStatisticsPoint] AS SELECT CAST(0 AS BIGINT) AS 'RowNumber', CAST(0 AS BIGINT) AS 'ProverTicketId', CAST(0 AS INT) AS 'ReportNumber', GETDATE() AS 'C...

Reporting Services 2005 arrangement on virtual machines

I am having some difficulty in determining how best to implement the different parts of reporting services. Our company has just bought a new slew of servers and a shared SAN to support our growing infrastructure. Our servers are running VMware and we have several virtual machines each with their own tasks load balanced across the set ...

sql-server-2005-backups-not-being-deleted

I have a customer running SQL Server 2005 under a Windows 2008 Server. Even though the Maintenance plan completes sucessfully with No errors, the backup files do not get deleted. Here is the subplan command, it is set to delete files over a day old: EXECUTE master.dbo.xp_delete_file 0,N''C:\Program Files\Microsoft SQL Server\MSSQL.1\MSS...

Since there is no Sqlserver array parameter, what's the best way to proceed?

I need to create multiple records in sqlserver, each with the same value in column A, but with a unique value in column B. I have the values for column B in an array. I am using VS2008, aspnet, c# 3.5, sqlserver 2005. Am I better off Option 1. Making 1 call to a stored procedure in sqlserver from c# code, and then doing all t...

Remove Relational Index Options when Scripting Table Index in SQL Server 2005

Using the Microsoft.SqlServer.Management.Smo.Scripter object, I'm generating scripts for each of the tables in my database, including indexes/constraints. When it generates the script, however, it includes all the index options, even though they are the default values, e.g., CREATE TABLE [dbo].[AgeGroup]( [AgeGroupID] [int] NOT NUL...

In a Data Warehouse scenario is there any disadvantage to using WITH(NOLOCK)

I have a Kimball-style DW (facts and dimensions in star models - no late-arriving facts rows or columns, no columns changing in dimensions except expiry as part of Type 2 slowly changing dimensions) with heavy daily processing to insert and update rows (on new dates) and monthly and daily reporting processes. The fact tables are partiti...

MS SQL Server 2005 - Stored Procedure "Spontaneously Breaks"

A client has reported repeated instances of Very strange behaviour when executing a stored procedure. They have code which runs off a cached transposition of a volatile dataset. A stored proc was written to reprocess the dataset on demand if: 1. The dataset had changed since the last reprocessing 2. The datset has been unchanged for 5 ...

SQL Server as a Web Serivce Client

Suppose given a URL, http://test.org/service.asmx How can I use SOAP method in SQL Server to access the service? ...

Mysterious CPU Activity in MS SQL 2005

I am looking at the activity monitor in MS SQL Management Studio 2005, and I see an entry from a login that I created, and it's using the tempdb, and the last command is always "SELECT INTO". And everytime I hit "Refresh" in activity monitor, that entry's "CPU" column goes up by like 60. The "program" of that activity is "MS SQL Manageme...

Should I change my upgraded database's compatibility level from 8 to 9?

I am planning to upgrade a SQL Server 2000 instance to a SQL Server 2005 instance. I am not going to change any database code, so I won't be taking advantage of any SQL2005 specific syntax. Is there any reason to set my compatibility higher (to level 9)? Or is it ok to leave at compatibility level 8? ...

SQL Server group by concatination query help

I have a need for a "run once" query (so performance isn't that critical), using tables similar to these (simplified versions of the actual): CREATE TABLE #Items ( ItemPK int not null primary key ,ItemDescription varchar(25) not null ) INSERT INTO #Items VALUES (1,'rock') INSERT INTO #Items VALU...

How to replace all non-sequential GUIDs with sequential ones?

I have a brown-field SQL Server 2005 database that uses standard, unsorted GUIDs as the majority of the primary keys values and also in clustered indexes (which is bad for performance). How should I go about changing these to sequential GUIDs? One of the challenges would be to replace all of the foreign key values as I change each the ...

Sql Server 2005 executing exe on remote machine or connect to server application

Hello, I'm try to figure how to create sql server stored procedure that when a condition is met executes an executable, with command line arguments, on a remote machine within the network. I could write my own little server application to handle the communication sent from the stored procedure for the executable, but I'm not certain ...

Private Key issue in Service Broker

We are trying to make conversation between two SQL instances in one SQL Engine through Service Broker by following tutorial from MSDN. In order to make it simple , we send the dialog with Encryption = OFF so we do not need to deal with Master key , Certificate... and it works in the local workstation. DECLARE @InitDlgHandle UNIQUEIDEN...

update sql syntax - reset a field to itself with a concatenation - sql server 2005

I'm getting and error using this syntax: update table set field1 = (field1+' - '+field2) where field1 = 'somevalue' It's not too happy with doing this for me. I know that the '+' for concatenation works in my select statements, so that is the right syntax. There is something else at play here... and I tried removing the parenthesis ...

Will Problems Arise from Using SQL2008 to Interact w/ a SQL2005 DB on another machine?

I have SQL2008 installed on my local machine and need to view/alter/select rows and tables from a DB on a remote server running SQL 2005. Will I have any problems doing this. I have seen some people talk about setting compatibility for certain things, but this seems to only be when using new terms for SQL 2008 that don't exist in SQL 2...

Reporting Services - Report Paramaters Losing State

I am embedding a report into my ASP.NET app using the report viewer control. When I change a paramater value and click View Report, I'm losing my paramater selection. Any ideas? ...