Hello,
I have a MS Windows 2003 server with SQLEXPRESS 2005 running on it. I can
work with the SQL management studio on that machine in my database but not
with a remote desktop. On that server there's also a website www.abc.com
Where can I find enough info to make a connection from within this website
(an ASP.NET *.aspx) to my xyz.mdf database on that server in SQLEXPRESS. I'm
trying for several weeks now and I can't get this thing running.
Thanks for any help on this !
Benny
I am not sure i grasped the issue correctly but have a look at these Express
related articles, especially the remote access ones.
http://msdn2.microsoft.com/en-us/library/ms345154.aspx Express Overview
http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
with MSDE
http://msdn2.microsoft.com/en-us/library/bb264564.aspx User Instances
http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
for Remote Access
https://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
Configuring Remote Access
http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
remote access
http://msdn2.microsoft.com/en-us/library/bb264562.aspx Embedding Express in
Apps
http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&DisplayLang=en
SSMS Express
http://blogs.msdn.com/rogerwolterblog/archive/2006/04/13/575974.aspx
Backing up Express
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:UDC0i.168283$vc6.1048670@.phobos.telenet-ops.be...
> Hello,
> I have a MS Windows 2003 server with SQLEXPRESS 2005 running on it. I can
> work with the SQL management studio on that machine in my database but not
> with a remote desktop. On that server there's also a website www.abc.com
> Where can I find enough info to make a connection from within this website
> (an ASP.NET *.aspx) to my xyz.mdf database on that server in SQLEXPRESS.
> I'm trying for several weeks now and I can't get this thing running.
> Thanks for any help on this !
> Benny
>
|||Hi,
thanks a lot for your information, it's helped me a lot! Now i only get the
error :
Cannot open database "abc" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Greetings,
Benny
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
news:unQdmywkHHA.3472@.TK2MSFTNGP04.phx.gbl...
>I am not sure i grasped the issue correctly but have a look at these
>Express related articles, especially the remote access ones.
> http://msdn2.microsoft.com/en-us/library/ms345154.aspx Express Overview
> http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
> with MSDE
> http://msdn2.microsoft.com/en-us/library/bb264564.aspx User Instances
> http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
> for Remote Access
> https://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
> Configuring Remote Access
> http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
> remote access
> http://msdn2.microsoft.com/en-us/library/bb264562.aspx Embedding Express
> in Apps
> http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&DisplayLang=en
> SSMS Express
> http://blogs.msdn.com/rogerwolterblog/archive/2006/04/13/575974.aspx
> Backing up Express
> --
> Andrew J. Kelly SQL MVP
> "BenCoo" <teddyb58@.hotmail.com> wrote in message
> news:UDC0i.168283$vc6.1048670@.phobos.telenet-ops.be...
>
|||I am not an Express expert so hopefully someone else will jump in if I am
wrong. But it sounds like you are connecting with Windows Authentication and
that account is not setup as a login or does not have the permissions to
that db. Login with sa or an sa account with the Express Management utility
and ensure that account is setup as a proper login and has rights to that
db.
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:T7I0i.168773$rm4.1182860@.phobos.telenet-ops.be...
> Hi,
> thanks a lot for your information, it's helped me a lot! Now i only get
> the error :
> Cannot open database "abc" requested by the login. The login failed.
> Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
> Greetings,
> Benny
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
> news:unQdmywkHHA.3472@.TK2MSFTNGP04.phx.gbl...
>
|||Hello Andrew,
"sa" or an "sa account" I don't understand...
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
news:u2GnyozkHHA.4772@.TK2MSFTNGP05.phx.gbl...
>I am not an Express expert so hopefully someone else will jump in if I am
>wrong. But it sounds like you are connecting with Windows Authentication
>and that account is not setup as a login or does not have the permissions
>to that db. Login with sa or an sa account with the Express Management
>utility and ensure that account is setup as a proper login and has rights
>to that db.
> --
> Andrew J. Kelly SQL MVP
> "BenCoo" <teddyb58@.hotmail.com> wrote in message
> news:T7I0i.168773$rm4.1182860@.phobos.telenet-ops.be...
>
|||sa is the SQL Login and system admin role for SQL Server. You can have other
logins in the sa role as well. I am suggesting you use one of those Logins
that are in the sa role (if not sa itself) to log into SQL Server and check
to ensure that windows account has proper access.
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:Gkj1i.172312$Kn2.1218667@.phobos.telenet-ops.be...
> Hello Andrew,
> "sa" or an "sa account" I don't understand...
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
> news:u2GnyozkHHA.4772@.TK2MSFTNGP05.phx.gbl...
>
Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts
Thursday, March 29, 2012
Finding information abour connecting to SQLEXPRESS on remote webserver
Hello,
I have a MS Windows 2003 server with SQLEXPRESS 2005 running on it. I can
work with the SQL management studio on that machine in my database but not
with a remote desktop. On that server there's also a website www.abc.com
Where can I find enough info to make a connection from within this website
(an ASP.NET *.aspx) to my xyz.mdf database on that server in SQLEXPRESS. I'm
trying for several weeks now and I can't get this thing running.
Thanks for any help on this !
BennyI am not sure i grasped the issue correctly but have a look at these Express
related articles, especially the remote access ones.
http://msdn2.microsoft.com/en-us/library/ms345154.aspx Express Overview
http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
with MSDE
http://msdn2.microsoft.com/en-us/library/bb264564.aspx User Instances
http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
for Remote Access
https://blogs.msdn.com/sqlexpress/a.../05/415084.aspx
Configuring Remote Access
http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
remote access
http://msdn2.microsoft.com/en-us/library/bb264562.aspx Embedding Express in
Apps
http://www.microsoft.com/downloads/...&DisplayLang=en
SSMS Express
http://blogs.msdn.com/rogerwolterbl.../13/575974.aspx
Backing up Express
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:UDC0i.168283$vc6.1048670@.phobos.telenet-ops.be...
> Hello,
> I have a MS Windows 2003 server with SQLEXPRESS 2005 running on it. I can
> work with the SQL management studio on that machine in my database but not
> with a remote desktop. On that server there's also a website www.abc.com
> Where can I find enough info to make a connection from within this website
> (an ASP.NET *.aspx) to my xyz.mdf database on that server in SQLEXPRESS.
> I'm trying for several weeks now and I can't get this thing running.
> Thanks for any help on this !
> Benny
>|||Hi,
thanks a lot for your information, it's helped me a lot! Now i only get the
error :
Cannot open database "abc" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Greetings,
Benny
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
news:unQdmywkHHA.3472@.TK2MSFTNGP04.phx.gbl...
>I am not sure i grasped the issue correctly but have a look at these
>Express related articles, especially the remote access ones.
> http://msdn2.microsoft.com/en-us/library/ms345154.aspx Express Overview
> http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
> with MSDE
> http://msdn2.microsoft.com/en-us/library/bb264564.aspx User Instances
> http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
> for Remote Access
> https://blogs.msdn.com/sqlexpress/a.../05/415084.aspx
> Configuring Remote Access
> http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
> remote access
> http://msdn2.microsoft.com/en-us/library/bb264562.aspx Embedding Express
> in Apps
> http://www.microsoft.com/downloads/...&DisplayLang=en
> SSMS Express
> http://blogs.msdn.com/rogerwolterbl.../13/575974.aspx
> Backing up Express
> --
> Andrew J. Kelly SQL MVP
> "BenCoo" <teddyb58@.hotmail.com> wrote in message
> news:UDC0i.168283$vc6.1048670@.phobos.telenet-ops.be...
>|||I am not an Express expert so hopefully someone else will jump in if I am
wrong. But it sounds like you are connecting with Windows Authentication and
that account is not setup as a login or does not have the permissions to
that db. Login with sa or an sa account with the Express Management utility
and ensure that account is setup as a proper login and has rights to that
db.
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:T7I0i.168773$rm4.1182860@.phobos.telenet-ops.be...
> Hi,
> thanks a lot for your information, it's helped me a lot! Now i only get
> the error :
> Cannot open database "abc" requested by the login. The login failed.
> Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
> Greetings,
> Benny
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
> news:unQdmywkHHA.3472@.TK2MSFTNGP04.phx.gbl...
>|||Hello Andrew,
"sa" or an "sa account" I don't understand...
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
news:u2GnyozkHHA.4772@.TK2MSFTNGP05.phx.gbl...
>I am not an Express expert so hopefully someone else will jump in if I am
>wrong. But it sounds like you are connecting with Windows Authentication
>and that account is not setup as a login or does not have the permissions
>to that db. Login with sa or an sa account with the Express Management
>utility and ensure that account is setup as a proper login and has rights
>to that db.
> --
> Andrew J. Kelly SQL MVP
> "BenCoo" <teddyb58@.hotmail.com> wrote in message
> news:T7I0i.168773$rm4.1182860@.phobos.telenet-ops.be...
>|||sa is the SQL Login and system admin role for SQL Server. You can have other
logins in the sa role as well. I am suggesting you use one of those Logins
that are in the sa role (if not sa itself) to log into SQL Server and check
to ensure that windows account has proper access.
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:Gkj1i.172312$Kn2.1218667@.phobos.telenet-ops.be...
> Hello Andrew,
> "sa" or an "sa account" I don't understand...
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
> news:u2GnyozkHHA.4772@.TK2MSFTNGP05.phx.gbl...
>
I have a MS Windows 2003 server with SQLEXPRESS 2005 running on it. I can
work with the SQL management studio on that machine in my database but not
with a remote desktop. On that server there's also a website www.abc.com
Where can I find enough info to make a connection from within this website
(an ASP.NET *.aspx) to my xyz.mdf database on that server in SQLEXPRESS. I'm
trying for several weeks now and I can't get this thing running.
Thanks for any help on this !
BennyI am not sure i grasped the issue correctly but have a look at these Express
related articles, especially the remote access ones.
http://msdn2.microsoft.com/en-us/library/ms345154.aspx Express Overview
http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
with MSDE
http://msdn2.microsoft.com/en-us/library/bb264564.aspx User Instances
http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
for Remote Access
https://blogs.msdn.com/sqlexpress/a.../05/415084.aspx
Configuring Remote Access
http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
remote access
http://msdn2.microsoft.com/en-us/library/bb264562.aspx Embedding Express in
Apps
http://www.microsoft.com/downloads/...&DisplayLang=en
SSMS Express
http://blogs.msdn.com/rogerwolterbl.../13/575974.aspx
Backing up Express
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:UDC0i.168283$vc6.1048670@.phobos.telenet-ops.be...
> Hello,
> I have a MS Windows 2003 server with SQLEXPRESS 2005 running on it. I can
> work with the SQL management studio on that machine in my database but not
> with a remote desktop. On that server there's also a website www.abc.com
> Where can I find enough info to make a connection from within this website
> (an ASP.NET *.aspx) to my xyz.mdf database on that server in SQLEXPRESS.
> I'm trying for several weeks now and I can't get this thing running.
> Thanks for any help on this !
> Benny
>|||Hi,
thanks a lot for your information, it's helped me a lot! Now i only get the
error :
Cannot open database "abc" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Greetings,
Benny
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
news:unQdmywkHHA.3472@.TK2MSFTNGP04.phx.gbl...
>I am not sure i grasped the issue correctly but have a look at these
>Express related articles, especially the remote access ones.
> http://msdn2.microsoft.com/en-us/library/ms345154.aspx Express Overview
> http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
> with MSDE
> http://msdn2.microsoft.com/en-us/library/bb264564.aspx User Instances
> http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
> for Remote Access
> https://blogs.msdn.com/sqlexpress/a.../05/415084.aspx
> Configuring Remote Access
> http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
> remote access
> http://msdn2.microsoft.com/en-us/library/bb264562.aspx Embedding Express
> in Apps
> http://www.microsoft.com/downloads/...&DisplayLang=en
> SSMS Express
> http://blogs.msdn.com/rogerwolterbl.../13/575974.aspx
> Backing up Express
> --
> Andrew J. Kelly SQL MVP
> "BenCoo" <teddyb58@.hotmail.com> wrote in message
> news:UDC0i.168283$vc6.1048670@.phobos.telenet-ops.be...
>|||I am not an Express expert so hopefully someone else will jump in if I am
wrong. But it sounds like you are connecting with Windows Authentication and
that account is not setup as a login or does not have the permissions to
that db. Login with sa or an sa account with the Express Management utility
and ensure that account is setup as a proper login and has rights to that
db.
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:T7I0i.168773$rm4.1182860@.phobos.telenet-ops.be...
> Hi,
> thanks a lot for your information, it's helped me a lot! Now i only get
> the error :
> Cannot open database "abc" requested by the login. The login failed.
> Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
> Greetings,
> Benny
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
> news:unQdmywkHHA.3472@.TK2MSFTNGP04.phx.gbl...
>|||Hello Andrew,
"sa" or an "sa account" I don't understand...
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
news:u2GnyozkHHA.4772@.TK2MSFTNGP05.phx.gbl...
>I am not an Express expert so hopefully someone else will jump in if I am
>wrong. But it sounds like you are connecting with Windows Authentication
>and that account is not setup as a login or does not have the permissions
>to that db. Login with sa or an sa account with the Express Management
>utility and ensure that account is setup as a proper login and has rights
>to that db.
> --
> Andrew J. Kelly SQL MVP
> "BenCoo" <teddyb58@.hotmail.com> wrote in message
> news:T7I0i.168773$rm4.1182860@.phobos.telenet-ops.be...
>|||sa is the SQL Login and system admin role for SQL Server. You can have other
logins in the sa role as well. I am suggesting you use one of those Logins
that are in the sa role (if not sa itself) to log into SQL Server and check
to ensure that windows account has proper access.
Andrew J. Kelly SQL MVP
"BenCoo" <teddyb58@.hotmail.com> wrote in message
news:Gkj1i.172312$Kn2.1218667@.phobos.telenet-ops.be...
> Hello Andrew,
> "sa" or an "sa account" I don't understand...
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> schreef in bericht
> news:u2GnyozkHHA.4772@.TK2MSFTNGP05.phx.gbl...
>
Friday, March 23, 2012
Find Windows/SQL login used by RS
What is the 'supported' way to find out which Windows/SQL login has been
configured for RS to use when it connects to the report server database?
RSconfig.exe doesn't seem to have a read-only option.
LinchiThere isn't one. You can find out by looking at the RSExec role in the
database your using and checking it's members. If you see machine\ASPNET
and builtin\Network Service then you're using the service credentials.
Otherwise you'll see either a domain account or a sql login.
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"Linchi Shea" <linchi_shea@.NOSPAM.ml.com> wrote in message
news:%23liDwCoeEHA.3124@.TK2MSFTNGP09.phx.gbl...
> What is the 'supported' way to find out which Windows/SQL login has been
> configured for RS to use when it connects to the report server database?
> RSconfig.exe doesn't seem to have a read-only option.
> Linchi
>|||Thanks! I guess that's a workaround. There really should be a page in Report
Manager to list all the Report Server configurations.
Linchi
"Lukasz Pawlowski [MSFT]" <lukaszp@.online.microsoft.com> wrote in message
news:eY4Sf$oeEHA.2764@.TK2MSFTNGP11.phx.gbl...
> There isn't one. You can find out by looking at the RSExec role in the
> database your using and checking it's members. If you see machine\ASPNET
> and builtin\Network Service then you're using the service credentials.
> Otherwise you'll see either a domain account or a sql login.
> -Lukasz
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Linchi Shea" <linchi_shea@.NOSPAM.ml.com> wrote in message
> news:%23liDwCoeEHA.3124@.TK2MSFTNGP09.phx.gbl...
> > What is the 'supported' way to find out which Windows/SQL login has been
> > configured for RS to use when it connects to the report server database?
> > RSconfig.exe doesn't seem to have a read-only option.
> >
> > Linchi
> >
> >
>
configured for RS to use when it connects to the report server database?
RSconfig.exe doesn't seem to have a read-only option.
LinchiThere isn't one. You can find out by looking at the RSExec role in the
database your using and checking it's members. If you see machine\ASPNET
and builtin\Network Service then you're using the service credentials.
Otherwise you'll see either a domain account or a sql login.
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"Linchi Shea" <linchi_shea@.NOSPAM.ml.com> wrote in message
news:%23liDwCoeEHA.3124@.TK2MSFTNGP09.phx.gbl...
> What is the 'supported' way to find out which Windows/SQL login has been
> configured for RS to use when it connects to the report server database?
> RSconfig.exe doesn't seem to have a read-only option.
> Linchi
>|||Thanks! I guess that's a workaround. There really should be a page in Report
Manager to list all the Report Server configurations.
Linchi
"Lukasz Pawlowski [MSFT]" <lukaszp@.online.microsoft.com> wrote in message
news:eY4Sf$oeEHA.2764@.TK2MSFTNGP11.phx.gbl...
> There isn't one. You can find out by looking at the RSExec role in the
> database your using and checking it's members. If you see machine\ASPNET
> and builtin\Network Service then you're using the service credentials.
> Otherwise you'll see either a domain account or a sql login.
> -Lukasz
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Linchi Shea" <linchi_shea@.NOSPAM.ml.com> wrote in message
> news:%23liDwCoeEHA.3124@.TK2MSFTNGP09.phx.gbl...
> > What is the 'supported' way to find out which Windows/SQL login has been
> > configured for RS to use when it connects to the report server database?
> > RSconfig.exe doesn't seem to have a read-only option.
> >
> > Linchi
> >
> >
>
Monday, March 19, 2012
Find tables w/o primary keys but w/ unique clustered indexes
Hi
I run SQL Server 2000 SP3 on Windows 2000 SP4.
I want to find out, which "user tables" in my DB don't have
a primary key but do have at least one unique index. I
couldn't find any documented way to do this straight away.
So I came up with the following query, which seems to work:
SELECT OBJECT_NAME(id)
FROM sysindexes
WHERE indid > 0 and indid < 255 and (status & 2048) = 0
and (status & 2) <> 0
Does this query seem to be correct and is there any better
(documented) way of doing what I'm trying to do?
--
Thanks,
OskHow about:
SELECT DISTINCT
table_name,
constraint_name
FROM information_schema.table_constraints c
WHERE constraint_type = 'UNIQUE'
AND NOT EXISTS
(SELECT *
FROM information_schema.table_constraints c1
WHERE C1.table_name = c.table_name
and c1.constraint_type = 'PRIMARY KEY')
AND INDEXPROPERTY(OBJECT_ID(c.table_name), c.constraint_name,
'IsClustered') = 1
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Osk" <anonymous@.discussions.microsoft.com> wrote in message
news:0c7701c5308e$d9b58b50$a401280a@.phx.gbl...
> Hi
> I run SQL Server 2000 SP3 on Windows 2000 SP4.
> I want to find out, which "user tables" in my DB don't have
> a primary key but do have at least one unique index. I
> couldn't find any documented way to do this straight away.
> So I came up with the following query, which seems to work:
> SELECT OBJECT_NAME(id)
> FROM sysindexes
> WHERE indid > 0 and indid < 255 and (status & 2048) = 0
> and (status & 2) <> 0
> Does this query seem to be correct and is there any better
> (documented) way of doing what I'm trying to do?
> --
> Thanks,
> Osk
>|||Try,
select distinct
object_name(a.[id])
from
sysindexes as a
left join
(
select
table_name
from
INFORMATION_SCHEMA.TABLE_CONSTRAINTS
where
constraint_type = 'PRIMARY KEY'
) as b
on object_name(a.[id]) = b.table_name
where
b.table_name is null
and indexproperty(a.[id], [name], 'IsUnique') = 1
and objectproperty(a.[id], 'IsMSShipped') = 0
go
AMB
"Osk" wrote:
> Hi
> I run SQL Server 2000 SP3 on Windows 2000 SP4.
> I want to find out, which "user tables" in my DB don't have
> a primary key but do have at least one unique index. I
> couldn't find any documented way to do this straight away.
> So I came up with the following query, which seems to work:
> SELECT OBJECT_NAME(id)
> FROM sysindexes
> WHERE indid > 0 and indid < 255 and (status & 2048) = 0
> and (status & 2) <> 0
> Does this query seem to be correct and is there any better
> (documented) way of doing what I'm trying to do?
> --
> Thanks,
> Osk
>|||Thanks!
Shame on me - IDEXPROPERTY was the way to go.
>--Original Message--
>Try,
>select distinct
> object_name(a.[id])
>from
> sysindexes as a
> left join
> (
> select
> table_name
> from
> INFORMATION_SCHEMA.TABLE_CONSTRAINTS
> where
> constraint_type = 'PRIMARY KEY'
> ) as b
> on object_name(a.[id]) = b.table_name
>where
> b.table_name is null
> and indexproperty(a.[id], [name], 'IsUnique') = 1
> and objectproperty(a.[id], 'IsMSShipped') = 0
>go
>
>AMB
>"Osk" wrote:
>> Hi
>> I run SQL Server 2000 SP3 on Windows 2000 SP4.
>> I want to find out, which "user tables" in my DB don't have
>> a primary key but do have at least one unique index. I
>> couldn't find any documented way to do this straight away.
>> So I came up with the following query, which seems to work:
>> SELECT OBJECT_NAME(id)
>> FROM sysindexes
>> WHERE indid > 0 and indid < 255 and (status & 2048) = 0
>> and (status & 2) <> 0
>> Does this query seem to be correct and is there any better
>> (documented) way of doing what I'm trying to do?
>> --
>> Thanks,
>> Osk
>>
>.
>|||Thanks, Adam.
Still, I wasn't exactly looking for tables with UNIQUE
constraints but rather - with UNIQUE indexes.
>--Original Message--
>How about:
>SELECT DISTINCT
> table_name,
> constraint_name
>FROM information_schema.table_constraints c
>WHERE constraint_type = 'UNIQUE'
> AND NOT EXISTS
> (SELECT *
> FROM information_schema.table_constraints c1
> WHERE C1.table_name = c.table_name
> and c1.constraint_type = 'PRIMARY KEY')
> AND INDEXPROPERTY(OBJECT_ID(c.table_name), c.constraint_name,
>'IsClustered') = 1
>
>--
>Adam Machanic
>SQL Server MVP
>http://www.datamanipulation.net
>--
>
>"Osk" <anonymous@.discussions.microsoft.com> wrote in message
>news:0c7701c5308e$d9b58b50$a401280a@.phx.gbl...
>> Hi
>> I run SQL Server 2000 SP3 on Windows 2000 SP4.
>> I want to find out, which "user tables" in my DB don't have
>> a primary key but do have at least one unique index. I
>> couldn't find any documented way to do this straight away.
>> So I came up with the following query, which seems to work:
>> SELECT OBJECT_NAME(id)
>> FROM sysindexes
>> WHERE indid > 0 and indid < 255 and (status & 2048) = 0
>> and (status & 2) <> 0
>> Does this query seem to be correct and is there any better
>> (documented) way of doing what I'm trying to do?
>> --
>> Thanks,
>> Osk
>
>.
>|||Lookup the meta data function OBJECTPROPERTY and its various possible values
for the second argument in SQL Server Books Online. You can get the list
using:
SELECT name
FROM sysobjects
WHERE s1.xtype = 'U'
AND OBJECTPROPERTY( id, 'TableHasUniqueCnst' ) = 1
AND OBJECTPROPERTY( id, 'TableHasPrimaryKey' ) = 0 ;
Alternatively, you can also use INFORMATION_SCHEMA views instead of
accessing the system table directly.
--
Anith|||Yes, Anith, thanks!
Though initially I wasn't really interested in finding
tables with UNIQUE constraints but rather with UNIQUE
indexes, which is not the same, is it?
>--Original Message--
>Lookup the meta data function OBJECTPROPERTY and its
various possible values
>for the second argument in SQL Server Books Online. You
can get the list
>using:
>SELECT name
> FROM sysobjects
> WHERE s1.xtype = 'U'
> AND OBJECTPROPERTY( id, 'TableHasUniqueCnst' ) = 1
> AND OBJECTPROPERTY( id, 'TableHasPrimaryKey' ) = 0 ;
>Alternatively, you can also use INFORMATION_SCHEMA views
instead of
>accessing the system table directly.
>--
>Anith
>
>.
>
I run SQL Server 2000 SP3 on Windows 2000 SP4.
I want to find out, which "user tables" in my DB don't have
a primary key but do have at least one unique index. I
couldn't find any documented way to do this straight away.
So I came up with the following query, which seems to work:
SELECT OBJECT_NAME(id)
FROM sysindexes
WHERE indid > 0 and indid < 255 and (status & 2048) = 0
and (status & 2) <> 0
Does this query seem to be correct and is there any better
(documented) way of doing what I'm trying to do?
--
Thanks,
OskHow about:
SELECT DISTINCT
table_name,
constraint_name
FROM information_schema.table_constraints c
WHERE constraint_type = 'UNIQUE'
AND NOT EXISTS
(SELECT *
FROM information_schema.table_constraints c1
WHERE C1.table_name = c.table_name
and c1.constraint_type = 'PRIMARY KEY')
AND INDEXPROPERTY(OBJECT_ID(c.table_name), c.constraint_name,
'IsClustered') = 1
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Osk" <anonymous@.discussions.microsoft.com> wrote in message
news:0c7701c5308e$d9b58b50$a401280a@.phx.gbl...
> Hi
> I run SQL Server 2000 SP3 on Windows 2000 SP4.
> I want to find out, which "user tables" in my DB don't have
> a primary key but do have at least one unique index. I
> couldn't find any documented way to do this straight away.
> So I came up with the following query, which seems to work:
> SELECT OBJECT_NAME(id)
> FROM sysindexes
> WHERE indid > 0 and indid < 255 and (status & 2048) = 0
> and (status & 2) <> 0
> Does this query seem to be correct and is there any better
> (documented) way of doing what I'm trying to do?
> --
> Thanks,
> Osk
>|||Try,
select distinct
object_name(a.[id])
from
sysindexes as a
left join
(
select
table_name
from
INFORMATION_SCHEMA.TABLE_CONSTRAINTS
where
constraint_type = 'PRIMARY KEY'
) as b
on object_name(a.[id]) = b.table_name
where
b.table_name is null
and indexproperty(a.[id], [name], 'IsUnique') = 1
and objectproperty(a.[id], 'IsMSShipped') = 0
go
AMB
"Osk" wrote:
> Hi
> I run SQL Server 2000 SP3 on Windows 2000 SP4.
> I want to find out, which "user tables" in my DB don't have
> a primary key but do have at least one unique index. I
> couldn't find any documented way to do this straight away.
> So I came up with the following query, which seems to work:
> SELECT OBJECT_NAME(id)
> FROM sysindexes
> WHERE indid > 0 and indid < 255 and (status & 2048) = 0
> and (status & 2) <> 0
> Does this query seem to be correct and is there any better
> (documented) way of doing what I'm trying to do?
> --
> Thanks,
> Osk
>|||Thanks!
Shame on me - IDEXPROPERTY was the way to go.
>--Original Message--
>Try,
>select distinct
> object_name(a.[id])
>from
> sysindexes as a
> left join
> (
> select
> table_name
> from
> INFORMATION_SCHEMA.TABLE_CONSTRAINTS
> where
> constraint_type = 'PRIMARY KEY'
> ) as b
> on object_name(a.[id]) = b.table_name
>where
> b.table_name is null
> and indexproperty(a.[id], [name], 'IsUnique') = 1
> and objectproperty(a.[id], 'IsMSShipped') = 0
>go
>
>AMB
>"Osk" wrote:
>> Hi
>> I run SQL Server 2000 SP3 on Windows 2000 SP4.
>> I want to find out, which "user tables" in my DB don't have
>> a primary key but do have at least one unique index. I
>> couldn't find any documented way to do this straight away.
>> So I came up with the following query, which seems to work:
>> SELECT OBJECT_NAME(id)
>> FROM sysindexes
>> WHERE indid > 0 and indid < 255 and (status & 2048) = 0
>> and (status & 2) <> 0
>> Does this query seem to be correct and is there any better
>> (documented) way of doing what I'm trying to do?
>> --
>> Thanks,
>> Osk
>>
>.
>|||Thanks, Adam.
Still, I wasn't exactly looking for tables with UNIQUE
constraints but rather - with UNIQUE indexes.
>--Original Message--
>How about:
>SELECT DISTINCT
> table_name,
> constraint_name
>FROM information_schema.table_constraints c
>WHERE constraint_type = 'UNIQUE'
> AND NOT EXISTS
> (SELECT *
> FROM information_schema.table_constraints c1
> WHERE C1.table_name = c.table_name
> and c1.constraint_type = 'PRIMARY KEY')
> AND INDEXPROPERTY(OBJECT_ID(c.table_name), c.constraint_name,
>'IsClustered') = 1
>
>--
>Adam Machanic
>SQL Server MVP
>http://www.datamanipulation.net
>--
>
>"Osk" <anonymous@.discussions.microsoft.com> wrote in message
>news:0c7701c5308e$d9b58b50$a401280a@.phx.gbl...
>> Hi
>> I run SQL Server 2000 SP3 on Windows 2000 SP4.
>> I want to find out, which "user tables" in my DB don't have
>> a primary key but do have at least one unique index. I
>> couldn't find any documented way to do this straight away.
>> So I came up with the following query, which seems to work:
>> SELECT OBJECT_NAME(id)
>> FROM sysindexes
>> WHERE indid > 0 and indid < 255 and (status & 2048) = 0
>> and (status & 2) <> 0
>> Does this query seem to be correct and is there any better
>> (documented) way of doing what I'm trying to do?
>> --
>> Thanks,
>> Osk
>
>.
>|||Lookup the meta data function OBJECTPROPERTY and its various possible values
for the second argument in SQL Server Books Online. You can get the list
using:
SELECT name
FROM sysobjects
WHERE s1.xtype = 'U'
AND OBJECTPROPERTY( id, 'TableHasUniqueCnst' ) = 1
AND OBJECTPROPERTY( id, 'TableHasPrimaryKey' ) = 0 ;
Alternatively, you can also use INFORMATION_SCHEMA views instead of
accessing the system table directly.
--
Anith|||Yes, Anith, thanks!
Though initially I wasn't really interested in finding
tables with UNIQUE constraints but rather with UNIQUE
indexes, which is not the same, is it?
>--Original Message--
>Lookup the meta data function OBJECTPROPERTY and its
various possible values
>for the second argument in SQL Server Books Online. You
can get the list
>using:
>SELECT name
> FROM sysobjects
> WHERE s1.xtype = 'U'
> AND OBJECTPROPERTY( id, 'TableHasUniqueCnst' ) = 1
> AND OBJECTPROPERTY( id, 'TableHasPrimaryKey' ) = 0 ;
>Alternatively, you can also use INFORMATION_SCHEMA views
instead of
>accessing the system table directly.
>--
>Anith
>
>.
>
Monday, March 12, 2012
Find out users in a particular Windows group ?
We have our admins create groups containing Windows users ... Is there a
way to check through SQL which members belong to that group ? Using SQL 2000Hi Hassan,
SQL Server doesn't store which Windows users are in a Windows group. So the
only way to find out is to use the command shell with something like (I
don't know the exact syntax of the NET command):
EXEC xp_cmdshell 'NET GROUP <group name> /DOMAIN'
--
Jacco Schalkwijk
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:e5a3$$rxDHA.1996@.TK2MSFTNGP12.phx.gbl...
> We have our admins create groups containing Windows users ... Is there a
> way to check through SQL which members belong to that group ? Using SQL
2000
>
way to check through SQL which members belong to that group ? Using SQL 2000Hi Hassan,
SQL Server doesn't store which Windows users are in a Windows group. So the
only way to find out is to use the command shell with something like (I
don't know the exact syntax of the NET command):
EXEC xp_cmdshell 'NET GROUP <group name> /DOMAIN'
--
Jacco Schalkwijk
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:e5a3$$rxDHA.1996@.TK2MSFTNGP12.phx.gbl...
> We have our admins create groups containing Windows users ... Is there a
> way to check through SQL which members belong to that group ? Using SQL
2000
>
Friday, March 9, 2012
Find out how much data was replicated
Hi
I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
SP4. I've set up a transactional replication w/o updating
between two servers, one of which is a publisher and the
other is a distributor/pull-subscriber. I wonder if SQL
Server has means of finding out how much data was
replicated (i.e. sent to the subscriber), say, during the
day. If it hasn't, are there any third-party tools, which
would allow me to do this?
--
Many thanks,
Oskcheck the replication monitor in EM it will display a "gross" level of
information processed by article published.
"Osk" wrote:
> Hi
> I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
> SP4. I've set up a transactional replication w/o updating
> between two servers, one of which is a publisher and the
> other is a distributor/pull-subscriber. I wonder if SQL
> Server has means of finding out how much data was
> replicated (i.e. sent to the subscriber), say, during the
> day. If it hasn't, are there any third-party tools, which
> would allow me to do this?
> --
> Many thanks,
> Osk
>|||Hi
What do you mean by "gross" level? I need to know how much
bytes were delivered to the subscriber during a time interval.
--
Thanks,
Osk
>--Original Message--
>check the replication monitor in EM it will display a
"gross" level of
>information processed by article published.
>"Osk" wrote:
>> Hi
>> I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
>> SP4. I've set up a transactional replication w/o updating
>> between two servers, one of which is a publisher and the
>> other is a distributor/pull-subscriber. I wonder if SQL
>> Server has means of finding out how much data was
>> replicated (i.e. sent to the subscriber), say, during the
>> day. If it hasn't, are there any third-party tools, which
>> would allow me to do this?
>> --
>> Many thanks,
>> Osk
>>
>.
>
I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
SP4. I've set up a transactional replication w/o updating
between two servers, one of which is a publisher and the
other is a distributor/pull-subscriber. I wonder if SQL
Server has means of finding out how much data was
replicated (i.e. sent to the subscriber), say, during the
day. If it hasn't, are there any third-party tools, which
would allow me to do this?
--
Many thanks,
Oskcheck the replication monitor in EM it will display a "gross" level of
information processed by article published.
"Osk" wrote:
> Hi
> I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
> SP4. I've set up a transactional replication w/o updating
> between two servers, one of which is a publisher and the
> other is a distributor/pull-subscriber. I wonder if SQL
> Server has means of finding out how much data was
> replicated (i.e. sent to the subscriber), say, during the
> day. If it hasn't, are there any third-party tools, which
> would allow me to do this?
> --
> Many thanks,
> Osk
>|||Hi
What do you mean by "gross" level? I need to know how much
bytes were delivered to the subscriber during a time interval.
--
Thanks,
Osk
>--Original Message--
>check the replication monitor in EM it will display a
"gross" level of
>information processed by article published.
>"Osk" wrote:
>> Hi
>> I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
>> SP4. I've set up a transactional replication w/o updating
>> between two servers, one of which is a publisher and the
>> other is a distributor/pull-subscriber. I wonder if SQL
>> Server has means of finding out how much data was
>> replicated (i.e. sent to the subscriber), say, during the
>> day. If it hasn't, are there any third-party tools, which
>> would allow me to do this?
>> --
>> Many thanks,
>> Osk
>>
>.
>
Labels:
advanced,
database,
microsoft,
mysql,
oracle,
replicated,
replication,
server,
servers,
sp3,
sp4,
sql,
transactional,
updating,
windows
Find out how much data was replicated
Hi
I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
SP4. I've set up a transactional replication w/o updating
between two servers, one of which is a publisher and the
other is a distributor/pull-subscriber. I wonder if SQL
Server has means of finding out how much data was
replicated (i.e. sent to the subscriber), say, during the
day. If it hasn't, are there any third-party tools, which
would allow me to do this?
Many thanks,
Oskcheck the replication monitor in EM it will display a "gross" level of
information processed by article published.
"Osk" wrote:
> Hi
> I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
> SP4. I've set up a transactional replication w/o updating
> between two servers, one of which is a publisher and the
> other is a distributor/pull-subscriber. I wonder if SQL
> Server has means of finding out how much data was
> replicated (i.e. sent to the subscriber), say, during the
> day. If it hasn't, are there any third-party tools, which
> would allow me to do this?
> --
> Many thanks,
> Osk
>|||Hi
What do you mean by "gross" level? I need to know how much
bytes were delivered to the subscriber during a time interval.
Thanks,
Osk
>--Original Message--
>check the replication monitor in EM it will display a
"gross" level of
>information processed by article published.
>"Osk" wrote:
>
>.
>
I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
SP4. I've set up a transactional replication w/o updating
between two servers, one of which is a publisher and the
other is a distributor/pull-subscriber. I wonder if SQL
Server has means of finding out how much data was
replicated (i.e. sent to the subscriber), say, during the
day. If it hasn't, are there any third-party tools, which
would allow me to do this?
Many thanks,
Oskcheck the replication monitor in EM it will display a "gross" level of
information processed by article published.
"Osk" wrote:
> Hi
> I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
> SP4. I've set up a transactional replication w/o updating
> between two servers, one of which is a publisher and the
> other is a distributor/pull-subscriber. I wonder if SQL
> Server has means of finding out how much data was
> replicated (i.e. sent to the subscriber), say, during the
> day. If it hasn't, are there any third-party tools, which
> would allow me to do this?
> --
> Many thanks,
> Osk
>|||Hi
What do you mean by "gross" level? I need to know how much
bytes were delivered to the subscriber during a time interval.
Thanks,
Osk
>--Original Message--
>check the replication monitor in EM it will display a
"gross" level of
>information processed by article published.
>"Osk" wrote:
>
>.
>
Labels:
advanced,
database,
hii,
microsoft,
mysql,
oracle,
replicated,
replication,
server,
servers,
serversp4,
sp3,
sql,
transactional,
updatingbetween,
windows
Find out how much data was replicated
Hi
I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
SP4. I've set up a transactional replication w/o updating
between two servers, one of which is a publisher and the
other is a distributor/pull-subscriber. I wonder if SQL
Server has means of finding out how much data was
replicated (i.e. sent to the subscriber), say, during the
day. If it hasn't, are there any third-party tools, which
would allow me to do this?
Many thanks,
Osk
check the replication monitor in EM it will display a "gross" level of
information processed by article published.
"Osk" wrote:
> Hi
> I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
> SP4. I've set up a transactional replication w/o updating
> between two servers, one of which is a publisher and the
> other is a distributor/pull-subscriber. I wonder if SQL
> Server has means of finding out how much data was
> replicated (i.e. sent to the subscriber), say, during the
> day. If it hasn't, are there any third-party tools, which
> would allow me to do this?
> --
> Many thanks,
> Osk
>
|||Hi
What do you mean by "gross" level? I need to know how much
bytes were delivered to the subscriber during a time interval.
Thanks,
Osk
>--Original Message--
>check the replication monitor in EM it will display a
"gross" level of
>information processed by article published.
>"Osk" wrote:
>.
>
I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
SP4. I've set up a transactional replication w/o updating
between two servers, one of which is a publisher and the
other is a distributor/pull-subscriber. I wonder if SQL
Server has means of finding out how much data was
replicated (i.e. sent to the subscriber), say, during the
day. If it hasn't, are there any third-party tools, which
would allow me to do this?
Many thanks,
Osk
check the replication monitor in EM it will display a "gross" level of
information processed by article published.
"Osk" wrote:
> Hi
> I use SQL Servers 2000 SP3 on Windows 2000 Advanced Server
> SP4. I've set up a transactional replication w/o updating
> between two servers, one of which is a publisher and the
> other is a distributor/pull-subscriber. I wonder if SQL
> Server has means of finding out how much data was
> replicated (i.e. sent to the subscriber), say, during the
> day. If it hasn't, are there any third-party tools, which
> would allow me to do this?
> --
> Many thanks,
> Osk
>
|||Hi
What do you mean by "gross" level? I need to know how much
bytes were delivered to the subscriber during a time interval.
Thanks,
Osk
>--Original Message--
>check the replication monitor in EM it will display a
"gross" level of
>information processed by article published.
>"Osk" wrote:
>.
>
Labels:
advanced,
database,
hii,
ive,
microsoft,
mysql,
oracle,
replicated,
replication,
server,
servers,
serversp4,
sp3,
sql,
transactional,
updatingbetween,
windows
Sunday, February 26, 2012
Find an associated user
I am trying to copy a database that is on a Windows 2000 box to one
that is on Windows 2003. Is there a way to export a list of server
login names? I am having problems with one I am trying to create where
on the old server using Teratrax I can see that it is an associated
user Name, but I don't know which user it is associated with. Is there
a command that can tell me which user the account is associated with?
It definitely isn't a domain user and isn't a local account. It says
that the user is a SQl user but I can't seem to find where the
association is.
hi Mark,
"Mark Constant" <constants@.mix-net.net> ha scritto nel messaggio
news:ce43fdea.0412011310.6ac9ef82@.posting.google.c om
> I am trying to copy a database that is on a Windows 2000 box to one
> that is on Windows 2003. Is there a way to export a list of server
> login names? I am having problems with one I am trying to create where
> on the old server using Teratrax I can see that it is an associated
> user Name, but I don't know which user it is associated with. Is there
> a command that can tell me which user the account is associated with?
> It definitely isn't a domain user and isn't a local account. It says
> that the user is a SQl user but I can't seem to find where the
> association is.
SET NOCOUNT ON
USE TEMPDB
PRINT 'adding SQL Server Login [x] to [' + DB_NAME() + '] as [x_user] in the
[db_datareader] database role'
EXEC sp_adduser 'x', 'x_user', 'db_datareader'
PRINT 'grandting [x_user] in [' + DB_NAME() + '] database [db_datawriter]
database role membership'
EXEC sp_addrolemember @.rolename = 'db_datawriter' , @.membername = 'x_user'
PRINT 'listing all [' + DB_NAME() + '] database users'
EXEC sp_helpuser
PRINT 'listing [' + DB_NAME() + '] database [x_user] user''s database role
membership'
EXEC sp_helpuser 'x_user'
PRINT 'Dropping [x_user] user from [' + DB_NAME() + '] database'
EXEC sp_dropuser 'x_user'
which results to
adding SQL Server Login [x] to [tempdb] as [x_user] in the [db_datareader]
database role
Granted database access to 'x'.
'x_user' added to role 'db_datareader'.
grandting [x_user] in [tempdb] database [db_datawriter] database role
membership
'x_user' added to role 'db_datawriter'.
listing all [tempdb] database users
UserName GroupName LoginName DefDBName UserID SID
-- -- -- -- -- --
----
dbo db_owner sa master 1 0x01
x_user db_datareader x a 5
0x67F945E170B2574AA8DCB909B68D46A9
x_user db_datawriter x a 5
0x67F945E170B2574AA8DCB909B68D46A9
listing [tempdb] database [x_user] user's database role membership
UserName GroupName LoginName DefDBName UserID SID
-- -- -- -- -- --
----
x_user db_datareader x a 5
0x67F945E170B2574AA8DCB909B68D46A9
x_user db_datawriter x a 5
0x67F945E170B2574AA8DCB909B68D46A9
Dropping [x_user] user from [tempdb] database
User has been dropped from current database.
as you can see you can inspect the result of sp_helpuser system store
precedure
(http://msdn.microsoft.com/library/de...-us/tsqlref/ts
_sp_help_45o2.asp) that reports, as long as the user name, the corresponding
Login..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
that is on Windows 2003. Is there a way to export a list of server
login names? I am having problems with one I am trying to create where
on the old server using Teratrax I can see that it is an associated
user Name, but I don't know which user it is associated with. Is there
a command that can tell me which user the account is associated with?
It definitely isn't a domain user and isn't a local account. It says
that the user is a SQl user but I can't seem to find where the
association is.
hi Mark,
"Mark Constant" <constants@.mix-net.net> ha scritto nel messaggio
news:ce43fdea.0412011310.6ac9ef82@.posting.google.c om
> I am trying to copy a database that is on a Windows 2000 box to one
> that is on Windows 2003. Is there a way to export a list of server
> login names? I am having problems with one I am trying to create where
> on the old server using Teratrax I can see that it is an associated
> user Name, but I don't know which user it is associated with. Is there
> a command that can tell me which user the account is associated with?
> It definitely isn't a domain user and isn't a local account. It says
> that the user is a SQl user but I can't seem to find where the
> association is.
SET NOCOUNT ON
USE TEMPDB
PRINT 'adding SQL Server Login [x] to [' + DB_NAME() + '] as [x_user] in the
[db_datareader] database role'
EXEC sp_adduser 'x', 'x_user', 'db_datareader'
PRINT 'grandting [x_user] in [' + DB_NAME() + '] database [db_datawriter]
database role membership'
EXEC sp_addrolemember @.rolename = 'db_datawriter' , @.membername = 'x_user'
PRINT 'listing all [' + DB_NAME() + '] database users'
EXEC sp_helpuser
PRINT 'listing [' + DB_NAME() + '] database [x_user] user''s database role
membership'
EXEC sp_helpuser 'x_user'
PRINT 'Dropping [x_user] user from [' + DB_NAME() + '] database'
EXEC sp_dropuser 'x_user'
which results to
adding SQL Server Login [x] to [tempdb] as [x_user] in the [db_datareader]
database role
Granted database access to 'x'.
'x_user' added to role 'db_datareader'.
grandting [x_user] in [tempdb] database [db_datawriter] database role
membership
'x_user' added to role 'db_datawriter'.
listing all [tempdb] database users
UserName GroupName LoginName DefDBName UserID SID
-- -- -- -- -- --
----
dbo db_owner sa master 1 0x01
x_user db_datareader x a 5
0x67F945E170B2574AA8DCB909B68D46A9
x_user db_datawriter x a 5
0x67F945E170B2574AA8DCB909B68D46A9
listing [tempdb] database [x_user] user's database role membership
UserName GroupName LoginName DefDBName UserID SID
-- -- -- -- -- --
----
x_user db_datareader x a 5
0x67F945E170B2574AA8DCB909B68D46A9
x_user db_datawriter x a 5
0x67F945E170B2574AA8DCB909B68D46A9
Dropping [x_user] user from [tempdb] database
User has been dropped from current database.
as you can see you can inspect the result of sp_helpuser system store
precedure
(http://msdn.microsoft.com/library/de...-us/tsqlref/ts
_sp_help_45o2.asp) that reports, as long as the user name, the corresponding
Login..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
Subscribe to:
Posts (Atom)