Showing posts with label instances. Show all posts
Showing posts with label instances. Show all posts

Tuesday, March 27, 2012

dataSource is different instance of same database(Urgent)

Hi,

I need help......

I am trying to create a report whose datasource will be different instances of the same database.So both the databases contains the same tables with same schema but the thing is that teh data is different.I have to collect the daat from different instances of the same table a(as they contains different different data) and using the collection to generate the report.

It's very very urgent ...plz reply ...

Thanx in advance

HI,

I dont thnk this is possible to do(as far as i know you cant connect a datasource to different database at runtime and also you cant change datasource at runtime). Now to solve your problem i can think of these solutions -

1. Create two datasources(connecting to two different database), and in your report create two datasets connecting to each one of the datasources. Similarly create two instances of tables (or whatever control you want to display) and connect controls to dataets. Now on runtime show/hide the table based on data from which table you want to show.

This is not a verygood choice(actually very poor) and you can achieve this using two copies of same report connecting to different databases and by showing the appropriate report to user.

2. Better approch is to have two tables in the same database like a_1 and a_2 and pass a parametre to your sp specifying which table to be used. In SP you will have to create dynamic sql in which table name will be created based on the parametre passed.

Hope i am able to convey whats there in my mind....

|||

Just came across this blog, it looks like we can dynamically change the connection string(did'nt tried though) -

http://blogs.msdn.com/bimusings/archive/2006/07/20/673051.aspx

DataSource has 2 instances that don't exist

Using VS05 SP1 Pro SQL Express…

In converting a program from VS03/MSDE, long ago I installed SQL 2005 Express with Advanced Services and everything was fine.Windows Update has recently been failing to install SQL 2005 Express with Advanced Services SP2.After no answers from the forums, and logs that were of no help, I decided to uninstall SQL 2005 Express with Advanced Services and reinstall SQL 2005 Express (basic version).As a test run, I did it on a desk top, no problems what so ever.

However, on my laptop, it has been a nightmare.

Question 1) in control panel, add/remove programs, all of SQL 2005 Express with Advanced Services uninstalled fine except one item - I am unable to uninstall MS SQL 2005 Backward Compatibility, getting the error message

A network error occurred while attempting to read from the file

c:\windows\installer\sqlserver2005_bc.msi

That file is not on the hard disk.

After installing SQL 2005 Express (the basic version), this problem persists and I cannot uninstall MS SQL 2005 Backward Compatibility for the same reason.

How can I get rid of MS SQL 2005 Backward Compatibility?

Question 2) Windows update still is trying to download and install SQL 2005 Express with Advanced Services SP2, even though I have uninstalled it.How to manually get rid of whatever settings are triggering this?

Thanks!

Bob

Using VS05 SP1 Pro SQL Express…

Server Explorer, Add Connection, Advance Settings Button, DataSource lists 3 options:

.\SQLEXPRESS

.\CSoltuion

.\MSSQLSERVER

I am only interested in the first one, SQLEXPRES, and would like to remove the other two (MSSQLSERVER is actually disabled because if you try to start it you get an error message The request failed or the server did not respond in a timely fashion).In Control Panel, Add/Remove Programs, MS SQL Server 2005, Remove Button, it gives me the option to remove only

CSoltuion

SQLEXPRESS

If I choose CSoltuion to remove, it immediately does nothing and goes back to the add/remove screen.If I choose Remove for MS SQL Server 2005, CSoltuion is still there.

How do I get rid of

.\CSoltuion

.\MSSQLSERVER

Thanks!

Bob

|||

Using VS05 SP1 Pro SQL Express…

Question 1) Is the only way to add a new named SQL instance to run the SQL Express (download file SQLEXPR32.EXE) and choose the name where it asks you to? This is incredibly time consuming and often you spend a lot of time to have it fail.

Question 2) In Add/Remove programs MS SQL Server 2005, I have two named instances

SQLEXPRESS

CSoltuion

If I choose either of them to be removed, nothing happens, and it instantly returns to the add/remove screen and they are still there. They are not listed as services under manager computer.

If I try add them by running SQLEXPR32.EXE, they are not listed as existing named instances (there is a button to check that before you choose a name), but when I get to the end (again, much time wasted), the install fails saying the named instance already exists.

How do I get rid of these two named instances?

Question 3) The only way I have been able to get a named instance to work is to choose a name that has never been used before, such as SQLForTheFirstTime, which is ridiculous.

I want a named instance only of SQLEXPRESS…How do I do that?

Thanks

Bob

|||

I'm looking into this Bob. In the future, please don't post the same question multiple times, it doesn't get you an answer any faster.

Mike

|||

Hi Bob,

Question 1) Is the only way to add a new named SQL instance to run the SQL Express (download file SQLEXPR32.EXE) and choose the name where it asks you to? This is incredibly time consuming and often you spend a lot of time to have it fail.

Yes, each named instance is a completely separate copy of SQL Express. There is no way to get a separate copy other than to install it.

Question 2) In Add/Remove programs MS SQL Server 2005, I have two named instances

SQLEXPRESS

CSoltuion

If I choose either of them to be removed, nothing happens, and it instantly returns to the add/remove screen and they are still there. They are not listed as services under manager computer.

If I try add them by running SQLEXPR32.EXE, they are not listed as existing named instances (there is a button to check that before you choose a name), but when I get to the end (again, much time wasted), the install fails saying the named instance already exists.

How do I get rid of these two named instances?

So you're seeing Microsoft SQL Server 2005 in Add/Remove Programs, and the report lists the two instances you've named, but they don't uninstall. When you say they are not listed under Manage Computer, you're talking about the list of Services, right? It seems like you've already tried to remove these instances from your computer but something went wrong during the uninstall, do you remember removing these previously before noticing the failure you've described?

I have some ideas for getting rid of these, but it will royally mess up SQL Server if you actually have it installed. We need to be sure these really aren't there. Are there any SQL Tools on the Start menu? For example, can you find Start | All Programs | Microsoft SQL Server 2005 | Configuration Tools | SQL Server Configuration Manager? If it's there, launch it and see if it lists any instances of SQL Server and check their state. (Started, Stopped, etc.) If they are stopped, try to start them.

If there is nothing on the Start menu and/or you can't start any of the instances on your computer, you can try using the Windows Installer Cleanup Utility. This doesn't actually remove programs from your computer, it just removes the entries for the program in the windows installer registry so that windows installer doesn't think it's installed. This will really break any SQL Components that you do have installed, so be carful. Run the utility and try to remove the entry for Microsoft SQL Server 2005. Once you've done that, try installing again.

It's possible that you could still have problems based on SQL registry entries, but lets cross that bridge when we get to it.

|||

As to your first paragraph, yes to everything.

Below is in chronological order after reading your message...

SQL Server Management Studio Express, Server Name, Browse For Servers shows the following local servers

(all prefaced by local machine name)

MICROSOFTSMLBIZ (for Outlook Business Contact Manager, MSDE Format I think)

MICROSOFTBCM (for Outlook Business Contact Manager, MSDE Format I think)

(MACHINE NAME ONLY)

SQLEXPRESS

CSOLUTION

SQLTEST

SQLEXPRESSDATA (this is the only one that works)

SQL Server Configuration Manager

SQL Server 2005 Services shows

SQLEXPRESS

SQLTEST

MSSQLSERVER

SQLEXPRESSDATA (this is the only one that works)

SQL Server 2005 Network Configuration shows

CSOLUTION (note this is not shown above)

SQLEXPRESS

SQLTEST

MSSQLSERVER

SQLEXPRESSDATA (this is the only one that works)

I then ran the Windows Install Clean up on

CSOLUTION

SQLEXPRESS

The only other one listed was

SQLEXPRESSDATA

Which I did not run it on because it is the only one working.

In add remove programs SQL 2005 remove button shows

CSOLUTION

SQLEXPRESS

SQLEXPRESSDATA

I clicked the radio button forSQLEXPRESS to remove it, and it tried to remove SQLEXPRESSDATA (the one that works), so I cancelled. I confirmed SQLEXPRESSDATA still works.

In computer manager services, it shows the following (note that the ones that did not start did not show before running Windows Install Cleanup)

SQLEXPRESS

SQLEXPRESSDATA (this is the only one that starts).

SQLTEST

MSSQLSERVER

SQL Server Management Studio Express and SQL Server Configuration Manager show the same thing after running Windows Install Cleanup.

The only way I have found to install a new instance is to use a name that has never been used before.

Also, when you create a new named instance, C:\Program Files\Microsoft SQL Server\MSSQL.4 starts at 4 (why does it not start at 1?) . SQLEXPRESSDATA (the only one that works) uses MSSQL.4

Where do we go from here? It looks like a real mess.

Thanks for your help.

Bob

|||

Quick question on these forums -

can you Alt_PrtScrn and Paste a dialog box into a forum, without having to type it all out like it did above, to show you what you are asking for?

Bob

|||

Try this:

Remove –Windows Installer Clean-Up Tool
http://download.microsoft.com/download/E/9/D/E9D80355-7AB4-45B8-80E8-983A48D5E1BD/msicuu2.exe

|||

Hi Bob,

Answer to quick question: No, you can't paste graphics into the forum posts, I wish you could.

Since all the standard ways to remove SQL Express seem to be failing we'll have to go a bit more old school. Follow the instructions in this KB to manually remove SQL from the machine. You may need to do some of the steps for each instance you're wanting to get rid of. This should get you back to a clean state that will allow you to install the default named instance of SQL Express.

Mike

|||

Based on the document, there were two options, here are the results:

Option 1 - Ran ARPWrapper.exe /Remove on CSolution, it did nothing. ARPWrapper.exe /Remove is the same as runing via the add/remove programs.

Option 2 - Looked at each GUID under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, there was no Microsoft SQL entry.

No other approches in the document.

If I do a search on CSolution in the registry, there are entires, but I am hesitant to just start deleteing any I find.

Any other ideas?

Thanks

Bob

|||

Hi Bob,

Where are you finding the entries for CSolution, and for that matter, SQLEXPRESS? Don't start deleting just yet, I'm discussing this with our setup team to get the right solution.

Mike

|||

You can also find the product codes if you look in the registry under the InstId keys, located in a path like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.*\Setup

There will be one MSSQL.* key for each instance, numbered probably in order. Something like MSSQL.1, MSSQL.2, and so on.

|||

Under VS03, the name of the solution was CSolution as well as the name of the SQL MSDE Instance.

When we upgraded to VS05/SQL Express, the name of the solution was changed to CSolution_Telephony and the SQL instance was first left at Csolution but then changed to SQLExpress (without CSolution being uninstalled).Everything worked fine for a long time.

All the SQL problems started when Windows Update could not install the SP2 for SQL Express Advanced, so we uninstalled it and reinstalled the basic SQL Express.We are now using a named instance of SQLExpressData which works fine.

This is a development machine, so it has VS05 Pro and VB express on it.

Registry Search for CSOLUTION

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\CSOLUTION

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MSSQL$CSOLUTION

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\SQLAgent$CSOLUTION

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\SQLCTR$CSOLUTION

Registry Search for SQLEXPRESS

My Computer\HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\tools\ShellSEM\DataProject

My Computer\HKEY_CURRENT_USER\Software\Microsoft\VBExpress\8.0\DataProject

My Computer\HKEY_CURRENT_USER\Software\Microsoft\VBExpress\8.0\Find

My Computer\HKEY_CURRENT_USER\Software\Microsoft\VWDExprss\8.0\DataProject

Thansk!

Bob

|||

Here are two more that did not appear in the find, but where there when I looked at these specific places based on another post in this thread.

Registry for CSOLUTION

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.2

Registry for SQLEXPRESS

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1

This is an odd one…

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.5 (no value set).

Only MSSQL.4, which is SQLExpressData, appear as folders in Program\MS SQL SERVER

Thanks,

Bob Day

|||

Hi Bob,

Per R. Greens instructions, take a look at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.*\Setup. The * in this case would be 2 for CSOLUTION and 1 for SQLEXPRESS. You shoud be able to find the Product Code listed there and use that product code with msiexec as described in the KB article.

Let us know how what happens.

Mike

sql

Wednesday, March 7, 2012

Databse Link will not connect

I have a couple new servers - Windows 2003 R2 - with SQL Server 2000
SP4 installed. They are all Active/Active clustered instances (my
first ones).

I am trying to create database links to other SQL Server instances, but
there are 3 that I cannot connect to.

The dblink works if I connect to the instance as "sa", but not as my
Windows Authenticated account. We use Active Directory and I am in the
Administrator group on all of the boxes.

Of the 3 I can't get to, 1 is a cluster (Active/Passive) and the other
2 are just regular Enterprise instances. They are all SQL 2000 SP4.

I have several other instances, all SP4 on 2003 boxes and I can connect
to all of them.

Also, on the instances where the dblink does not work, I can actually
connect to these databases w/in Enterprise Manager successfully.

I am using a different port for the instances, but I have set them up
in the Client Network Utility as well and still can't connect.

I can connect via a dblink TO these new instances from the older boxes
fine.

I'm really stumped - I've had the Network people verify we don't have a
firewall issue or something.

Must be some sort of permissions problem, but I don't know what else to
check - - -

Please help!!

THANK YOU!!Not completely sure what you mean by a dblink, but what SQL permissions
do the Administrators have on each server? Are you sure the
BUILTIN/Administrators Windows group have the appropriate permissions
on the databases you want to select from?

Stu

traceable1 wrote:

Quote:

Originally Posted by

I have a couple new servers - Windows 2003 R2 - with SQL Server 2000
SP4 installed. They are all Active/Active clustered instances (my
first ones).
>
I am trying to create database links to other SQL Server instances, but
there are 3 that I cannot connect to.
>
The dblink works if I connect to the instance as "sa", but not as my
Windows Authenticated account. We use Active Directory and I am in the
Administrator group on all of the boxes.
>
Of the 3 I can't get to, 1 is a cluster (Active/Passive) and the other
2 are just regular Enterprise instances. They are all SQL 2000 SP4.
>
I have several other instances, all SP4 on 2003 boxes and I can connect
to all of them.
>
Also, on the instances where the dblink does not work, I can actually
connect to these databases w/in Enterprise Manager successfully.
>
I am using a different port for the instances, but I have set them up
in the Client Network Utility as well and still can't connect.
>
I can connect via a dblink TO these new instances from the older boxes
fine.
>
I'm really stumped - I've had the Network people verify we don't have a
firewall issue or something.
>
Must be some sort of permissions problem, but I don't know what else to
check - - -
>
Please help!!
>
THANK YOU!!

|||Thank you!

By dblink I am referring to a linked server. (I apologize - I come
from an Oracle background).

The BUILTIN/Administrators group has all of the System Roles and it
still did not work.
Other boxes have links into the server/instance which work fine, and
the new server can link to other servers.
It's strange because it's just this one combination that does not work.

Group A: oldest servers; non-clustered; Win 2003 SP1

Group B: medium servers; 1 a/p cluster; 2 non-clustered; Win 2003 SP1

Group C: newest servers; 3 a/a clusters; Win 2003 R2

All SQL Server 2000 SP4

Group A can link to Group B
Group A can link to Group C
Group B can link to Group A
Group B can link to Group C
Group C can link to Group A
Group C CANNOT link to Group A if logged in using Windows
Authentication

All of the links are set up using "sa".

Stu wrote:

Quote:

Originally Posted by

Not completely sure what you mean by a dblink, but what SQL permissions
do the Administrators have on each server? Are you sure the
BUILTIN/Administrators Windows group have the appropriate permissions
on the databases you want to select from?
>
Stu
>
>
traceable1 wrote:

Quote:

Originally Posted by

I have a couple new servers - Windows 2003 R2 - with SQL Server 2000
SP4 installed. They are all Active/Active clustered instances (my
first ones).

I am trying to create database links to other SQL Server instances, but
there are 3 that I cannot connect to.

The dblink works if I connect to the instance as "sa", but not as my
Windows Authenticated account. We use Active Directory and I am in the
Administrator group on all of the boxes.

Of the 3 I can't get to, 1 is a cluster (Active/Passive) and the other
2 are just regular Enterprise instances. They are all SQL 2000 SP4.

I have several other instances, all SP4 on 2003 boxes and I can connect
to all of them.

Also, on the instances where the dblink does not work, I can actually
connect to these databases w/in Enterprise Manager successfully.

I am using a different port for the instances, but I have set them up
in the Client Network Utility as well and still can't connect.

I can connect via a dblink TO these new instances from the older boxes
fine.

I'm really stumped - I've had the Network people verify we don't have a
firewall issue or something.

Must be some sort of permissions problem, but I don't know what else to
check - - -

Please help!!

THANK YOU!!

|||You may want to google "double-hop" and SQL Server; I'm not sure that I
understand your scenario, but a few articles might ring true.

HTH,
Stu

traceable1 wrote:

Quote:

Originally Posted by

Thank you!
>
By dblink I am referring to a linked server. (I apologize - I come
from an Oracle background).
>
The BUILTIN/Administrators group has all of the System Roles and it
still did not work.
Other boxes have links into the server/instance which work fine, and
the new server can link to other servers.
It's strange because it's just this one combination that does not work.
>
>
Group A: oldest servers; non-clustered; Win 2003 SP1
>
Group B: medium servers; 1 a/p cluster; 2 non-clustered; Win 2003 SP1
>
Group C: newest servers; 3 a/a clusters; Win 2003 R2
>
All SQL Server 2000 SP4
>
Group A can link to Group B
Group A can link to Group C
Group B can link to Group A
Group B can link to Group C
Group C can link to Group A
Group C CANNOT link to Group A if logged in using Windows
Authentication
>
All of the links are set up using "sa".
>
>
>
>
>
>
Stu wrote:

Quote:

Originally Posted by

Not completely sure what you mean by a dblink, but what SQL permissions
do the Administrators have on each server? Are you sure the
BUILTIN/Administrators Windows group have the appropriate permissions
on the databases you want to select from?

Stu

traceable1 wrote:

Quote:

Originally Posted by

I have a couple new servers - Windows 2003 R2 - with SQL Server 2000
SP4 installed. They are all Active/Active clustered instances (my
first ones).
>
I am trying to create database links to other SQL Server instances, but
there are 3 that I cannot connect to.
>
The dblink works if I connect to the instance as "sa", but not as my
Windows Authenticated account. We use Active Directory and I am in the
Administrator group on all of the boxes.
>
Of the 3 I can't get to, 1 is a cluster (Active/Passive) and the other
2 are just regular Enterprise instances. They are all SQL 2000 SP4.
>
I have several other instances, all SP4 on 2003 boxes and I can connect
to all of them.
>
Also, on the instances where the dblink does not work, I can actually
connect to these databases w/in Enterprise Manager successfully.
>
I am using a different port for the instances, but I have set them up
in the Client Network Utility as well and still can't connect.
>
I can connect via a dblink TO these new instances from the older boxes
fine.
>
I'm really stumped - I've had the Network people verify we don't have a
firewall issue or something.
>
Must be some sort of permissions problem, but I don't know what else to
check - - -
>
Please help!!
>
THANK YOU!!

|||Thanks -

we're not double-hopping.

If you go to Enterprise Manager, under Security there is "Linked
Servers".

If I am on one of the boxes in Group C, I am unable to open the link to
any of the instances in Group B if I am logged into the instance using
Windows Authentication. (Sorry I had a typo in the last message).

I've recently discovered that if I change the port back to 1433, the
database link will work. However, I am uncomfortable going back to the
default port.
All of my other links work fine.

Also, the servers in Group C are using 64-bit Windows (but 32-bit SQL).

thanks,
tc

Stu wrote:

Quote:

Originally Posted by

You may want to google "double-hop" and SQL Server; I'm not sure that I
understand your scenario, but a few articles might ring true.
>
HTH,
Stu
>
>
traceable1 wrote:

Quote:

Originally Posted by

Thank you!

By dblink I am referring to a linked server. (I apologize - I come
from an Oracle background).

The BUILTIN/Administrators group has all of the System Roles and it
still did not work.
Other boxes have links into the server/instance which work fine, and
the new server can link to other servers.
It's strange because it's just this one combination that does not work.

Group A: oldest servers; non-clustered; Win 2003 SP1

Group B: medium servers; 1 a/p cluster; 2 non-clustered; Win 2003 SP1

Group C: newest servers; 3 a/a clusters; Win 2003 R2

All SQL Server 2000 SP4

Group A can link to Group B
Group A can link to Group C
Group B can link to Group A
Group B can link to Group C
Group C can link to Group A
Group C CANNOT link to Group A if logged in using Windows
Authentication

All of the links are set up using "sa".

Stu wrote:

Quote:

Originally Posted by

Not completely sure what you mean by a dblink, but what SQL permissions
do the Administrators have on each server? Are you sure the
BUILTIN/Administrators Windows group have the appropriate permissions
on the databases you want to select from?
>
Stu
>
>
traceable1 wrote:
I have a couple new servers - Windows 2003 R2 - with SQL Server 2000
SP4 installed. They are all Active/Active clustered instances (my
first ones).

I am trying to create database links to other SQL Server instances, but
there are 3 that I cannot connect to.

The dblink works if I connect to the instance as "sa", but not as my
Windows Authenticated account. We use Active Directory and I am in the
Administrator group on all of the boxes.

Of the 3 I can't get to, 1 is a cluster (Active/Passive) and the other
2 are just regular Enterprise instances. They are all SQL 2000 SP4.

I have several other instances, all SP4 on 2003 boxes and I can connect
to all of them.

Also, on the instances where the dblink does not work, I can actually
connect to these databases w/in Enterprise Manager successfully.

I am using a different port for the instances, but I have set them up
in the Client Network Utility as well and still can't connect.

I can connect via a dblink TO these new instances from the older boxes
fine.

I'm really stumped - I've had the Network people verify we don't have a
firewall issue or something.

Must be some sort of permissions problem, but I don't know what else to
check - - -

Please help!!

THANK YOU!!

Sunday, February 26, 2012

Databases with different collation

Hi group,
we have databases now residing on different servers or instances with
different collations. We are considering bringing the databases on the same
server, keeping their respective collation.
Some of our applications access databases with different collations. We
have been using linked server and specifying "Use remote collation" (or
not). But when putting the DBs with different collation on the same server,
you loss this feature. To go over all the applications and specify the
collation on the query statement level is of course too big a task. Is
there a way to do such a blanket declaration on the database level?
Your responses are greatly appreciated.
Quentin
Quentin,
Have you tried using ALTER DATABASE...COLLATE command?
Thanks.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Databases with different collation

Hi group,
we have databases now residing on different servers or instances with
different collations. We are considering bringing the databases on the same
server, keeping their respective collation.
Some of our applications access databases with different collations. We
have been using linked server and specifying "Use remote collation" (or
not). But when putting the DBs with different collation on the same server,
you loss this feature. To go over all the applications and specify the
collation on the query statement level is of course too big a task. Is
there a way to do such a blanket declaration on the database level?
Your responses are greatly appreciated.
QuentinQuentin,
Have you tried using ALTER DATABASE...COLLATE command?
Thanks.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Databases with different collation

Hi group,
we have databases now residing on different servers or instances with
different collations. We are considering bringing the databases on the same
server, keeping their respective collation.
Some of our applications access databases with different collations. We
have been using linked server and specifying "Use remote collation" (or
not). But when putting the DBs with different collation on the same server,
you loss this feature. To go over all the applications and specify the
collation on the query statement level is of course too big a task. Is
there a way to do such a blanket declaration on the database level?
Your responses are greatly appreciated.
QuentinQuentin,
Have you tried using ALTER DATABASE...COLLATE command?
Thanks.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Friday, February 17, 2012

Database with empty name

I somehow managed to get a database object with an empty name into one of my instances of SQL Server. I can't delete it or otherwise work with it (I've tried renaming it so I could delete it) without getting an error message because of the empty name. I've tried these things (as well as a "Drop Database" query with no name, which I didn't expect to work and it didn't) from both the SQL 2000 and 2005 environments. Has anyone come across this before? I don't suppose this database is hurting anything but I'd still like to get rid of it. The objects in it make it appear to be a copy of the Master database - it also doesn't show up where I would expect it to in the Data folder for this instance.

Thanks,

Dave

Dave,

I never come across this problem. Whenever I have to drop or delete a database, I relatively get that done with ease. In case the database name is empty, which is very weird case, I will suggest you to try deleting using Enterprise manager. It would have been more easy to address your issue if you could specify what error message did you get when you tried renaming or using "Drop Database" query. But I am pretty sure you can delete your database using Enterprise Manager. However, you have to make sure before deleting your database that the database is not currently running. Most easy way to do that is to stop the Sql Server Service Manager from your task bar.

I hope it works.

Ujjwal Kaji

|||

Thanks for the reply. I tried deleting it in Enterprise Manager and get the same Error Message:

Error 21776: [SQL-DMO]The name '' was not found in the Databases collection. If the name is a qualified name, use [] to separate various parts of the name, and try again.

Thanks for any insight into this.

-Dave

|||

Hi,

before messing with the system tables, try to do a:

1. DROP DATABASE []

2. sp_renamedb '','MyDatabasetoDelete'

or (posted by Tom Moreau)

3. (can vary to SQL server 2k5, because sysdatabases is sys.databases now)

sp_configure 'allow', 1
go
reconfigure with override
go
update sysdatabases
set
name = 'MyDB'
where
name = ''
go
sp_configure 'allow', 1
go
reconfigure with override
go


Stop and start SQL Server.

Check after each steps if the database is till existing, sometime SQl Server doesn′t know how to handle return code for this strange situation and gives back a weird error.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

Jens,

Thanks for the reply. I guess somehow it was a system database because your 3rd suggestion worked perfectly. Very strange...

Thanks for your help.

Dave

|||Thank you for the post, option 3 solved my empty database name as well.

Database with empty name

I somehow managed to get a database object with an empty name into one of my instances of SQL Server. I can't delete it or otherwise work with it (I've tried renaming it so I could delete it) without getting an error message because of the empty name. I've tried these things (as well as a "Drop Database" query with no name, which I didn't expect to work and it didn't) from both the SQL 2000 and 2005 environments. Has anyone come across this before? I don't suppose this database is hurting anything but I'd still like to get rid of it. The objects in it make it appear to be a copy of the Master database - it also doesn't show up where I would expect it to in the Data folder for this instance.

Thanks,

Dave

Dave,

I never come across this problem. Whenever I have to drop or delete a database, I relatively get that done with ease. In case the database name is empty, which is very weird case, I will suggest you to try deleting using Enterprise manager. It would have been more easy to address your issue if you could specify what error message did you get when you tried renaming or using "Drop Database" query. But I am pretty sure you can delete your database using Enterprise Manager. However, you have to make sure before deleting your database that the database is not currently running. Most easy way to do that is to stop the Sql Server Service Manager from your task bar.

I hope it works.

Ujjwal Kaji

|||

Thanks for the reply. I tried deleting it in Enterprise Manager and get the same Error Message:

Error 21776: [SQL-DMO]The name '' was not found in the Databases collection. If the name is a qualified name, use [] to separate various parts of the name, and try again.

Thanks for any insight into this.

-Dave

|||

Hi,

before messing with the system tables, try to do a:

1. DROP DATABASE []

2. sp_renamedb '','MyDatabasetoDelete'

or (posted by Tom Moreau)

3. (can vary to SQL server 2k5, because sysdatabases is sys.databases now)

sp_configure 'allow', 1
go
reconfigure with override
go
update sysdatabases
set
name = 'MyDB'
where
name = ''
go
sp_configure 'allow', 1
go
reconfigure with override
go


Stop and start SQL Server.

Check after each steps if the database is till existing, sometime SQl Server doesn′t know how to handle return code for this strange situation and gives back a weird error.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

Jens,

Thanks for the reply. I guess somehow it was a system database because your 3rd suggestion worked perfectly. Very strange...

Thanks for your help.

Dave

|||Thank you for the post, option 3 solved my empty database name as well.

Database version/compare

I'm looking for something that will tell me the DDL differences between
instances of a database (dev/qa/prod/sandbox) and something to apply a
version number to it. Perhaps with SourceSafe intagration?Hello JayKon,
> I'm looking for something that will tell me the DDL differences
> between instances of a database (dev/qa/prod/sandbox) and something to
> apply a version number to it. Perhaps with SourceSafe intagration?
>
For SQL Server you should take a look at
-Visual Studio Team Edition for Database professionals (integrates in VS,
so has source control support)
- Red-Gate SQL Compare (great tool, but last version I tried (4.0) had no
source control support.
- EMS DB Compare for * (also a great tool, available for multiple database
types (mysql, mssql, oracle, postgesql, firebird, sybase)
You can also directly integrate your database project in Management Studio
with source control (not compare schema's though).
Jess|||Apex SQL diff also has a nice interface for comaparing and syncronizing. I
was having issues with VS Team Edition, but I didnt really give it much of a
chance yet.
"Jesse Houwing" wrote:
> Hello JayKon,
> > I'm looking for something that will tell me the DDL differences
> > between instances of a database (dev/qa/prod/sandbox) and something to
> > apply a version number to it. Perhaps with SourceSafe intagration?
> >
> For SQL Server you should take a look at
> -Visual Studio Team Edition for Database professionals (integrates in VS,
> so has source control support)
> - Red-Gate SQL Compare (great tool, but last version I tried (4.0) had no
> source control support.
> - EMS DB Compare for * (also a great tool, available for multiple database
> types (mysql, mssql, oracle, postgesql, firebird, sybase)
> You can also directly integrate your database project in Management Studio
> with source control (not compare schema's though).
> Jesse
>
>|||While 3rd party products are OK, I was hoping for some SQL someone had
already written. The task doesn't seem hard, just time consuming.
"JayKon" wrote:
> I'm looking for something that will tell me the DDL differences between
> instances of a database (dev/qa/prod/sandbox) and something to apply a
> version number to it. Perhaps with SourceSafe intagration?|||> While 3rd party products are OK, I was hoping for some SQL someone had
> already written. The task doesn't seem hard, just time consuming.
Yes, but why not utilize a product that doesn't constitute re-inventing the
wheel? SQL Compare is $400. The amount of time you would spend perfecting
someone else's SQL scripts to meet your requirements (and not getting any
official support while doing so), even if you are very good, would easily
exceed that on the first day. It's easy to say "there is no budget" but
man-hours have to be quantified as money as well, unless you don't value
your time.
Anyway, if you're dead-set on doing it yourself, have a look at:
http://databases.aspfaq.com/general/how-do-i-document/compare-my-sql-server-database-s.html
After a few hours, if you are frustrated, there are several 3rd party tools
that will be up and running in minutes. SQL Compare has my 100%
endorsement, and the tool from Apex has received great reviews as well. You
can always try them for 14 days to see if they do a better job than your own
scripts. However, as SQL Server continues to get more complex, my guess is
that may not be enough time to finish your own version.
--
Aaron Bertrand
SQL Server MVP|||On Aug 10, 1:16 pm, "Aaron Bertrand [SQL Server MVP]"
<ten...@.dnartreb.noraa> wrote:
> > While 3rd party products are OK, I was hoping for someSQLsomeone had
> > already written. The task doesn't seem hard, just time consuming.
> Yes, but why not utilize a product that doesn't constitute re-inventing the
> wheel? SQLCompareis $400. The amount of time you would spend perfecting
> someone else'sSQLscripts to meet your requirements (and not getting any
> official support while doing so), even if you are very good, would easily
> exceed that on the first day. It's easy to say "there is no budget" but
> man-hours have to be quantified as money as well, unless you don't value
> your time.
> Anyway, if you're dead-set on doing it yourself, have a look at:http://databases.aspfaq.com/general/how-do-i-document/compare-my-sql-...
> After a few hours, if you are frustrated, there are several 3rd party tools
> that will be up and running in minutes. SQLComparehas my 100%
> endorsement, and the tool from Apex has received great reviews as well. You
> can always try them for 14 days to see if they do a better job than your own
> scripts. However, asSQLServercontinues to get more complex, my guess is
> that may not be enough time to finish your own version.
> --
> Aaron BertrandSQLServerMVP
Even better, xSQL Software (http://www.xsqlsoftware.com) has a
completely free lite edition of its xSQL Object that does what you
need. And, if you want to tweak things yourself you can check out xSQL
SDK it comes with a thorough documentation and easy to follow
samples.
Thanks,
JC
xSQL Software
http://www.xsqlsoftware.com|||www.dbconstructor.com
If you would like I can show you how to do it using the above tool.
Regards,
Rober Allen Schambach
"JayKon" <JayKon@.discussions.microsoft.com> wrote in message
news:80C2CA91-7FA4-4035-B9B8-59D8E8D66E65@.microsoft.com...
> I'm looking for something that will tell me the DDL differences between
> instances of a database (dev/qa/prod/sandbox) and something to apply a
> version number to it. Perhaps with SourceSafe intagration?|||Did the Red Gate SQL Compare work well for you? Do you know if it
syncronizes the changes also?
--
Thanx in advance!
Always OpenTo Suggestions
"JayKon" wrote:
> I'm looking for something that will tell me the DDL differences between
> instances of a database (dev/qa/prod/sandbox) and something to apply a
> version number to it. Perhaps with SourceSafe intagration?