Showing posts with label selected. Show all posts
Showing posts with label selected. Show all posts

Monday, March 26, 2012

Install of 2005 tools fails

I'm trying to install SQL Server 2005 tools, but keep getting this error,

TITLE: Microsoft SQL Server Setup


None of the selected features can be installed or upgraded. Setup cannot proceed since no effective change is being made to the machine. To continue, click Back and then select features to install. To exit SQL Server Setup, click Cancel.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=setup.rll&EvtID=SQLSetup90&EvtType=28108

Then on the Details, it says the following,

Name: Microsoft SQL Server 2005 Tools
Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Build version check:
Your upgrade is blocked because the existing component is a later version than the version you are trying to upgrade to. To modify an existing SQL Server component, go to Add or Remove Programs in Control Panel, select the component you would like to modify, and then click Change/Remove.

I uninstalled the Express tools from the system and can't get the tools to install. I've rebooted to no avail. Help!After installing/uninstalling the Express product a few times, I found a solution: I ran the Install Cleanup utility (http://support.microsoft.com/default.aspx?scid=kb;en-us;290301), and removed any references to SQL Server 2005. Then I went into the registry (PROCEED WITH EXTREME CAUTION HERE!) and deleted the services that had been created for SQL Server 2005 in HKEY_LOCAL_MACHINE/SYSTEM/SERVICES. Then I found the install folders (from the service registry keys above) and zipped up their contents and moved them elsewhere, deleting the original files. In between, I ran two different registry cleanup programs, which found issues and resolved them. One is a free tool, called RegScrubXP (do a Google and it should come up).

I also generated an MSI Inventory using a special tool described here to ensure that SQL Server 2005 was nowhere to be found: http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx.

You've got to also remember that there's an order in uninstalling the items: You remove the db first, then the tools, then the support files, then the native client. Please correct me if I'm wrong on this.

After about a week of wrestling with it, I've removed the express tools and finally got the full SQL Server 2005 client tools installed and am very happy

Friday, March 9, 2012

INSERT-SELECT depending on the Select:ed order

I'm doing a INSERT...SELECT where I'm dependent on the records SELECT:ed to be in a certain order. This order is enforced through a clustered index on that table - I can see that they are in the proper order by doing just the SELECT part.

However, when I do the INSERT, it doesn't work (nothing is inserted) - can the order of the records from the SELECT part be changed internally on their way to the INSERT part, so to speak?

Actually - it is a view that I'm inserting into, and there's an instead-of-insert trigger on it that does the actual insertions into the base table. I've added a "PRINT" statement to the trigger code and there's just ONE record printed (there should be millions).This sure looks like a "tip of the iceberg" thread...

You can include an ORDER BY statement in your INSERT code, at the end of statement where you would normally place it.

Your trigger is only going to fire ONCE per transaction, no matter how many records are in the transaction. Insert 1000 individual records and the trigger fires 1000 times, but do a single insert of 1000 records and your trigger will only fire once.

Now the big question...what the heck are you doing that requires ordered inserts into a view with an INSTEAD OF trigger? Such complexity is rarely necessary.|||Thanks; I noticed that the records "sent" from the SELECT to the INSERT appeared in reversed order. And, I though the trigger was fired once per record. I've created an SP to take care of it.

The requirement on the order is because this table keeps track of how users logon to an application and then logoff. I'm changing the table from a structure where each such event has its own table row, to a structure where both events are stored in the same row (one datetime column for the logons and one for the logoffs). When transferring data from the old table to the new, I'm assuming that the Logon records are read before the Logoff records, since the Logon records mean an INSERT into the new table while the Logoff records mean an UPDATE of an already existing row (having a Logon date registered).|||You should probably just include a datetime value in your recordset rather than relying on record order.