sql-server-2005

Can I retrieve config values for SSIS from XML in a table?

My current client stores all of their configuration information for the enterprise applications in a single table that holds XML. They then use a custom built front end to maintain the configuration values. I'm writing a fairly straight-forward import process for them using SSIS. I need to make the connection strings and some other info...

How do I insert values from an XML document into a temp table, in SQL Server?

Iam having one SP for which the input is a XML document . I want to insert the values from the XML into a temp table . How i can implement this one ...? ...

Local vs Global temp tables - When to use what?

I have a report which on execution connects to the database with my_report_user username. There can be many end-users of the report. And in each execution a new connection to the database will be made with my_report_user (there is no connection pooling) I have a result set which I think can just be created once (may be on the first run ...

What is the preferred merge method for SQL Server 2005?

I have mainly been using the Exists Method for merging a row into a table but I am considering switching to the Row Count Method. Is there any reason not to? Exists Method If Exists(Select * From Table Where ID = @ID) Begin Update Table Set Value = @Value Where ID = @ID End Else Begin Insert Into Table (Value) Values (@Va...

TSQL- Rollup SQL 2005

I have the following example code: create table Details( name varchar(20), age int, weight int, recordDate Datetime) --insert data ..query: SELECT a.name, a.age, a.recordDate, a.weight - (SELECT b.weight FROM Details WHERE b.recordDate = dateadd(dd, -1, a.recordDa...

C# CLR Stored Proc won't Deploy to SQL Server 2005

I'm developing a C# SQL Server 2005 stored procedure that does data validation for my application. I have a nice framework built, that is working. The validation methods are along the lines of: private void TestDate() { TestFields(delegate (string value) { if (value == String.Empty || value == "") return true; ...

Oracle 10g express home page is not coming up

Hello All: My Oracle 10g Express Edition , I can login in the SQL plus but I cannot login into oracle via SQL developer and cannot view the Home page at link http://127.0.0.1:8080/apex. This was working fine until yesterday. I have checked via (WINDOWS)netstat -ab and no other app is using the 8080 port. The only thing I did today was...

Stored proc does not display results

The stored proc below does not display any results with SQL Server 2005. I can take the same instructions and run it as a query and I get results, What am I missing. ALTER PROCEDURE [dbo].[usp_SubtractStops] @p NVARCHAR(1024) = '209 208 207 206 205 204 203 113 297 19 7 12 11 6 232 233 234 235 236 237 273 271 272 210 211 212 213 214 21...

Need to Develop SQL Server 2005 Database to Store Insurance Rates

Good Evening All, A client has asked that I develop a web application as part of his existing site built in ASP.net 3.5 that will enable his brokers to generate quotes for potential client groups. Such quotes will need to be derived using rate tables stored in a SQL Server 2005 database. The table structure is as follows: [dbo].[Pl...

how to select a particular table from a storedprocedure which returns multiple table?

Hi all, I have a storedproc which has multiple select statement. When it is executed in sql server , it returns multiple tables. I need a query which will select a particular table from the storedproc e.g. sp_help. Please help. ...

Archiving Reports SQL 2005 Reporting Services

Hi, Is there a way to configure the Report Server to Archive the reports to the Report Server or to a path on the File System. I need to save the reports generated as .pdf files. TIA. ...

How can I dump & load MS-SQL preserving identity columns?

I'd like to be able to dump & load a MS-SQL database so I can recreate the storage locations, the original database was poorly configured with 1 storage location and I'd like to correct this issue. My current attemtps at doing this have resulted in the identity columns being regenerated upon a load, this was while using the `Tasks > Imp...

Truly empty element with sql server for xml-directive

How do I create a truly empty xml element with the for xml-directive in sql server (2005)? Example: select '' for xml path('element'), root('elements') Outputs: <elements><element></element></elements> But what I really want is: <elements><element /></elements> ...

How to copy a table schema and constraints to a table of different database?

Hi all, I need an sql which will copy schema of a specified table to a table in different db. How to implement this? Please help. ...

Stored Procedure Timing out.. Drop, then Create and it's up again?

I have a web-service that calls a stored procedure from a MS-SQL2005 DB. My Web-Service was timing out on a call to one of the stored procedures I have (this has been in production for a couple of months with no timeouts), so I tried running the query in Query Analyzer which also timed out. I decided to drop and recreate the stored pro...

Restore a database using SQL Server 2005

I have backed up a database into a file using SQL Server from my old server. Now i would like to restore that file into a new database on my new server. I created a DB with the same name , I am getting an error saying : "The Backup set holds a backup of the database other than the existing '*' database" Any thoughts? Thanks ...

SQL Comma Separated List from Multiple Columns

Hi, I have data that looks like this: CUSTOMER_ID OPERDAYSJUL OPERDAYSAUG OPERDAYSSEP ... OPERDAYSJUN 1 30 15 2 2 5 1 0 3 6 0 12 4 12 5 23 For each customer_id, I want a comma-delimited list indicating w...

Indexing Performance BigInt vs VarChar

This is a FACT Table in a Data Warehouse It has a composite index as follows ALTER TABLE [dbo].[Fact_Data] ADD CONSTRAINT [PK_Fact_Data] PRIMARY KEY CLUSTERED ( [Column1_VarChar_10] ASC, [Column2_VarChar_10] ASC, [Column3_Int] ASC, [Column4_Int] ASC, [Column5_VarChar_10] ASC, [Column6_VarChar_10] ASC, [C...

SQL Server out of memory

I got this error running a query that goes against 2 tables with combined 50k rows. An error occurred while executing batch. Error message is: Insufficient memory to continue the execution of the program. How do I get around this? Edit I get this when I run DBCC MEMORYSTATUS Msg 2571, Level 14, State 1, Line 1 User 'XXXX\YYYY' doe...

Distance between two locations using Latitude and Longitude way off what Google says.

I've spent a few days trying to figure this one out and can't seem to pinpoint the problems. I have a SQL 2005 database storing latitude and longitude as Decimal(18,8), all of which I received by querying Google. For these two locations: From: 10715 Downsville Pike Ste 100 MD 21740 to: 444 East College Ave Ste 120 State College PA, 168...