Monday, March 26, 2012
Script to list Users with SA Role on the server
System Administrator role assigned to their login. I was wondering if
there is a script or table(s) that I could refer to instead of looking
at all the individual login names. We are using SQL Server 2000.
Any help on this regard will be greatly appreciated.
ThanksYou can use the Stored Procedure sp_helpsrvrolemember to view the members of
a fixed server role.
ie.
EXEC sp_helpsrvrolemember 'sysadmin'
- Peter Ward
WARDY IT Solutions
"shub" wrote:
> I am wanting to get a list of all the users on a SERVER who has the
> System Administrator role assigned to their login. I was wondering if
> there is a script or table(s) that I could refer to instead of looking
> at all the individual login names. We are using SQL Server 2000.
> Any help on this regard will be greatly appreciated.
> Thanks
>
Script to list Users with SA Role on the server
System Administrator role assigned to their login. I was wondering if
there is a script or table(s) that I could refer to instead of looking
at all the individual login names. We are using SQL Server 2000.
Any help on this regard will be greatly appreciated.
Thanks
You can use the Stored Procedure sp_helpsrvrolemember to view the members of
a fixed server role.
ie.
EXEC sp_helpsrvrolemember 'sysadmin'
- Peter Ward
WARDY IT Solutions
"shub" wrote:
> I am wanting to get a list of all the users on a SERVER who has the
> System Administrator role assigned to their login. I was wondering if
> there is a script or table(s) that I could refer to instead of looking
> at all the individual login names. We are using SQL Server 2000.
> Any help on this regard will be greatly appreciated.
> Thanks
>
Script to list Users with SA Role on the server
System Administrator role assigned to their login. I was wondering if
there is a script or table(s) that I could refer to instead of looking
at all the individual login names. We are using SQL Server 2000.
Any help on this regard will be greatly appreciated.
ThanksYou can use the Stored Procedure sp_helpsrvrolemember to view the members of
a fixed server role.
ie.
EXEC sp_helpsrvrolemember 'sysadmin'
- Peter Ward
WARDY IT Solutions
"shub" wrote:
> I am wanting to get a list of all the users on a SERVER who has the
> System Administrator role assigned to their login. I was wondering if
> there is a script or table(s) that I could refer to instead of looking
> at all the individual login names. We are using SQL Server 2000.
> Any help on this regard will be greatly appreciated.
> Thanks
>
Monday, March 12, 2012
script for login transfer from one phy server to another
Do you have any idea about the procedure for transferring the logins and password from source server to the destination server.
scenario is as follows
serv - A wanto transfer to ms sql 2000 server - B
running on 6.5 ------------> will be sql2k
(Old server) (new server)
will appriciate if any weblink containg the check list.
with best regards
ranjanI have a script that generates SQL for recreating logins, user, roles, and permissions on SQL 2000 databases. It may run on your 6.5 database.
It will not, however, restore passwords, and I'm not sure you can do this.
Have you thought about running the upgrade on your 6.5 databases (or a copy of them)? It's been a while, but I think this retains the old passwords.
blindman|||Thanx for reply,
Detail of my upgradation plan -
- I am planning to upgrade my db server (mssql-6.5) to server
(mssql2k) on the same machine.
- I have prepared the checklist for that , Only thing I want is a script
which will take care of transferring my ( login name & passoword)
from 6.5 server to 2000 server.
- will appriciate if you can help me in writting the script or foreward a
readymade script.
thanx regards
Ranjan|||Sorry, but I don't have a script for that. Are you sure that the upgrade process won't do this?
As a matter of fact, I think Microsoft changed its encryption algorythm between versions 6.5 and 2000, so even if you copied the encrypted value to the new server it might not recognize your password. If you are looking for a method of decrypting the password, I don't have one but I know it has been cracked (the algorythm was not very strong). You can probably find code for decrypting it on the web.
blindman|||Refer to this KBA (http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q246/1/33.ASP&NoWebContent=1) to accomplish the task.
Wednesday, March 7, 2012
Script automation
objects such as tables, schemas, login,... My question is: How can I
automate the process ?
I would like to write a kind of batch or script which when executed would
generate the scripts for - let's says - a few schemas and tables.
--
Francois PIETTE
http://www.overbyte.behttp://www.karaszi.com/SQLServer/info_generate_script.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
> Using SQL Server Management Studio, it is easy to create scripts for various objects such as
> tables, schemas, login,... My question is: How can I automate the process ?
> I would like to write a kind of batch or script which when executed would generate the scripts
> for - let's says - a few schemas and tables.
> --
> Francois PIETTE
> http://www.overbyte.be
>|||Give ApexSQL's Script a try. It can script data as well as objects and
comes with a command line interface so you can automate it. Very reasonable
price too.
--
TheSQLGuru
President
Indicium Resources, Inc.
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
> Using SQL Server Management Studio, it is easy to create scripts for
> various objects such as tables, schemas, login,... My question is: How can
> I automate the process ?
> I would like to write a kind of batch or script which when executed would
> generate the scripts for - let's says - a few schemas and tables.
> --
> Francois PIETTE
> http://www.overbyte.be
>|||> http://www.karaszi.com/SQLServer/info_generate_script.asp
Very interesting. I will investigate the various resources mentionned.
Thanks.
--
Francois PIETTE
http://www.overbyte.be
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a écrit
dans le message de
news:542D05DE-A8A3-4877-9D2C-7E9392DEF9B7@.microsoft.com...
> http://www.karaszi.com/SQLServer/info_generate_script.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
> news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
>> Using SQL Server Management Studio, it is easy to create scripts for
>> various objects such as tables, schemas, login,... My question is: How
>> can I automate the process ?
>> I would like to write a kind of batch or script which when executed would
>> generate the scripts for - let's says - a few schemas and tables.
>> --
>> Francois PIETTE
>> http://www.overbyte.be
>|||>> http://www.karaszi.com/SQLServer/info_generate_script.asp
I tryed Microsoft SQL Server Database Publishing Wizard which is mentionned
on the page you referred. It does the job perfectly. It is free, has a GUI
interface and a command line utility. That's just what I needed.
http://www.microsoft.com/downloads/details.aspx?FamilyID=56e5b1c5-bf17-42e0-a410-371a838e570a&DisplayLang=en
Again, thanks.
--
Francois PIETTE
http://www.overbyte.be
"Francois PIETTE" <fpiette@.newsgroups.nospam> a écrit dans le message de
news:%23k$euHLyHHA.5584@.TK2MSFTNGP02.phx.gbl...
>> http://www.karaszi.com/SQLServer/info_generate_script.asp
> Very interesting. I will investigate the various resources mentionned.
> Thanks.
> --
> Francois PIETTE
> http://www.overbyte.be
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a écrit
> dans le message de
> news:542D05DE-A8A3-4877-9D2C-7E9392DEF9B7@.microsoft.com...
>> http://www.karaszi.com/SQLServer/info_generate_script.asp
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
>> news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
>> Using SQL Server Management Studio, it is easy to create scripts for
>> various objects such as tables, schemas, login,... My question is: How
>> can I automate the process ?
>> I would like to write a kind of batch or script which when executed
>> would generate the scripts for - let's says - a few schemas and tables.
>> --
>> Francois PIETTE
>> http://www.overbyte.be
>>
>|||Glad my page helped, and thanks for sharing you findings... :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:eBg$qWLyHHA.600@.TK2MSFTNGP05.phx.gbl...
>> http://www.karaszi.com/SQLServer/info_generate_script.asp
> I tryed Microsoft SQL Server Database Publishing Wizard which is mentionned on the page you
> referred. It does the job perfectly. It is free, has a GUI interface and a command line utility.
> That's just what I needed.
> http://www.microsoft.com/downloads/details.aspx?FamilyID=56e5b1c5-bf17-42e0-a410-371a838e570a&DisplayLang=en
> Again, thanks.
> --
> Francois PIETTE
> http://www.overbyte.be
>
> "Francois PIETTE" <fpiette@.newsgroups.nospam> a écrit dans le message de
> news:%23k$euHLyHHA.5584@.TK2MSFTNGP02.phx.gbl...
>> http://www.karaszi.com/SQLServer/info_generate_script.asp
>> Very interesting. I will investigate the various resources mentionned.
>> Thanks.
>> --
>> Francois PIETTE
>> http://www.overbyte.be
>>
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a écrit dans le message de
>> news:542D05DE-A8A3-4877-9D2C-7E9392DEF9B7@.microsoft.com...
>> http://www.karaszi.com/SQLServer/info_generate_script.asp
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
>> news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
>> Using SQL Server Management Studio, it is easy to create scripts for various objects such as
>> tables, schemas, login,... My question is: How can I automate the process ?
>> I would like to write a kind of batch or script which when executed would generate the scripts
>> for - let's says - a few schemas and tables.
>> --
>> Francois PIETTE
>> http://www.overbyte.be
>>
>
Script automation
objects such as tables, schemas, login,... My question is: How can I
automate the process ?
I would like to write a kind of batch or script which when executed would
generate the scripts for - let's says - a few schemas and tables.
Francois PIETTE
http://www.overbyte.behttp://www.karaszi.com/SQLServer/in...rate_script.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
> Using SQL Server Management Studio, it is easy to create scripts for vario
us objects such as
> tables, schemas, login,... My question is: How can I automate the process
?
> I would like to write a kind of batch or script which when executed would
generate the scripts
> for - let's says - a few schemas and tables.
> --
> Francois PIETTE
> http://www.overbyte.be
>|||Give ApexSQL's Script a try. It can script data as well as objects and
comes with a command line interface so you can automate it. Very reasonable
price too.
TheSQLGuru
President
Indicium Resources, Inc.
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
> Using SQL Server Management Studio, it is easy to create scripts for
> various objects such as tables, schemas, login,... My question is: How can
> I automate the process ?
> I would like to write a kind of batch or script which when executed would
> generate the scripts for - let's says - a few schemas and tables.
> --
> Francois PIETTE
> http://www.overbyte.be
>|||> http://www.karaszi.com/SQLServer/in...rate_script.asp
Very interesting. I will investigate the various resources mentionned.
Thanks.
--
Francois PIETTE
http://www.overbyte.be
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a crit
dans le message de
news:542D05DE-A8A3-4877-9D2C-7E9392DEF9B7@.microsoft.com...
> http://www.karaszi.com/SQLServer/in...rate_script.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
> news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
>|||>> http://www.karaszi.com/SQLServer/in...rate_script.asp
I tryed Microsoft SQL Server Database Publishing Wizard which is mentionned
on the page you referred. It does the job perfectly. It is free, has a GUI
interface and a command line utility. That's just what I needed.
http://www.microsoft.com/downloads/...&DisplayLang=en
Again, thanks.
--
Francois PIETTE
http://www.overbyte.be
"Francois PIETTE" <fpiette@.newsgroups.nospam> a crit dans le message de
news:%23k$euHLyHHA.5584@.TK2MSFTNGP02.phx.gbl...
> Very interesting. I will investigate the various resources mentionned.
> Thanks.
> --
> Francois PIETTE
> http://www.overbyte.be
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a crit
> dans le message de
> news:542D05DE-A8A3-4877-9D2C-7E9392DEF9B7@.microsoft.com...
>|||Glad my page helped, and thanks for sharing you findings... :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:eBg$qWLyHHA.600@.TK2MSFTNGP05.phx.gbl...
> I tryed Microsoft SQL Server Database Publishing Wizard which is mentionne
d on the page you
> referred. It does the job perfectly. It is free, has a GUI interface and a
command line utility.
> That's just what I needed.
> http://www.microsoft.com/downloads/...&DisplayLang=en
> Again, thanks.
> --
> Francois PIETTE
> http://www.overbyte.be
>
> "Francois PIETTE" <fpiette@.newsgroups.nospam> a crit dans le message de
> news:%23k$euHLyHHA.5584@.TK2MSFTNGP02.phx.gbl...
>
Script automation
objects such as tables, schemas, login,... My question is: How can I
automate the process ?
I would like to write a kind of batch or script which when executed would
generate the scripts for - let's says - a few schemas and tables.
Francois PIETTE
http://www.overbyte.be
http://www.karaszi.com/SQLServer/info_generate_script.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
> Using SQL Server Management Studio, it is easy to create scripts for various objects such as
> tables, schemas, login,... My question is: How can I automate the process ?
> I would like to write a kind of batch or script which when executed would generate the scripts
> for - let's says - a few schemas and tables.
> --
> Francois PIETTE
> http://www.overbyte.be
>
|||Give ApexSQL's Script a try. It can script data as well as objects and
comes with a command line interface so you can automate it. Very reasonable
price too.
TheSQLGuru
President
Indicium Resources, Inc.
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
> Using SQL Server Management Studio, it is easy to create scripts for
> various objects such as tables, schemas, login,... My question is: How can
> I automate the process ?
> I would like to write a kind of batch or script which when executed would
> generate the scripts for - let's says - a few schemas and tables.
> --
> Francois PIETTE
> http://www.overbyte.be
>
|||> http://www.karaszi.com/SQLServer/info_generate_script.asp
Very interesting. I will investigate the various resources mentionned.
Thanks.
Francois PIETTE
http://www.overbyte.be
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a crit
dans le message de
news:542D05DE-A8A3-4877-9D2C-7E9392DEF9B7@.microsoft.com...
> http://www.karaszi.com/SQLServer/info_generate_script.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
> news:uaBCyiJyHHA.1576@.TK2MSFTNGP03.phx.gbl...
>
|||>> http://www.karaszi.com/SQLServer/info_generate_script.asp
I tryed Microsoft SQL Server Database Publishing Wizard which is mentionned
on the page you referred. It does the job perfectly. It is free, has a GUI
interface and a command line utility. That's just what I needed.
http://www.microsoft.com/downloads/details.aspx?FamilyID=56e5b1c5-bf17-42e0-a410-371a838e570a&DisplayLang=en
Again, thanks.
Francois PIETTE
http://www.overbyte.be
"Francois PIETTE" <fpiette@.newsgroups.nospam> a crit dans le message de
news:%23k$euHLyHHA.5584@.TK2MSFTNGP02.phx.gbl...
> Very interesting. I will investigate the various resources mentionned.
> Thanks.
> --
> Francois PIETTE
> http://www.overbyte.be
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a crit
> dans le message de
> news:542D05DE-A8A3-4877-9D2C-7E9392DEF9B7@.microsoft.com...
>
|||Glad my page helped, and thanks for sharing you findings... :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Francois PIETTE" <fpiette@.newsgroups.nospam> wrote in message
news:eBg$qWLyHHA.600@.TK2MSFTNGP05.phx.gbl...
> I tryed Microsoft SQL Server Database Publishing Wizard which is mentionned on the page you
> referred. It does the job perfectly. It is free, has a GUI interface and a command line utility.
> That's just what I needed.
> http://www.microsoft.com/downloads/details.aspx?FamilyID=56e5b1c5-bf17-42e0-a410-371a838e570a&DisplayLang=en
> Again, thanks.
> --
> Francois PIETTE
> http://www.overbyte.be
>
> "Francois PIETTE" <fpiette@.newsgroups.nospam> a crit dans le message de
> news:%23k$euHLyHHA.5584@.TK2MSFTNGP02.phx.gbl...
>
script - add SQL login
long time user, first time poster. hehe (always wanted to say that)
got a (hopefully) simple question.
I'm trying to script (vbscript, WMI or whatever works) adding a SQL
login so that my users can have access to SQL as Local Users on their
machines.
I would like to be able to add their username (%username%)?
but i would settle for adding the Domain Users group.
Any help or pointing in the right direction is very much appreciated.
Thanks everyone
Tim
tghetti@.air-worldwide.com
You can grant a Windows account access to SQL Server by executing the
sp_grantlogin stored procedure. Additionally, you can grant the users
access to your application database(s) and add the users to roles with
sp_grantdbaccess and sp_addrolemember.
The example script below can be run from Query Analyzer or the OSQL
command-line utility:
EXEC sp_grantlogin 'MyDomain\MyUser'
USE MyDatabase
EXEC sp_grantdbaccess 'MyDomain\MyUser'
EXEC sp_addrolemember 'MyRole', 'MyDomain\MyUser'
VbScript equivalent:
Dim connection, login
database = "MyDatabase"
login = "MyDomain\MyUser"
Set connection = CreateObject("ADODB.Connection")
connection.Open _
"Provider=SQLOLEDB;" & _
"Data Source=MyServer;" & _
"Integrated Security=SSPI;"
connection.Execute "EXEC sp_grantlogin '" & login & "'"
connection.Execute "USE " & database
connection.Execute "EXEC sp_grantdbaccess '" & login & "'"
connection.Execute "EXEC sp_addrolemember 'MyRole', '" & login & "'"
connection.Close
Hope this helps.
Dan Guzman
SQL Server MVP
"Tim" <Tim@.Directinsight.biz> wrote in message
news:e4f1004c.0408020947.19a29b4d@.posting.google.c om...
> Hi everyone,
> long time user, first time poster. hehe (always wanted to say that)
> got a (hopefully) simple question.
> I'm trying to script (vbscript, WMI or whatever works) adding a SQL
> login so that my users can have access to SQL as Local Users on their
> machines.
> I would like to be able to add their username (%username%)?
> but i would settle for adding the Domain Users group.
> Any help or pointing in the right direction is very much appreciated.
> Thanks everyone
> Tim
> tghetti@.air-worldwide.com
|||Thanks Dan...your the man
Tim
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message news:<uOy25NPeEHA.1764@.TK2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> You can grant a Windows account access to SQL Server by executing the
> sp_grantlogin stored procedure. Additionally, you can grant the users
> access to your application database(s) and add the users to roles with
> sp_grantdbaccess and sp_addrolemember.
> The example script below can be run from Query Analyzer or the OSQL
> command-line utility:
> EXEC sp_grantlogin 'MyDomain\MyUser'
> USE MyDatabase
> EXEC sp_grantdbaccess 'MyDomain\MyUser'
> EXEC sp_addrolemember 'MyRole', 'MyDomain\MyUser'
> VbScript equivalent:
> Dim connection, login
> database = "MyDatabase"
> login = "MyDomain\MyUser"
> Set connection = CreateObject("ADODB.Connection")
> connection.Open _
> "Provider=SQLOLEDB;" & _
> "Data Source=MyServer;" & _
> "Integrated Security=SSPI;"
> connection.Execute "EXEC sp_grantlogin '" & login & "'"
> connection.Execute "USE " & database
> connection.Execute "EXEC sp_grantdbaccess '" & login & "'"
> connection.Execute "EXEC sp_addrolemember 'MyRole', '" & login & "'"
> connection.Close
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Tim" <Tim@.Directinsight.biz> wrote in message
> news:e4f1004c.0408020947.19a29b4d@.posting.google.c om...
script - add SQL login
long time user, first time poster. hehe (always wanted to say that)
got a (hopefully) simple question.
I'm trying to script (vbscript, WMI or whatever works) adding a SQL
login so that my users can have access to SQL as Local Users on their
machines.
I would like to be able to add their username (%username%)'
but i would settle for adding the Domain Users group.
Any help or pointing in the right direction is very much appreciated.
Thanks everyone
Tim
tghetti@.air-worldwide.comYou can grant a Windows account access to SQL Server by executing the
sp_grantlogin stored procedure. Additionally, you can grant the users
access to your application database(s) and add the users to roles with
sp_grantdbaccess and sp_addrolemember.
The example script below can be run from Query Analyzer or the OSQL
command-line utility:
EXEC sp_grantlogin 'MyDomain\MyUser'
USE MyDatabase
EXEC sp_grantdbaccess 'MyDomain\MyUser'
EXEC sp_addrolemember 'MyRole', 'MyDomain\MyUser'
VbScript equivalent:
Dim connection, login
database = "MyDatabase"
login = "MyDomain\MyUser"
Set connection = CreateObject("ADODB.Connection")
connection.Open _
"Provider=SQLOLEDB;" & _
"Data Source=MyServer;" & _
"Integrated Security=SSPI;"
connection.Execute "EXEC sp_grantlogin '" & login & "'"
connection.Execute "USE " & database
connection.Execute "EXEC sp_grantdbaccess '" & login & "'"
connection.Execute "EXEC sp_addrolemember 'MyRole', '" & login & "'"
connection.Close
Hope this helps.
Dan Guzman
SQL Server MVP
"Tim" <Tim@.Directinsight.biz> wrote in message
news:e4f1004c.0408020947.19a29b4d@.posting.google.com...
> Hi everyone,
> long time user, first time poster. hehe (always wanted to say that)
> got a (hopefully) simple question.
> I'm trying to script (vbscript, WMI or whatever works) adding a SQL
> login so that my users can have access to SQL as Local Users on their
> machines.
> I would like to be able to add their username (%username%)'
> but i would settle for adding the Domain Users group.
> Any help or pointing in the right direction is very much appreciated.
> Thanks everyone
> Tim
> tghetti@.air-worldwide.com|||Thanks Dan...your the man
Tim
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message news:<uOy25NPeEHA.1764@.TK2MSF
TNGP10.phx.gbl>...[vbcol=seagreen]
> You can grant a Windows account access to SQL Server by executing the
> sp_grantlogin stored procedure. Additionally, you can grant the users
> access to your application database(s) and add the users to roles with
> sp_grantdbaccess and sp_addrolemember.
> The example script below can be run from Query Analyzer or the OSQL
> command-line utility:
> EXEC sp_grantlogin 'MyDomain\MyUser'
> USE MyDatabase
> EXEC sp_grantdbaccess 'MyDomain\MyUser'
> EXEC sp_addrolemember 'MyRole', 'MyDomain\MyUser'
> VbScript equivalent:
> Dim connection, login
> database = "MyDatabase"
> login = "MyDomain\MyUser"
> Set connection = CreateObject("ADODB.Connection")
> connection.Open _
> "Provider=SQLOLEDB;" & _
> "Data Source=MyServer;" & _
> "Integrated Security=SSPI;"
> connection.Execute "EXEC sp_grantlogin '" & login & "'"
> connection.Execute "USE " & database
> connection.Execute "EXEC sp_grantdbaccess '" & login & "'"
> connection.Execute "EXEC sp_addrolemember 'MyRole', '" & login & "'"
> connection.Close
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Tim" <Tim@.Directinsight.biz> wrote in message
> news:e4f1004c.0408020947.19a29b4d@.posting.google.com...
script - add SQL login
long time user, first time poster. hehe (always wanted to say that)
got a (hopefully) simple question.
I'm trying to script (vbscript, WMI or whatever works) adding a SQL
login so that my users can have access to SQL as Local Users on their
machines.
I would like to be able to add their username (%username%)'
but i would settle for adding the Domain Users group.
Any help or pointing in the right direction is very much appreciated.
Thanks everyone
Tim
tghetti@.air-worldwide.comYou can grant a Windows account access to SQL Server by executing the
sp_grantlogin stored procedure. Additionally, you can grant the users
access to your application database(s) and add the users to roles with
sp_grantdbaccess and sp_addrolemember.
The example script below can be run from Query Analyzer or the OSQL
command-line utility:
EXEC sp_grantlogin 'MyDomain\MyUser'
USE MyDatabase
EXEC sp_grantdbaccess 'MyDomain\MyUser'
EXEC sp_addrolemember 'MyRole', 'MyDomain\MyUser'
VbScript equivalent:
Dim connection, login
database = "MyDatabase"
login = "MyDomain\MyUser"
Set connection = CreateObject("ADODB.Connection")
connection.Open _
"Provider=SQLOLEDB;" & _
"Data Source=MyServer;" & _
"Integrated Security=SSPI;"
connection.Execute "EXEC sp_grantlogin '" & login & "'"
connection.Execute "USE " & database
connection.Execute "EXEC sp_grantdbaccess '" & login & "'"
connection.Execute "EXEC sp_addrolemember 'MyRole', '" & login & "'"
connection.Close
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Tim" <Tim@.Directinsight.biz> wrote in message
news:e4f1004c.0408020947.19a29b4d@.posting.google.com...
> Hi everyone,
> long time user, first time poster. hehe (always wanted to say that)
> got a (hopefully) simple question.
> I'm trying to script (vbscript, WMI or whatever works) adding a SQL
> login so that my users can have access to SQL as Local Users on their
> machines.
> I would like to be able to add their username (%username%)'
> but i would settle for adding the Domain Users group.
> Any help or pointing in the right direction is very much appreciated.
> Thanks everyone
> Tim
> tghetti@.air-worldwide.com|||Thanks Dan...your the man
Tim
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message news:<uOy25NPeEHA.1764@.TK2MSFTNGP10.phx.gbl>...
> You can grant a Windows account access to SQL Server by executing the
> sp_grantlogin stored procedure. Additionally, you can grant the users
> access to your application database(s) and add the users to roles with
> sp_grantdbaccess and sp_addrolemember.
> The example script below can be run from Query Analyzer or the OSQL
> command-line utility:
> EXEC sp_grantlogin 'MyDomain\MyUser'
> USE MyDatabase
> EXEC sp_grantdbaccess 'MyDomain\MyUser'
> EXEC sp_addrolemember 'MyRole', 'MyDomain\MyUser'
> VbScript equivalent:
> Dim connection, login
> database = "MyDatabase"
> login = "MyDomain\MyUser"
> Set connection = CreateObject("ADODB.Connection")
> connection.Open _
> "Provider=SQLOLEDB;" & _
> "Data Source=MyServer;" & _
> "Integrated Security=SSPI;"
> connection.Execute "EXEC sp_grantlogin '" & login & "'"
> connection.Execute "USE " & database
> connection.Execute "EXEC sp_grantdbaccess '" & login & "'"
> connection.Execute "EXEC sp_addrolemember 'MyRole', '" & login & "'"
> connection.Close
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Tim" <Tim@.Directinsight.biz> wrote in message
> news:e4f1004c.0408020947.19a29b4d@.posting.google.com...
> > Hi everyone,
> >
> > long time user, first time poster. hehe (always wanted to say that)
> >
> > got a (hopefully) simple question.
> >
> > I'm trying to script (vbscript, WMI or whatever works) adding a SQL
> > login so that my users can have access to SQL as Local Users on their
> > machines.
> > I would like to be able to add their username (%username%)'
> > but i would settle for adding the Domain Users group.
> >
> > Any help or pointing in the right direction is very much appreciated.
> >
> > Thanks everyone
> >
> > Tim
> > tghetti@.air-worldwide.com
Saturday, February 25, 2012
scratch that
I am getting the error
Error: 18456, Severity: 14, State: 16.
Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
in the log repeated every 15 seconds or so. I am logged into the server as pri\sqlservice, I have started the sql server and sql server agent with pri\sqlservice and I can access databases and tables inside the Server Management studio. I have set up the login pri\sqlservice and given it dbo owner access to all databases.
I am in the process of upgrading from 2000 to 2005. I have installed a new sql server 2005, restored backups of databases from 2000. I have also converted all packages and uploaded those to the new server (although they all point to the 2000 server). I have imported the jobs, but all but one are disabled and the one that is enabled ran okay when I ran it manually.
I have researched and researched this issue, and none seem to apply to my specific issue.
This is an extract of my errorlog:
2006-12-20 16:23:16.95 Server Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
2006-12-20 16:23:16.98 Server (c) 2005 Microsoft Corporation.
2006-12-20 16:23:16.98 Server All rights reserved.
2006-12-20 16:23:16.98 Server Server process ID is 1780.
2006-12-20 16:23:16.98 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2006-12-20 16:23:16.98 Server This instance of SQL Server last reported using a process ID of 4532 at 12/20/2006 4:23:52 PM (local) 12/20/2006 9:23:52 PM (UTC). This is an informational message only; no user action is required.
2006-12-20 16:23:16.98 Server Registry startup parameters:
2006-12-20 16:23:17.00 Server -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2006-12-20 16:23:17.00 Server -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2006-12-20 16:23:17.00 Server -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2006-12-20 16:23:17.23 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2006-12-20 16:23:17.23 Server Detected 2 CPUs. This is an informational message; no user action is required.
2006-12-20 16:23:17.93 Server Set AWE Enabled to 1 in the configuration parameters to allow use of more memory.
2006-12-20 16:23:19.65 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2006-12-20 16:23:22.07 Server Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.
2006-12-20 16:23:23.21 Server Attempting to recover in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.
2006-12-20 16:23:23.48 Server Database Mirroring Transport is disabled in the endpoint configuration.
2006-12-20 16:23:23.79 spid5s Starting up database 'master'.
2006-12-20 16:23:25.01 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2006-12-20 16:23:26.17 spid5s SQL Trace ID 1 was started by login "sa".
2006-12-20 16:23:26.37 spid5s Starting up database 'mssqlsystemresource'.
2006-12-20 16:23:27.93 spid9s Starting up database 'model'.
2006-12-20 16:23:27.95 spid5s Server name is 'KSDBT01'. This is an informational message only. No user action is required.
2006-12-20 16:23:29.06 spid9s Clearing tempdb database.
2006-12-20 16:23:29.54 Server A self-generated certificate was successfully loaded for encryption.
2006-12-20 16:23:29.62 Server Server is listening on [ 'any' <ipv4> 1433].
2006-12-20 16:23:29.62 Server Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
2006-12-20 16:23:29.62 Server Server local connection provider is ready to accept connection on [ \\.\pipe\sql\query ].
2006-12-20 16:23:29.64 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
2006-12-20 16:23:29.64 Server Dedicated admin connection support was established for listening locally on port 1434.
2006-12-20 16:23:29.68 Server SQL Server is now ready for client connections. This is an informational message; no user action is required.
2006-12-20 16:23:32.56 spid9s Starting up database 'tempdb'.
2006-12-20 16:23:32.67 spid13s Starting up database 'msdb'.
2006-12-20 16:23:32.67 spid12s Starting up database 'test'.
2006-12-20 16:23:32.67 spid14s Starting up database 'bravoAztecnology'.
2006-12-20 16:23:32.67 spid15s Starting up database 'bravoKNE'.
2006-12-20 16:23:32.67 spid16s Starting up database 'bravoKNS'.
2006-12-20 16:23:32.67 spid17s Starting up database 'bravoKNSBelgium'.
2006-12-20 16:23:32.68 spid18s Starting up database 'bravoKNSCanada'.
2006-12-20 16:23:32.68 spid19s Starting up database 'bravoKNSEngland'.
2006-12-20 16:23:34.79 spid20s The Service Broker protocol transport is disabled or not configured.
2006-12-20 16:23:34.81 spid20s The Database Mirroring protocol transport is disabled or not configured.
2006-12-20 16:23:35.01 spid12s Starting up database 'bravoKNSKennedy'.
2006-12-20 16:23:35.20 spid17s Starting up database 'bravoKNSSuperior'.
2006-12-20 16:23:35.35 spid13s Starting up database 'bravoKNSSuperiorSS'.
2006-12-20 16:23:35.48 spid19s Starting up database 'stamp'.
2006-12-20 16:23:35.83 spid20s Service Broker manager has started.
2006-12-20 16:23:38.59 spid14s Starting up database 'KNSSpecial'.
2006-12-20 16:23:39.31 spid18s Starting up database 'knsRPCS'.
2006-12-20 16:23:39.39 spid14s Analysis of database 'KNSSpecial' (16) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.
2006-12-20 16:23:43.03 spid5s Recovery of any in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC) has completed. This is an informational message only. No user action is required.
2006-12-20 16:23:43.03 spid5s Recovery is complete. This is an informational message only. No user action is required.
2006-12-20 16:23:50.95 spid51 Using 'xpsqlbot.dll' version '2005.90.1399' to execute extended stored procedure 'xp_qv'. This is an informational message only; no user action is required.
2006-12-20 16:23:55.85 spid51 Using 'xpstar90.dll' version '2005.90.1399' to execute extended stored procedure 'xp_instance_regread'. This is an informational message only; no user action is required.
2006-12-20 16:23:57.10 spid51 Using 'xplog70.dll' version '2005.90.1399' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
2006-12-20 16:24:00.02 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:00.02 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:00.06 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:00.06 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:01.06 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:01.06 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:01.07 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:01.07 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:03.84 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:03.84 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:03.85 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:03.85 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:03.96 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:03.96 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:03.98 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:03.98 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:41.41 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:41.41 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]
2006-12-20 16:24:41.41 Logon Error: 18456, Severity: 14, State: 16.
2006-12-20 16:24:41.41 Logon Login failed for user 'PRI\sqlservice'. [CLIENT: 172.16.9.2]