Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Restrinct for insert update and delete from a specific table Expand / Collapse
Author
Message
Posted Thursday, July 25, 2013 2:11 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:42 AM
Points: 14,469, Visits: 38,080
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!
Post #1477732
Posted Thursday, July 25, 2013 2:19 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 3:46 PM
Points: 3,873, Visits: 8,812
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 may be complicated, but life is only as complicated as you choose to make it."
Post #1477738
Posted Thursday, July 25, 2013 3:17 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 2:12 PM
Points: 15,991, Visits: 16,548
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 Moden's 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)
Post #1477758
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse