Showing posts with label logins. Show all posts
Showing posts with label logins. Show all posts

Tuesday, March 27, 2012

Create table permission problem on dbo

I have 2 logins on a sql server database. Both appear identical in their
permissions. They both have been assigned a role which has permission to
create tables on the dbo user. One user can create tables in the dbo but the
other can't. Neither have specific db_owner permission. Any ideas?On Oct 5, 1:19 pm, Stu P <S...@.discussions.microsoft.com> wrote:
> I have 2 logins on a sql server database. Both appear identical in their
> permissions. They both have been assigned a role which has permission to
> create tables on the dbo user. One user can create tables in the dbo but the
> other can't. Neither have specific db_owner permission. Any ideas?
compare the two using sp_helplogins 'loginname' to see if you can find
something
Thanks
VS|||I think it would be better to be sure of what permissions those logins have
using following commands first.
exec sp_helplogins
exec sp_helpsrvrolemember
--
Ekrem Ã?nsoy
"Stu P" <StuP@.discussions.microsoft.com> wrote in message
news:EE30C124-4EB4-48C1-8D98-3C94623FDCB5@.microsoft.com...
>I have 2 logins on a sql server database. Both appear identical in their
> permissions. They both have been assigned a role which has permission to
> create tables on the dbo user. One user can create tables in the dbo but
> the
> other can't. Neither have specific db_owner permission. Any ideas?

Wednesday, March 7, 2012

create login for db access on the fly

Hi,
How can i create logins on the fly to access a database.
I have a login which can access a database through my webapp. The enduser
will access also through my webapp, but they have a different login to the
database.
My question how can this be done? I've tried to execute the following, but
that did not work.
EXEC sp_addlogin 'username','password';
EXEC sp_defaultdb 'username', 'database';
use database;
EXEC sp_grantdbaccess 'username';
EXEC sp_addrolemember 'standard','username';
result:
Server: Msg 15247, Level 16, State 1, Procedure sp_addlogin, Line 17
User does not have permission to perform this action.
Server: Msg 15132, Level 16, State 1, Procedure sp_defaultdb, Line 14
Cannot change default database belonging to someone else.
Granted database access to 'jos'.
'username' added to role 'standard'.Use either Windows Authentication or Application Roles.
I'm not sure in what context it would make sense to add users
"on-the-fly". To add a user requires a login to the database with the
db_accesmin role anyway. Normally it's easier to add domain user
groups rather than individual users.
David Portas
SQL Server MVP
--|||Hi David,
I agree with you, but it is for emergency app which needs to create logins
for authenication means, because the user will access the database through
the webapp and doens't know their database password.
The user will be added to a databaserole.
Could you help me build this functionality?
"David Portas" wrote:

> Use either Windows Authentication or Application Roles.
> I'm not sure in what context it would make sense to add users
> "on-the-fly". To add a user requires a login to the database with the
> db_accesmin role anyway. Normally it's easier to add domain user
> groups rather than individual users.
> --
> David Portas
> SQL Server MVP
> --
>|||You need symin, db_accesmin or db ownership to modify users and
permissions. The error message indicated that you didn't have those
permissions so you'll have to use a login that does.
David Portas
SQL Server MVP
--|||Depends what you mean by on the fly, but, if you want the users to access th
e
DB w/o knowing the pwd or accnt they are going in as (ie, they can log into
your site (web-wise) with an accnt and pwd but knowing their accnt and pwd
alone won't give them direct access to the DB) you could set up SQL
Authentication on the DB, capture the users accnt value, modify it (in a
fixed way) and use the modified accnt value and a pwd in a COM or .NET
Assembly to actually access the DB. Means a bit more work on the DB end
tho... Or, you could access the DB with a specific accnt/pwd and pass in th
e
users web accnt as a parameter to your sprocs so you'd know who had requeste
d
the access... not sure what your ultimate goal is.
"Ezeki?l" wrote:

> Hi,
> How can i create logins on the fly to access a database.
> I have a login which can access a database through my webapp. The enduser
> will access also through my webapp, but they have a different login to the
> database.
> My question how can this be done? I've tried to execute the following, but
> that did not work.
> EXEC sp_addlogin 'username','password';
> EXEC sp_defaultdb 'username', 'database';
> use database;
> EXEC sp_grantdbaccess 'username';
> EXEC sp_addrolemember 'standard','username';
> result:
> Server: Msg 15247, Level 16, State 1, Procedure sp_addlogin, Line 17
> User does not have permission to perform this action.
> Server: Msg 15132, Level 16, State 1, Procedure sp_defaultdb, Line 14
> Cannot change default database belonging to someone else.
> Granted database access to 'jos'.
> 'username' added to role 'standard'.
>

Tuesday, February 14, 2012

Create DataBase and trigers, logins etc... in instalation...HELP

Hi,
My aplication use MSDE and,
I need create database, trigers etc... in instalation of MSDE.
What I had use: osql, callback, api...
How I do this...
Any idea?
Thanks.
Hi,
MSDE will not provide the normal GUI utilities. So you have to do all TSQL
statements using the utility OSQL from comamnd prompt.
OSQL -Usa -Ppassword -Sserver (enter)
1>create database <dbname>
2>go
1> create trigger abc_tri on cust for insert as select custno from cust
2>go
The list goes on.. For command syntax you can refer SQL server books online.
Note:
Now microsoft is providing web based free tool to administer the database.
Using this you can do coding as well
as administration stuff like creating database, increasing size, creating
tables, triggers , proceduers ...ect...
Download webadmin tool from below site.
http://www.microsoft.com/downloads/d...798-C57A-419E-
ACBC-2A332CB7F959&displaylang=en
Thanks
Hari
MCDBA
"Vanda Forti" <tforti@.terra.com.br> wrote in message
news:OrhhPApZEHA.212@.TK2MSFTNGP12.phx.gbl...
> Hi,
> My aplication use MSDE and,
> I need create database, trigers etc... in instalation of MSDE.
> What I had use: osql, callback, api...
> How I do this...
> Any idea?
> Thanks.
>
|||Hi
you can also have a look to this web based GUI : myLittleAdmin
http://www.myLittleTools.net/mla_sql
Hope this helps !
Elian Chrebor
// myLittleTools.net : leading provider of web-based applications.
// myLittleAdmin : online MS SQL manager
// http://www.mylittletools.net
// webmaster@.mylittletools.net
Hari Prasad typed:
> Hi,
> MSDE will not provide the normal GUI utilities. So you have to do all
> TSQL statements using the utility OSQL from comamnd prompt.
> OSQL -Usa -Ppassword -Sserver (enter)
> 1>create database <dbname>
> 2>go
> 1> create trigger abc_tri on cust for insert as select custno from
> cust 2>go
>
> The list goes on.. For command syntax you can refer SQL server books
> online.
>
> Note:
> Now microsoft is providing web based free tool to administer the
> database. Using this you can do coding as well
> as administration stuff like creating database, increasing size,
> creating tables, triggers , proceduers ...ect...
> Download webadmin tool from below site.
>
>
http://www.microsoft.com/downloads/d...039A798-C57A-4
19E-[vbcol=seagreen]
> ACBC-2A332CB7F959&displaylang=en
> Thanks
> Hari
> MCDBA
>
>
> "Vanda Forti" <tforti@.terra.com.br> wrote in message
> news:OrhhPApZEHA.212@.TK2MSFTNGP12.phx.gbl...