Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
Security
»
Add new user in SQL server 2000/2005 through...
Add new user in SQL server 2000/2005 through script
Rate Topic
Display Mode
Topic Options
Author
Message
ssa2010
ssa2010
Posted Monday, February 06, 2012 9:37 PM
Forum Newbie
Group: General Forum Members
Last Login: Wednesday, December 12, 2012 9:25 PM
Points: 9,
Visits: 62
Hello friends,
Is there any way to add a new db user in sql 2000/2005 through script ?
If yes please provide this sample script..
Post #1247799
sumitagarwal781
sumitagarwal781
Posted Monday, February 06, 2012 10:06 PM
SSC Journeyman
Group: General Forum Members
Last Login: Sunday, September 23, 2012 7:55 AM
Points: 75,
Visits: 110
Here is the command for adding user on SQL server 2000/2005
--2000
exec sp_addlogin @loginame='NewLoginName',
@passwd='The Password',
@defdb='Default Database Name', --Optional
@deflanguage='Language' --Optional
exec sp_adduser @loginame='NewLoginName',
@name_in_db='NewUserName',
--2005
CREATE LOGIN NewLoginName
WITH PASSWORD = 'The Password';
USE AdventureWorks2008R2;
CREATE USER NewLoginName FOR LOGIN NewLoginName;
GO
java
Post #1247803
ssa2010
ssa2010
Posted Monday, February 06, 2012 10:58 PM
Forum Newbie
Group: General Forum Members
Last Login: Wednesday, December 12, 2012 9:25 PM
Points: 9,
Visits: 62
[quote]
sumitagarwal781 (2/6/2012)
Thanks a lot
Post #1247811
sermohan-1082835
sermohan-1082835
Posted Monday, July 09, 2012 3:00 AM
Forum Newbie
Group: General Forum Members
Last Login: Monday, December 17, 2012 6:21 AM
Points: 2,
Visits: 69
what is the difference between 2000 user and 2005 user ?
thanks in advance
sri
Post #1326714
joeroshan
joeroshan
Posted Monday, July 09, 2012 3:14 AM
Mr or Mrs. 500
Group: General Forum Members
Last Login: 2 days ago @ 3:45 AM
Points: 572,
Visits: 1,157
Conceptually both are same.
Login lets you connects to the server
and User has the permissions inside the database.
Only difference is in 2000 the user and schema are clubbed.
In 2005 they are independent
-- Roshan Joe
*******************************************
Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help
Custom cleanup script for backups
Post #1326716
mmartin1
mmartin1
Posted Tuesday, July 10, 2012 11:57 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 4:43 PM
Points: 192,
Visits: 640
To create a database user account for an existing login,
sp_grantdbaccess @loginname = 'loginname'
Post #1328047
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.