SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Restrinct for insert update and delete from a specific table


Restrinct for insert update and delete from a specific table

Author
Message
Lowell
Lowell
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28156 Visits: 39945
another possibility is to create the user with the "right" limited permissions, with the same password as 'sa' currently;

that should be easy to do , since everyone is logging in as SA, anyway, so everyone knows the password as it is.

After that is all set up then rename the 'sa' login, and then rename that new user to be 'sa';

an additional problem of course, if you need to upgrade to 2008, because i seem remember a thread Gail mentioned were in place upgrades fail on renamed sa, i think.

Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Eric M Russell
Eric M Russell
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12273 Visits: 10648
Lowell (7/25/2013)
another possibility is to create the user with the "right" limited permissions, with the same password as 'sa' currently;

that should be easy to do , since everyone is logging in as SA, anyway, so everyone knows the password as it is.

After that is all set up then rename the 'sa' login, and then rename that new user to be 'sa';

an additional problem of course, if you need to upgrade to 2008, because i seem remember a thread Gail mentioned were in place upgrades fail on renamed sa, i think.

It is possible to drop the 'SA' account and re-create with limited permissions. In the past there have been BI / EF developers who insisted on having the 'SA' password. So, I gave them one, only with nothing but reader/writer access... and never heard a complaint back. Honestly most of these guys don't really know what they're asking for and wouldn't know the difference.

However, in this specific case, it sounds like the users arn't logging in as 'SA', they are logging in as themselves and have been granted membership in SYSADMIN server role at some point in past.


"The universe is complicated and for the most part beyond your control, but your life is only as complicated as you choose it to be."
Sean Lange
Sean Lange
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26050 Visits: 17528
Zeal-DBA (7/25/2013)
hi Sean,
please find attached image , as i have written trigger, after executing it prints message what i have mentioned in code but it is allowing to insert record as well. how to restrict


It would be far better if you could post the code instead of a screen shot. The reason here is because you did not create this as an INSTEAD OF trigger. Replace the word FOR with INSTEAD OF.

Then you should read up on how triggers work.

http://msdn.microsoft.com/en-us/library/ms189799.aspx

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Modens splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search