Originally posted by London75
View Post
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Reply to: sql server 2005
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "sql server 2005"
Collapse
-
-
Originally posted by EternalOptimist View PostI am converting a software house from vb/access to sql server. They have a pretty granular set up. This particular target company has ten of their products.
I have suggested merging 10 into 2 - we'll see what occurs.
There is one tip that isn't necessarily approved of but works, create your stored procedures in the master database and start the name sp_. they then don't need to be created in all other databases as running db1.dbo.sp_storedproc1 will run the procedure sp_storedproc1 in the context of the db1 database even though it actually lives in master.
Leave a comment:
-
Originally posted by London75 View PostSee bolded above, that should sort the database thing. Can I ask why there are 10 databases? That might end up biting you in the ass.
I have suggested merging 10 into 2 - we'll see what occurs.
Leave a comment:
-
Originally posted by London75 View PostSQL Server can see that AD group as long as it's part of the same domain.
- So open Management Studio
- Browse to the Security section
- Right click on Logins and select new login
- Make sure the Windows Authentication tick box is selected
- To be sure it's correct, click the Search button (you could just type the group name in the following format DOMAIN\GROUP but typos are easy)
- Find your group by searching AD
- Choose your default database, this should be the database used for your application
- There are two schools of thought for Default Language, some prefer to leave it on default to allow the server config choose language, I only ever dealt with UK so always choose British English as it makes dates reliable.
- Click User Mapping in the left hand pane
- Tick the box next to your database but don't tick any other boxes in the bottom pane as you're not going to give users the ability to select from tables.....Do this for every one of the 10 databases
- Click ok
- ...If that went ok...
- Go back to Management Studio and select the database you are dealing with
- Expand to Security -> Users and double click your group
- Click Securables in the left pane
- Click the add button halfway down
- Select "All objects of the type" and click ok
- Select "Stored Procedures" and click ok
- Here's the laborious bit, you need to click each stored procedure name in the top pane, then click the Grant box in the bottom pane, over and over again until they're all done.
Voila. There is a quicker was to generate permission scripts but sounds like it might be too much for now! If you're interested it involves building a SQL String from the results of the sysobjects table, each stored proc is listed in that table so the right query will generate a grant permissions script which can then be run. Even fancier is a cursor that executes the grant at the same time.
I'd say if you've got more than 40 SPs, a script is worthwhile.
Leave a comment:
-
In the database, the user/group was not there. I am guessing that is because the db was not made that user/groups default.
That becomes important because I will have one groups vs 10 databases.
what is the default for my sp viz the new group ? exec or not to exec ?
thanks for the help btw. much appreciated.
Leave a comment:
-
Originally posted by EternalOptimist View PostSounds like I am adding the user/group to the engine(instance ?), then to the database itself
?
I'm a bit bored so this is the script to generate the permission script, run it in the database of choice, in text output mode.
Code:select 'grant execute on ' + [name] + ' to ''DOMAIN\GROUPNAME''' from sysobjects where type = 'P' and category <> 2
Run the resulting output in a new query window.
Leave a comment:
-
Sounds like I am adding the user/group to the engine(instance ?), then to the database itself
?
Leave a comment:
-
SQL Server can see that AD group as long as it's part of the same domain.
- So open Management Studio
- Browse to the Security section
- Right click on Logins and select new login
- Make sure the Windows Authentication tick box is selected
- To be sure it's correct, click the Search button (you could just type the group name in the following format DOMAIN\GROUP but typos are easy)
- Find your group by searching AD
- Choose your default database, this should be the database used for your application
- There are two schools of thought for Default Language, some prefer to leave it on default to allow the server config choose language, I only ever dealt with UK so always choose British English as it makes dates reliable.
- Click User Mapping in the left hand pane
- Tick the box next to your database but don't tick any other boxes in the bottom pane as you're not going to give users the ability to select from tables
- Click ok
- ...If that went ok...
- Go back to Management Studio and select the database you are dealing with
- Expand to Security -> Users and double click your group
- Click Securables in the left pane
- Click the add button halfway down
- Select "All objects of the type" and click ok
- Select "Stored Procedures" and click ok
- Here's the laborious bit, you need to click each stored procedure name in the top pane, then click the Grant box in the bottom pane, over and over again until they're all done.
Voila. There is a quicker was to generate permission scripts but sounds like it might be too much for now! If you're interested it involves building a SQL String from the results of the sysobjects table, each stored proc is listed in that table so the right query will generate a grant permissions script which can then be run. Even fancier is a cursor that executes the grant at the same time.
I'd say if you've got more than 40 SPs, a script is worthwhile.
Leave a comment:
-
Originally posted by London75 View PostTo do it right, you need to get the application users put into a security group in Active Directory specific to this application and then grant that group access to the server and exec permissions on the stored procedures.
The AD admins will set up the group and the DBA will grant the group permissions. That way, if there are 1st line support people, they can manage application access easily without ever going near the database, in the group has access, take out of the group, no access. Nice and easy.
So if I have an AD group called EOUsers, then I put ten windows logins into that group, what do I have to do in sql server ?
Do I have to set up a user or a group with the same name ?
How do I stop others from execing my sp or seeing my tables ?
Unfortunately I will be expected to act as the dba for this database, and I will be expected to know what I am talking about. To add insult to injury , I am fighting in the dark because I dont have AD on my set up.
Leave a comment:
-
To do it right, you need to get the application users put into a security group in Active Directory specific to this application and then grant that group access to the server and exec permissions on the stored procedures.
The AD admins will set up the group and the DBA will grant the group permissions. That way, if there are 1st line support people, they can manage application access easily without ever going near the database, in the group has access, take out of the group, no access. Nice and easy.
Leave a comment:
-
Originally posted by JoJoGabor View PostYou just need to set the permissions on the tables correctly. Normal users dont need read permissions on a table in order to execute a stored procedure to read that data. So give no rights on the table and exec rights on the stored procedure.
Leave a comment:
-
You just need to set the permissions on the tables correctly. Normal users dont need read permissions on a table in order to execute a stored procedure to read that data. So give no rights on the table and exec rights on the stored procedure.
Leave a comment:
-
sql server 2005
I have a visual basic application, with a sql back end, connecting via odbc.
The back end owner has defaulted to the user who created it (me)
which is fine.
Using windows authentication, which means that anyone can connect and read the data.
How can I make sure that other users(and I dont have any logins or group names yet) are limited to exec only on any stored procedures ?
Please keep it simple, I am not a dba, just a humble developer
Tags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- How to answer at interview, ‘What’s your greatest weakness?’ Nov 14 09:59
- Business Asset Disposal Relief changes in April 2025: Q&A Nov 13 09:37
- How debt transfer rules will hit umbrella companies in 2026 Nov 12 09:28
- IT contractor demand floundering despite Autumn Budget 2024 Nov 11 09:30
- An IR35 bill of £19m for National Resources Wales may be just the tip of its iceberg Nov 7 09:20
- Micro-entity accounts: Overview, and how to file with HMRC Nov 6 09:27
- Will HMRC’s 9% interest rate bully you into submission? Nov 5 09:10
- Business Account with ANNA Money Nov 1 15:51
- Autumn Budget 2024: Reeves raids contractor take-home pay Oct 31 14:11
- How Autumn Budget 2024 affects homes, property and mortgages Oct 31 09:23
Leave a comment: