Showing posts with label single. Show all posts
Showing posts with label single. Show all posts

Friday, March 23, 2012

Identying all installed SQL Server instances on a machine

I think I would use the SQL-DMO object to find SQL instances, then
filter that list to just the single computer you want to query. =20
Ref: http://www.sqlteam.com/item.asp?ItemID=3D5403
Good luck,
Tony Sebion
--Original Message--
From: Volcano [mailto:Volcano@.discussions.microsoft.com]=20
Posted At: Wednesday, August 03, 2005 11:55 AM
Posted To: programming
Conversation: Identying all installed SQL Server instances on a machine
Subject: Identying all installed SQL Server instances on a machine
Hi,
I want to programmatically identify all SQL Server (2000 or 2005)
instances installed on a machine with Windows 2000 or 2003. One way is
to browse through the Windows registry and look for specific keys such
as HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Mi
crosoft SQL Server. But the
registry is organized differently for SQL 2005 than SQL 2000 and maybe
it will change again for the next SQL version. And things get messy when
both SQL 2000 & SQL
2005 instances co-exist on the same host. So is there an API I can use
to find the instances and not rely on Windows registry?
Thanks in advances for any pointers.
- VolcanoTony & ML:
Thanks a lot for the pointer.
- V
"Tony Sebion" <tony@.sebion.com> wrote in message
news:VlIkTDFmFHA.7716@.taurus.ad.nosellout.net...
I think I would use the SQL-DMO object to find SQL instances, then
filter that list to just the single computer you want to query.
Ref: http://www.sqlteam.com/item.asp?ItemID=5403
Good luck,
Tony Sebion
--Original Message--
From: Volcano [mailto:Volcano@.discussions.microsoft.com]
Posted At: Wednesday, August 03, 2005 11:55 AM
Posted To: programming
Conversation: Identying all installed SQL Server instances on a machine
Subject: Identying all installed SQL Server instances on a machine
Hi,
I want to programmatically identify all SQL Server (2000 or 2005)
instances installed on a machine with Windows 2000 or 2003. One way is
to browse through the Windows registry and look for specific keys such
as HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Mi
crosoft SQL Server. But the
registry is organized differently for SQL 2005 than SQL 2000 and maybe
it will change again for the next SQL version. And things get messy when
both SQL 2000 & SQL
2005 instances co-exist on the same host. So is there an API I can use
to find the instances and not rely on Windows registry?
Thanks in advance for any pointers.
- Volcano

Wednesday, March 21, 2012

IDENTITY_INSERT persistency

Hi all, quick question:

Is the IDENTITY_INSERT persistent, or only for a single transaction. I'm of course trying to insert into a database that has Idenity, and was wondering if I can just have a stored procedure run at startup to loop through all tables with identity fields and set IDENTITY_INSERT to on.

If not, I'll just have code up scripts to restructure the tables.

Thanks,

CooperThe IDENTITY_INSERT setting is persistant how ever what you want to do won't work. From BOL...

At any time, only one table in a session can have the IDENTITY_INSERT property set to ON. If a table already has this property set to ON, and a SET IDENTITY_INSERT ON statement is issued for another table, Microsoft SQL Server returns an error message that states SET IDENTITY_INSERT is already ON and reports the table it is set ON for.sql