| | |
How to create SECURITY LOGIN from front-end coding
Please support our MS SQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
i have a database called "BILLING_SYSTEM" in sql server 7.0 and I'm using sql server authentication mode to connect to the database with my username "BS" and password "BS".
where my front-end is a VB6.0 application.
now I want to create this security login "BS/BS" from vb6.0 code without opening the enterprise manager console.
so how can I accomplish that?
or is there any T-SQL command for creating users?
any help on this would be highly appreciated. I have already searched in google for many time and nothing got yet. if somebody has any link to any related resources that becomes helpful too.
help plz...........its urgent...
regards
Shouvik
where my front-end is a VB6.0 application.
now I want to create this security login "BS/BS" from vb6.0 code without opening the enterprise manager console.
so how can I accomplish that?
or is there any T-SQL command for creating users?
any help on this would be highly appreciated. I have already searched in google for many time and nothing got yet. if somebody has any link to any related resources that becomes helpful too.
help plz...........its urgent...
regards
Shouvik
Last edited by choudhuryshouvi; Mar 10th, 2008 at 4:47 am.
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
use CREATE USER
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Indian Developer
http://falaque.wordpress.com/
well this didn't work in sql server 7.0.
your linked article points me to sql server 2005 t-sqls which i donot require at this moment. i wish to do this job in 7.0 version. so, could you give me a sample code?
your linked article points me to sql server 2005 t-sqls which i donot require at this moment. i wish to do this job in 7.0 version. so, could you give me a sample code?
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
Would you mind to share your solution as other people can have similar problem too...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Its been a pleasure to share my code here.
This is the code which I used in my application. Hope others will be benefited from this having same problem like me.
Hope the above syntax will be acceptable and one more thing i must say this code is working like snapping knife in butter.
regards
Shouvik
This is the code which I used in my application. Hope others will be benefited from this having same problem like me.
''this is for creating the user "BS" and associate it with the "BILLING_SYSTEM database EXEC SP_ADDLOGIN 'BS','BS','BILLING_SYSTEM' USE BILLING_SYSTEM ''these are for granting server roles EXEC SP_ADDSRVROLEMEMBER 'BS', 'sysadmin' EXEC SP_ADDSRVROLEMEMBER 'BS', 'securityadmin' EXEC SP_ADDSRVROLEMEMBER 'BS', 'serveradmin' EXEC SP_ADDSRVROLEMEMBER 'BS', 'setupadmin' EXEC SP_ADDSRVROLEMEMBER 'BS', 'processadmin' EXEC SP_ADDSRVROLEMEMBER 'BS', 'diskadmin' EXEC SP_ADDSRVROLEMEMBER 'BS', 'dbcreator' ''these are for granting various database manipulation permissions EXEC SP_ADDUSER 'BS','BS','public' EXEC SP_ADDROLEMEMBER 'db_owner','BS' EXEC SP_ADDROLEMEMBER 'db_accessadmin','BS' EXEC SP_ADDROLEMEMBER 'db_securityadmin','BS' EXEC SP_ADDROLEMEMBER 'db_ddladmin','BS' EXEC SP_ADDROLEMEMBER 'db_backupoperator','BS' EXEC SP_ADDROLEMEMBER 'db_datareader','BS' EXEC SP_ADDROLEMEMBER 'db_datawriter','BS' EXEC SP_ADDROLEMEMBER 'db_denydatareader','BS' EXEC SP_ADDROLEMEMBER 'db_denydatawriter','BS'
Hope the above syntax will be acceptable and one more thing i must say this code is working like snapping knife in butter.
regards
Shouvik
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
![]() |
Other Threads in the MS SQL Forum
- Previous Thread: query mdf directly?
- Next Thread: proble with import from excel
Views: 2331 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for MS SQL
"last age autogrowth business connectingtodatabaseinuse count cursor data database dateadd datediff datepart day" dbsize deadlock delete_trigger exploit getdate hack highperformancecomputing hpc hpcserver2008 ibm iis limit live loop maximum microsoft ms mssql multiple multithreading news number password permission position query reporting result security server services sets single source sql sql-injection sqlserver sqlserver2005 subtype supercomputing supertype tables uniqueid update view weekday






