sql-server-2005

How do you upgrade a SQL Express Database to SQL Server Workgroup or Standard?

I have a website that was originally developed using a SQL Express database in the App_Data folder. Now I need to take upgrade it, without loosing any data, to SQL Server 2005 Workgroup or Standard. Is there a guide on how to properly upgrade by Microsoft or another source? ...

T SQL - Eloquent replacement of Correlated Subquery

I have a query that is currently using a correlated subquery to return the results, but I am thinking the problem could be solved more eloquently perhaps using ROW_NUMBER(). The problem is around the profile of a value v, through a number of years for an Item. Each item has a number of versions, each with its own profile whick starts w...

OLE DB Provider and openrecordset

With SQL Server 2005 using SSMS, when I run this: SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\TestIDs.xls', 'SELECT * FROM [Sheet1$]') And get this: The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered. Is it referring to the server or my local machine? ...

Sql Server CE 3.5 Merge Replication Synchronise is Hanging

Hi I am using sql server 2005 ce framework 3.5 and attempting to use merge replication between my hand held and my sql server. When I run the code to synchronise it just seems to sit forever, and when I put a breakpoint in my code it never gets past the call to Synchronize(). If I look at the replication monitor in sql server, it get...

External Tool Development for SQL Server Management Studio 2005

Hi All, Does anyone have any experience of developing external tools for SSMS 2005. Ideally I would like to be able to interact with the query windows directly, for example, taking the query text from the window to perform some processing on it. Any pointers in the right direction would be great. Thanks in advance ...

Compatibility

Hi Friends, Actually I have to find out the compatibilty of the upgrade of MSSQL 2000 to MSSQL 2005. The MSSQL 2000 was installed inside the Citrix box . I did a side by side upgrade by backing up the database and restoring in my local machine. Now I have to figure out if the applications will work in MSSQL 2005.Can somebody please, give...

How to minus instead of add in a Sum() like sql function

I have a group by clause in a sql statement and need to use an aggregate function to minus all the values in each group instead of adding like the Sum() function. i.e. SELECT Sum(A) FROM ( SELECT 2 AS A UNION SELECT 1) AS t1 ..so will evaluate 2+1 and return 3. I need some way of doing 2-1 to return 1. Hope this makes s...

ROLAP not working - how to design the cube/DSV for ROLAP?

I'm trying to configure storage mode ROLAP for a partition in an existing SSAS cube. The cube is a little messy in that the measure group is defined by a named query (as opposed to a table) and the dimensions are defined in several different data source views (DSV). This is the error message I get when querying the cube with mdx: Execu...

SELECT INTO with an additional column

I am attempting to insert a copy of a row from one table into another table with the same schema, with the addition of one column (a timestamp) to provide a "history" of the first table in MS Sql Server 2005. So, my query, without the additional column would be: "SELECT INTO [WebsiteHistory] FROM [Website]" I want to populate the tim...

Hourly ODBC pull to SQL 2005

I'm trying to pull data from an ODBC app to SQL2005(dev ed) DB on an hourly basis. When I run SSIS the option to import all tables and views is grayed out and forces your to write a query. How would I go about setting up a SSIS integration service to update ALL 250 some tables on an hourly basis. ...

SQL Identity (autonumber) is Incremented Even with a Transaction Rollback

I have a .net transaction with a SQL insert to a MS SQL 2005 DB. The table has an identity primary key. When an error occurs within the transaction, Rollback() is called. The row inserts are rolled back correctly, however the next time I insert data to the table, the identity is incremented as if the rollback never occurred. So essenti...

SQl 2000 Reporting Services and SQL 2005 Reporting Services side by side???

Does anyone know if it is possible to install SQL 2000 Reporting Services Server side by side with SQL 2005 Reporting Services Server? The Reports and ReportServer virual directories are both virtual directories in the default website and they use different .net frameworks. Is this even allowed? Do I need to create a new website to supp...

Is there a dynamic management view in SQL Server 2005 that pertains to column statistics?

The dynamic management views of SQL Server 2005 can give usage information about table indexes. Is there a similar method for getting usage information about column statistics? In specific, I'm curious if some of the older column statistics I've created are still being used. If not, I'd like to delete them. ...

SQL Server 2005 Express in VMware causing very high CPU load

I'm having the problems described in KB937745 - very high CPU usage and the Application Log is reporting something like this: The client was unable to reuse a session with SPID SPID, which had been reset for connection pooling. I've downloaded the hotfixes and I can't run them - I suspect it is because SQL Server 2005 Express Edition ...

How to delete all but the latest 20,000 records in MS SQL 2005?

Every night I need to trim back a table to only contain the latest 20,000 records. I could use a subquery: delete from table WHERE id NOT IN (select TOP 20000 ID from table ORDER BY date_added DESC) But that seems inefficient, especially if we later decide to keep 50,000 records. I'm using SQL 2005, and thought I could use ROW_NUMBE...

numeric(38,0) as primary key column; good, bad, who cares?

Hi, On my current project, I came across our master DB script. Taking a closer look at it, I noticed that all of our original primary keys have a data type of numeric(38,0) We are currently running SQL Server 2005 as our primary DB platform. For a little context, we support both Oracle and SQL Server as our back-end. In Oracle, our pri...

Can't connect to SQL Server Express using sqlcmd.exe

Hi All, Env.: Vista SP1, SQL Server Express 2005 I'm able to connect to my localhost SQL Server using SQL Server Management Studio, using Windows authentication and, to the best of my knowledge, all default parameters, including network protocol. Now I try to connect using sqlcmd.exe to no avail: C:\Program Files\Microsoft SQL Server...

Is it safe to use MS SQL's WITH (NOLOCK) option for select statements and insert statements if...

Is it safe to use MS SQL's WITH (NOLOCK) option for select statements and insert statements if you never modify a row, but only insert or delete rows? I..e you never do an UPDATE to any of the rows. ...

Sql Server 2005 only accessible in ASP.NET 1.1 when I specify protocol and port

My company is currently migrating some of their really old db's to sql server 2005. Some legacy apps have problems connecting to the new server. The connection string works in Asp.NET 2.0, probably because it assumes tcp:1433 automatically. I have to construct the connection string like this in ASP.NET 1.1 for it to work: "Server=tcp:m...

SQL Server cannot obtain a LOCK resource at this time - What to do?

I have a stored procedure on SQL Server 2005 doing a Serializable Transaction. Inside this transaction, it selects a table with rowlock. At the end of the procedure, after rollback/commit, it sets the transaction isolation level to Read Commited. This procedure is running, different processes have concurrent access controlled by these c...