The current version of Microsoft SQL is SQL 2005.
If you are running a different version of Microsoft SQL, it is your responsibility to state what version you are using (for example, SQL 2000, service pack 2). If you don't include information about what version of Microsoft SQL you are using, we'll assume that you are running SQL 2005 and the answer that we give you may or may not work with the version of Microsoft SQL that you are using.
Kudos to r937 for reminding me to include this version information in our FAQ
General Topics
What is a FAQ? (http://www.dbforums.com/showthread.php?t=1212452#post4527529)
How to ask a question to get quick and correct answers? (http://www.dbforums.com/showthread.php?t=1212452#post4527530)
How do I "join the community"? (http://www.dbforums.com/showthread.php?t=1212452#post4527531)
What does Microsoft have to say about group participation? (http://www.dbforums.com/showthread.php?t=1212452#post4527533)
Homework
How NOT to ask for help! (http://www.dbforums.com/showthread.php?p=6226875#post6226875)
SQL Server Topics
How do I get DDL for my tables? (http://www.dbforums.com/showthread.php?t=1212452#post4527532)An FAQ is a list of Frequently Asked Questions in a forum, newsgroup, or other (presumably online) place. These are questions that regularly appear because pretty much everybody asks them at one time or another. This is a really good place to look for a general "look and feel" for both the forum itself, the people who post there, and the topic in general.
FAQ Index (http://www.dbforums.com/showthread.php?t=1212452)|||Originally posted by Brett Kaiser, updated by Pat Phelan
Please state your problem in the context of a business requirement. Please do not force a narrowly focused technical solution, which may or may not be of any value.
It may also be a distraction to what the actual solution would be. To aid in the solution please do the following if possible
1. State the question
"How do I find the earliest row entered"
2. Please post the DDL of your tables (Including Indexes, and constraints)
Like
CREATE TABLE myTable99(Col1 int IDENTITY(1,1), Col2 char(1), Col3 datetime, PRIMARY KEY (Col1))
3. Post some sample data in the form of DML
Like
INSERT INTO myTable99(Col2, Col3)
SELECT 'a', '01/01/2005' UNION ALL
SELECT 'b', '02/01/2005' UNION ALL
SELECT 'c', '03/01/2005'
4. Post whatever DML that you have attempted already...
SELECT * FROM myTable99 a CROSS JOIN myTable99 b
5. Post the expected results
Col1 Col2 Col3
---- -- ----------------
1 a 2005-01-01 00:00:00.000
Good Luck. If these instruction are followed, you will most likely get an answer in minutes.
And don't forget to use [ code] [ /code] tags when posting code, just eliminate the spaces I have used here.
FAQ Index (http://www.dbforums.com/showthread.php?t=1212452)|||Originally posted by Brett Kaiser, updated by Pat Phelan
First and foremost, just join in! Ask or answer a question, add a comment to an existing message thread, or stop by the Yak Corral (http://www.dbforums.com/showthread.php?t=989246).
You can also add yourself here:
http://www.frappr.com/dbforums
FAQ Index (http://www.dbforums.com/showthread.php?t=1212452)|||Originally posted by Brett Kaiser, updated by Pat Phelan
1. Go to Enterprise Manager.
2. Open the database folder to display all of the tables.
3. Right Click on the table(s) you want.
4. Choose Menu options All Tasks>Generate SQL Scripts
5. Look at the dialog, there are three tabs. Make sure you pick all the correct options (indexes, keys, ect)
6. Click Preview.
7. Copy and paste the code.
FAQ Index (http://www.dbforums.com/showthread.php?t=1212452)|||See their Knowledgebase article 555375 (http://support.microsoft.com/kb/q555375).
FAQ Index (http://www.dbforums.com/showthread.php?t=1212452)|||In discussion of poor practices in another forum, we unearthed some old threads here that demonstrate the wrong way to ask for help. If you want examples of how NOT to ask for help, these are some good examples!
With thanks to Blindman for bringing these posts back to public view, and to R937 for suggesting that they be imortalized!
The Introduction (http://www.dbforums.com/showthread.php?t=1607194)
It gets better! (http://www.dbforums.com/showthread.php?t=1607193)
Taking this process a few steps further:
1) If you are asking questions for a course, please say so up front. We need to take a different approach when helping you with homework than we do with folks that simply need an answer to a "real world" problem.
2) It helps us a great deal if you can post a link to the assignment, or if you can scan the assignment and post it with your questions. That way we know exactly what the assignment requires, and we can infer a lot about what they're trying to get you to learn in the assignment.
3) Don't expect us to just do your homework for you. Life isn't like that, and you'll cheat yourself more than you can cheat the school/teacher if all you do is copy what someone else has done for you. We'll be glad to help, but you really don't want to turn us loose on your homework assignment... We can be evil! :D
4) If you have a partial solution worked out, or have at least tried something, post that too. If we can see what you've tried, we can probably help you a lot more than if we "start cold" because we can then see more of how you're thinking and where we can help.
FAQ Index (http://www.dbforums.com/showthread.php?t=1212452)
Showing posts with label current. Show all posts
Showing posts with label current. Show all posts
Wednesday, March 28, 2012
Friday, March 23, 2012
Read only and access to specific databases
Hello everyone,
Please forgive me as I'm VERY new to SQL Server. I am (in a former and
current life) a Oracle Certified Master DBA, however, I've been given a
new project -- SQL Server 2005 to administrate. Although I'm going
through some material on SQL Server, I do have two questions that
hopefully someone can answer for me.
I first want to make a READ-ONLY user (a user who can only query the
database) but not do any updates, deletes, etc. I added a local group
to the box (and put the users into that local group) and then added
that group to the "master" security users and then added that group to
the specific database I want them to have access to.
My question is, I don't see where I can make that group readonly to
that specific database, and I also don't see where I can give them
access to ONLY that one database. They can so far query the other
remaining 6 databases on the system by using owner.schema.table syntax,
and I don't want them to be able to do that.
I know this is prob. a pretty simple question and task, but I'm stumped
at how SQL Server does this... although i'm sure the solution is as
simple as the question.
Thanks for all your imput and help!Create a SQL Login or add the users Windows account (or
Windows group) as a login on the SQL Server box. The login
gives the user access to the server but not to the databases
themselves. It's kind of like a grant connect.
For read only access to a particular database, you can then
add that login as a user in the database and add the user to
the built in database role db_datareader. That would give
the user select on the tables. You could additionally add
the user to db_denydatawriter and that would deny their
ability to insert, update, delete on the tables.
As for why you are seeing some variances, permissions are
cumulative. If the user is a member of other groups that
have access to databases, database objects then the user
gets access that way. If the public database role has been
granted access more than the default access, the user would
pick these up as well as all database users are members of
the public role.
The user having access to the other databases you don't
explicitly add the user to could be due to membership in a
windows group that has been given access - so they inherit
access to the database through their group membership. Or
enabling the guest account in that database. If the guest
account is enabled, anyone with a login can access the
database. By default of how the public role works, the user
would have access to anything granted to public. The guest
account can also be granted additional permissions although
this isn't really a good idea. The guest account is always
exists in master and tempdb and can't be removed from those
two databases.
-Sue
On 14 Mar 2006 08:38:17 -0800, "Greg" <gregcpx@.hotmail.com>
wrote:
>Hello everyone,
>Please forgive me as I'm VERY new to SQL Server. I am (in a former and
>current life) a Oracle Certified Master DBA, however, I've been given a
>new project -- SQL Server 2005 to administrate. Although I'm going
>through some material on SQL Server, I do have two questions that
>hopefully someone can answer for me.
>I first want to make a READ-ONLY user (a user who can only query the
>database) but not do any updates, deletes, etc. I added a local group
>to the box (and put the users into that local group) and then added
>that group to the "master" security users and then added that group to
>the specific database I want them to have access to.
>My question is, I don't see where I can make that group readonly to
>that specific database, and I also don't see where I can give them
>access to ONLY that one database. They can so far query the other
>remaining 6 databases on the system by using owner.schema.table syntax,
>and I don't want them to be able to do that.
>I know this is prob. a pretty simple question and task, but I'm stumped
>at how SQL Server does this... although i'm sure the solution is as
>simple as the question.
>Thanks for all your imput and help!
Please forgive me as I'm VERY new to SQL Server. I am (in a former and
current life) a Oracle Certified Master DBA, however, I've been given a
new project -- SQL Server 2005 to administrate. Although I'm going
through some material on SQL Server, I do have two questions that
hopefully someone can answer for me.
I first want to make a READ-ONLY user (a user who can only query the
database) but not do any updates, deletes, etc. I added a local group
to the box (and put the users into that local group) and then added
that group to the "master" security users and then added that group to
the specific database I want them to have access to.
My question is, I don't see where I can make that group readonly to
that specific database, and I also don't see where I can give them
access to ONLY that one database. They can so far query the other
remaining 6 databases on the system by using owner.schema.table syntax,
and I don't want them to be able to do that.
I know this is prob. a pretty simple question and task, but I'm stumped
at how SQL Server does this... although i'm sure the solution is as
simple as the question.
Thanks for all your imput and help!Create a SQL Login or add the users Windows account (or
Windows group) as a login on the SQL Server box. The login
gives the user access to the server but not to the databases
themselves. It's kind of like a grant connect.
For read only access to a particular database, you can then
add that login as a user in the database and add the user to
the built in database role db_datareader. That would give
the user select on the tables. You could additionally add
the user to db_denydatawriter and that would deny their
ability to insert, update, delete on the tables.
As for why you are seeing some variances, permissions are
cumulative. If the user is a member of other groups that
have access to databases, database objects then the user
gets access that way. If the public database role has been
granted access more than the default access, the user would
pick these up as well as all database users are members of
the public role.
The user having access to the other databases you don't
explicitly add the user to could be due to membership in a
windows group that has been given access - so they inherit
access to the database through their group membership. Or
enabling the guest account in that database. If the guest
account is enabled, anyone with a login can access the
database. By default of how the public role works, the user
would have access to anything granted to public. The guest
account can also be granted additional permissions although
this isn't really a good idea. The guest account is always
exists in master and tempdb and can't be removed from those
two databases.
-Sue
On 14 Mar 2006 08:38:17 -0800, "Greg" <gregcpx@.hotmail.com>
wrote:
>Hello everyone,
>Please forgive me as I'm VERY new to SQL Server. I am (in a former and
>current life) a Oracle Certified Master DBA, however, I've been given a
>new project -- SQL Server 2005 to administrate. Although I'm going
>through some material on SQL Server, I do have two questions that
>hopefully someone can answer for me.
>I first want to make a READ-ONLY user (a user who can only query the
>database) but not do any updates, deletes, etc. I added a local group
>to the box (and put the users into that local group) and then added
>that group to the "master" security users and then added that group to
>the specific database I want them to have access to.
>My question is, I don't see where I can make that group readonly to
>that specific database, and I also don't see where I can give them
>access to ONLY that one database. They can so far query the other
>remaining 6 databases on the system by using owner.schema.table syntax,
>and I don't want them to be able to do that.
>I know this is prob. a pretty simple question and task, but I'm stumped
>at how SQL Server does this... although i'm sure the solution is as
>simple as the question.
>Thanks for all your imput and help!
Read in current value to a texbox
Hi all,
Does anyone know how to read in the last value from a SQL database and return it to a textbox?
Check out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconRetrievingIdentityOrAutonumberValues.asp
Subscribe to:
Posts (Atom)