Showing posts with label delete. Show all posts
Showing posts with label delete. Show all posts

Wednesday, March 21, 2012

May I have your purmisshun?


Hi;

I'm a novice, and I need to set permissions in SQL Server 2005 (with Server Mgmt Studio)
so that I can create, modify, and delete tables in a database through my ASP.NET application.
I can't seem to find anything that spells this out - step-by-step - so that any idiot can follow it.

This is my error message:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
### Exception Number : 262
### (CREATE TABLE permission denied in database "MyDBase''.)
### Message: CREATE TABLE permission denied in database "MyDBase''. Number: 262
### Procedure: Server: SYS-EML8V3\SQL2005D01
### Source: .Net SqlClient Data Provider State: 1 Severity: 14 LineNumber: 1
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Does anyone have a link to something that might give me a clue?

THANKS!

Well, use some kind of tool, for example,Microsoft SQL Server Management Studio Express, and give to your user used in connection string appropriate right:

(under Databases -> Your Database -> Security -> Users)

|||

Dejan Vesic:

Well, use some kind of tool, for example,Microsoft SQL Server Management Studio Express, and give to your user used in connection string appropriate right:

(under Databases -> Your Database -> Security -> Users)

Hi Dejan;

I tried this with the ASPNET user, but it didn't work - I got the same error.

I must be missing something. Is there another user that I'm supposed to be setting this for?

THANKS!

|||

wASP:

Dejan Vesic:

Well, use some kind of tool, for example,Microsoft SQL Server Management Studio Express, and give to your user used in connection string appropriate right:


(under Databases -> Your Database -> Security -> Users)

Hi Dejan;

I tried this with the ASPNET user, but it didn't work - I got the same error.

I must be missing something. Is there another user that I'm supposed to be setting this for?

THANKS!

UPDATE ...

I've given the ASPNET user the "sysadmin" Server role - and it seems to have worked.

My next question is: Have I done something stupid (in terms of compromising security)?

THANKS!

|||

The answer is yes you can use either DBO(database owner) which is still risky but less so than Sysdamin or DDL admin. Try the link below for details. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms189612.aspx

|||

Caddre:

The answer is yes you can use either DBO(database owner) which is still risky but less so than Sysdamin or DDL admin. Try the link below for details. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms189612.aspx

Hi Caddre;

I think I've gotten everything set OK now - thanks to yourself and Dejan - and the link to that article (which I will save).

THANKS AGAIN!


|||

wASP:

Caddre:

The answer is yes you can use either DBO(database owner) which is still risky but less so than Sysdamin or DDL admin. Try the link below for details. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms189612.aspx

Hi Caddre;

I think I've gotten everything set OK now - thanks to yourself and Dejan - and the link to that article (which I will save).

THANKS AGAIN!

I am glad I could help.

May (or CAN) I use triggers ?

I need to call a procedure/function in VB when my DB is modified
with insert, update or delete. I know that its possible to do
something called Trigger, put how can my Triggers (in SQL Server or
MSDE) call a procedure in VB ?

Just to understand, this database catch information of users
connected to a support chat and I need to know when this user get
logged in (thru the rows of my table). When I notice that a new user
have logged in, I need to support him.

Thanks.You can try to create extended stored procedure but I think it is not a good idea to use something like this in triggers (performance). Trigger could save info about new users in special table and VB could monitor this table.|||but if I do a procedure for VB to monitor a table, isn't it also bad for the permormance ?|||Originally posted by ralf_davi
but if I do a procedure for VB to monitor a table, isn't it also bad for the permormance ?

Select from table is much faster (index, etc.) than running something no-native from trigger.|||What interface are your users loggin in through? Can't that interface also alert you when the login occurs? I wonder if you aren't trying to put functionality in the wrong place.

blindman|||Originally posted by blindman
What interface are your users loggin in through? Can't that interface also alert you when the login occurs? I wonder if you aren't trying to put functionality in the wrong place.

blindman

Users are logging in thru ASP pages.
I think that using ASP is not possible to alert me or anyone else. So I try do do a VB interface.
Have another idea of what can I use ?|||All contact with your database should be done through stored procedures, and you could place code in the procedure to notify your VB application.

blindman|||Originally posted by blindman
All contact with your database should be done through stored procedures, and you could place code in the procedure to notify your VB application.

blindman

How can I work with stored procedures to notify my VB application ?
Can you give me a sign ?|||Hmmm...I'm not a VB expert, and a lot probably depends upon the particulars of your application, but some of the methods SQL Server can use to communicate with other applications are:

1) Writing files.
2) Calling xp_cmdshell to issue operating system commands.
3) Calling xp_logevent to write to the NT Event Log.
4) Creating your own extended stored procedure.
5) xp_Sendmail

blindman|||if you're carrying a pager you'd probably be better off calling an sp from the ASP page that can page you with an info pertinent to the newly logged on user. there are 2 (that I know of) methods that do not involve SQLMail, - xp_smtp_sendmail and cdo-based sendmail. i don't remember the web-sites, but google will find them.|||Originally posted by ralf_davi
Users are logging in thru ASP pages.
I think that using ASP is not possible to alert me or anyone else. So I try do do a VB interface.
Have another idea of what can I use ?

There are so many ways to alert you through ASP page. You can call your vb dll, send an email directly to you, etc. I would not suggest you to use trigger in this case.