Monday, March 12, 2012
Get the SQL Server Unique ID of the Server
Is there any ID / Key which identify the server of the SQL Server
installation uniquely? I need this ID to make sure the database installed in
a SQL server can't be transferred to other SQL Server, for licencing issues.
Or, is there other ways to achieve this?
Thanks & Regards,
EdwardIf you mean you want to find the name of the Windows machine that the
SQL instance is running on then you could use "SELECT
SERVERPROPERTY('MachineName')" or if you're after the name of the SQL
instance itself then you could use "SELECT
SERVERPROPERTY('ServerName')", which will return the Windows machine
name and the SQL instance name.
*mike hodgson*
http://sqlnerd.blogspot.com
Edward Low wrote:
>Hi All,
>Is there any ID / Key which identify the server of the SQL Server
>installation uniquely? I need this ID to make sure the database installed i
n
>a SQL server can't be transferred to other SQL Server, for licencing issues
.
>Or, is there other ways to achieve this?
>
>Thanks & Regards,
>Edward
>
>|||Hi mike,
thanks for your reply. But, "SERVERPROPERTY('ServerName')" still not a uniqu
e, mean someone can have the same servername on other machine. I need someth
ing unique like the hard drive serial no which is unique in each machine. ca
n we get this information from sql server?
Best regards,
Edward
"Mike Hodgson" <e1minst3r@.gmail.com> wrote in message news:e7vcOyvfGHA.4304@.
TK2MSFTNGP05.phx.gbl...
If you mean you want to find the name of the Windows machine that the SQL in
stance is running on then you could use "SELECT SERVERPROPERTY('MachineName'
)" or if you're after the name of the SQL instance itself then you could use
"SELECT SERVERPROPERTY('ServerName')", which will return the Windows machin
e name and the SQL instance name.
mike hodgson
http://sqlnerd.blogspot.com
Edward Low wrote:
Hi All,
Is there any ID / Key which identify the server of the SQL Server
installation uniquely? I need this ID to make sure the database installed in
a SQL server can't be transferred to other SQL Server, for licencing issues.
Or, is there other ways to achieve this?
Thanks & Regards,
Edward|||For SQL Server 2005 you could write an Unsafe CLR procedure which can get th
e Hard drive serial number or any other metric tha you want.
However!? What happens if said hard drive breaks and the server has to be
re-built with a different hard drive and a database backup restored?
Regards
Colin Dawson
www.cjdawson.com
"Edward Low" <wc_low@.hotmail.com> wrote in message news:ORW6yDwfGHA.5088@.TK2
MSFTNGP02.phx.gbl...
Hi mike,
thanks for your reply. But, "SERVERPROPERTY('ServerName')" still not a uniqu
e, mean someone can have the same servername on other machine. I need someth
ing unique like the hard drive serial no which is unique in each machine. ca
n we get this information from sql server?
Best regards,
Edward
"Mike Hodgson" <e1minst3r@.gmail.com> wrote in message news:e7vcOyvfGHA.4304@.
TK2MSFTNGP05.phx.gbl...
If you mean you want to find the name of the Windows machine that the SQL in
stance is running on then you could use "SELECT SERVERPROPERTY('MachineName'
)" or if you're after the name of the SQL instance itself then you could use
"SELECT SERVERPROPERTY('ServerName')", which will return the Windows machin
e name and the SQL instance name.
mike hodgson
http://sqlnerd.blogspot.com
Edward Low wrote:
Hi All,
Is there any ID / Key which identify the server of the SQL Server
installation uniquely? I need this ID to make sure the database installed in
a SQL server can't be transferred to other SQL Server, for licencing issues.
Or, is there other ways to achieve this?
Thanks & Regards,
Edward|||If you could get the Windows domain name (there's no real kosher way
that I know of to do this purely with SQL (you'd have to shell out to
DOS with xp_cmdshell (yuk), like
exec xp_cmdshell 'echo %USERDOMAIN%'
)) then the domain/machine/instance has to be unique (although you could
argue that different unrelated companies, or individuals, could create
domains with the same name).
Alternately I think the ProductID (stored in the registry under
HKLM\SOFTWARE\Microsoft\Windows\CurrentV
ersion\ProductId) is supposed to
be unique for a Windows installation, so that, combined with the
instance name, ought to be a unique SQL instance. However, once again,
there's no real kosher way to read registry keys. In SQL 2000 you can
use the proc xp_regread, like this:
declare @.ProductId varchar(100)
exec xp_regread
'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\Windows\CurrentVersi
on',
'ProductId',
@.ProductId OUTPUT
select @.ProductId
but this is an undocumented proc and in SQL 2005 Microsoft have changed
its behaviour (the permissions around what keys it can and cannot read)
and so it probably won't work in SQL 2005 (although I just tried it on
both a Dev Edition & Ent Edition of SQL 2005 SP1 (x64) and it worked on
both but the trusted login I used was a local admin so that might have
skewed the result a little). But, in any case, it's an undocumented
proc so you probably shouldn't use it (if you want it to continue
working in future versions of SQL Server) and also, if the SQL instance
is installed on a cluster you'd get a different ProductId value
depending on which node the SQL instance happened to be running on at
the time. There's a couple other reg keys you might be able to read to
get a unique ID (like the 180 byte binary SQL setup checksum) but they
all still have the "read from the registry" problem (and on a cluster
reading from the SQL branches of the registry is very messy because
you've got to look up the installed instances, get the one you want,
look up which reg key that instance has its values stored in, go to that
reg key and get the value you're after).
There's no real nice way I can think of to tie a DB to a specific SQL
instance, not with T-SQL code from within a SQL Server session anyway
(you could store a hash, generated outside of a SQL session like in VB
or C# code for example, of some unique attributes of the SQL
installation, like domainname/servername/instancename or
IPaddress/TCPportnumber but those attributes may, validly, change over
time...).
*mike hodgson*
http://sqlnerd.blogspot.com
Edward Low wrote:
> Hi mike,
> thanks for your reply. But, "SERVERPROPERTY('ServerName')" still not a
> unique, mean someone can have the same servername on other machine. I
> need something unique like the hard drive serial no which is unique in
> each machine. can we get this information from sql server?
> Best regards,
> Edward
>
> "Mike Hodgson" <e1minst3r@.gmail.com <mailto:e1minst3r@.gmail.com>>
> wrote in message news:e7vcOyvfGHA.4304@.TK2MSFTNGP05.phx.gbl...
> If you mean you want to find the name of the Windows machine that
> the SQL instance is running on then you could use "SELECT
> SERVERPROPERTY('MachineName')" or if you're after the name of the
> SQL instance itself then you could use "SELECT
> SERVERPROPERTY('ServerName')", which will return the Windows
> machine name and the SQL instance name.
> --
> *mike hodgson*
> http://sqlnerd.blogspot.com
>
> Edward Low wrote:
>|||Hi Mike,
Thanks for your explanation.
Edward
"Mike Hodgson" <e1minst3r@.gmail.com> wrote in message news:uOGY$d6fGHA.5092@.
TK2MSFTNGP04.phx.gbl...
If you could get the Windows domain name (there's no real kosher way that I
know of to do this purely with SQL (you'd have to shell out to DOS with xp_c
mdshell (yuk), like
exec xp_cmdshell 'echo %USERDOMAIN%'
)) then the domain/machine/instance has to be unique (although you could arg
ue that different unrelated companies, or individuals, could create domains
with the same name).
Alternately I think the ProductID (stored in the registry under HKLM\SOFTWAR
E\Microsoft\Windows\CurrentVersion\Produ
ctId) is supposed to be unique for a
Windows installation, so that, combined with the instance name, ought to be
a unique SQL instance. However, once again, there's no real kosher way to
read registry keys. In SQL 2000 you can use the proc xp_regread, like this:
declare @.ProductId varchar(100)
exec xp_regread
'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\Windows\CurrentVersi
on',
'ProductId',
@.ProductId OUTPUT
select @.ProductId
but this is an undocumented proc and in SQL 2005 Microsoft have changed its
behaviour (the permissions around what keys it can and cannot read) and so i
t probably won't work in SQL 2005 (although I just tried it on both a Dev Ed
ition & Ent Edition of SQL 2005 SP1 (x64) and it worked on both but the trus
ted login I used was a local admin so that might have skewed the result a li
ttle). But, in any case, it's an undocumented proc so you probably shouldn'
t use it (if you want it to continue working in future versions of SQL Serve
r) and also, if the SQL instance is installed on a cluster you'd get a diffe
rent ProductId value depending on which node the SQL instance happened to be
running on at the time. There's a couple other reg keys you might be able
to read to get a unique ID (like the 180 byte binary SQL setup checksum) but
they all still have the "read from the registry" problem (and on a cluster
reading from the SQL branches of the registry is very messy because you've g
ot to look up the installed instances, get the one you want, look up which r
eg key that instance has its values stored in, go to that reg key and get th
e value you're after).
There's no real nice way I can think of to tie a DB to a specific SQL instan
ce, not with T-SQL code from within a SQL Server session anyway (you could s
tore a hash, generated outside of a SQL session like in VB or C# code for ex
ample, of some unique attributes of the SQL installation, like domainname/se
rvername/instancename or IPaddress/TCPportnumber but those attributes may, v
alidly, change over time...).
mike hodgson
http://sqlnerd.blogspot.com
Edward Low wrote:
Hi mike,
thanks for your reply. But, "SERVERPROPERTY('ServerName')" still not a uniqu
e, mean someone can have the same servername on other machine. I need someth
ing unique like the hard drive serial no which is unique in each machine. ca
n we get this information from sql server?
Best regards,
Edward
"Mike Hodgson" <e1minst3r@.gmail.com> wrote in message news:e7vcOyvfGHA.4304@.
TK2MSFTNGP05.phx.gbl...
If you mean you want to find the name of the Windows machine that the SQL in
stance is running on then you could use "SELECT SERVERPROPERTY('MachineName'
)" or if you're after the name of the SQL instance itself then you could use
"SELECT SERVERPROPERTY('ServerName')", which will return the Windows machin
e name and the SQL instance name.
mike hodgson
http://sqlnerd.blogspot.com
Edward Low wrote:
Hi All,
Is there any ID / Key which identify the server of the SQL Server
installation uniquely? I need this ID to make sure the database installed in
a SQL server can't be transferred to other SQL Server, for licencing issues.
Or, is there other ways to achieve this?
Thanks & Regards,
Edward
Sunday, February 26, 2012
Get report server functional is not very clear could someone explain the security requirements?
We have reports server installed using the local system account when we try to access through web browrse we get and error that say that we need to go to the local system and view the event log. In the system event log there are lots of error that are complaining about dcom object not having permission and in the application log we are getting errors also I have tried to find some documentation that explains the set up requirements and have found lots of disconnect documents that do not give a good explanation of how to setup the accounts needed. I have been able to develop some very nice reports use BI studio but can seem to deploy them and we are unable to use report builder. Any help would be greatly apprecaited.. How do we get this enviroment correct...? When report server was installed it was installed using the local account and with the all other defaults. I'm sure that the issue is some sort of security problem but have no idea what I have to do get past this problem.. Also can you point me to a document that has the minium account requirments to be able to run this service? Or any other documentation that may be more complete and less fragmented that online books..
SQL server was installed using mixed security.
Is there a good book that explains this stuff?
I would try opening the Reporing Services Configuration Manager in the Windows Service Identity tab, and change the authentication to either a local windows domain account or an active directory domain account. Then try again and see what happens.|||I still get the following errorEventType sql90exception, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 reportingservicesnativeclient.ni.dll, P5 2005.90.1399.0, P6 43e29533, P7 0, P8 00005253, P9 00000000, P10 NIL.
|||I don't really know where to go from there. If you have all components running on your local server (SQL 2005, Reporting Services, IIS), I would think using a local Administrator account should work, and then you could back off from there to lower security once you have it working. Maybe it isn't a security issue. Sorry I couldn't be more help.|||Hello,
I've same error as your's, but before ReportServer works fine and now after changind IP adress I get an error
EventType sql90exception, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 reportingservicesnativeclient.ni.dll, P5 2005.90.1399.0, P6 443ccc82, P7 ...
No solution, I search !!!!
Do you solve your problem ?
Get report server functional is not very clear could someone explain the security requiremen
We have reports server installed using the local system account when we try to access through web browrse we get and error that say that we need to go to the local system and view the event log. In the system event log there are lots of error that are complaining about dcom object not having permission and in the application log we are getting errors also I have tried to find some documentation that explains the set up requirements and have found lots of disconnect documents that do not give a good explanation of how to setup the accounts needed. I have been able to develop some very nice reports use BI studio but can seem to deploy them and we are unable to use report builder. Any help would be greatly apprecaited.. How do we get this enviroment correct...? When report server was installed it was installed using the local account and with the all other defaults. I'm sure that the issue is some sort of security problem but have no idea what I have to do get past this problem.. Also can you point me to a document that has the minium account requirments to be able to run this service? Or any other documentation that may be more complete and less fragmented that online books..
SQL server was installed using mixed security.
Is there a good book that explains this stuff?
I would try opening the Reporing Services Configuration Manager in the Windows Service Identity tab, and change the authentication to either a local windows domain account or an active directory domain account. Then try again and see what happens.|||I still get the following errorEventType sql90exception, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 reportingservicesnativeclient.ni.dll, P5 2005.90.1399.0, P6 43e29533, P7 0, P8 00005253, P9 00000000, P10 NIL.
|||I don't really know where to go from there. If you have all components running on your local server (SQL 2005, Reporting Services, IIS), I would think using a local Administrator account should work, and then you could back off from there to lower security once you have it working. Maybe it isn't a security issue. Sorry I couldn't be more help.|||Hello,
I've same error as your's, but before ReportServer works fine and now after changind IP adress I get an error
EventType sql90exception, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 reportingservicesnativeclient.ni.dll, P5 2005.90.1399.0, P6 443ccc82, P7 ...
No solution, I search !!!!
Do you solve your problem ?