Synonyms Containing Tables From Another Database And Permissions

Jul 17, 2007

When you create a stored procedure and give the user execute permission, you don't need to give the user select permission on the table used in the stored procedure.



If one of the tables in the stored procedure is a synonym referencing a table in another database, and the user is already in the other database, you get a select permission denied on that table and I could only get it to work if I gave the user select permission on that table.



Is there a way around that, since I hate giving select permissions on tables?




Thank you,
Wissam

View 3 Replies


ADVERTISEMENT

Synonyms Database

Nov 26, 2004

Hello ,

Where can I download synonyms database ?

Thank you !

View 5 Replies View Related

Copy Tables And Permissions From One Database Table To Another

May 4, 2007

Hi,

I want to know how to copy tables and data from one database to antoher database including table permissions. Presently i am using Integrity security services. Is it having any option in Integration services or sqlserver 2005.



Thanks

View 7 Replies View Related

Using SYNONYMs

Apr 21, 2006

From what I'm seeing in MS documentation I would like to use SYNONYM to obtain information from a remote servers tables.  I've tried to find some decient documentation on using it, but can't see to find a clear example for remote servers and in my testing I can make the SYNONYM but the conneciton is failing.
Any helpful hints or references would be welcomed.
Thanks,Ken..

View 8 Replies View Related

API For Synonyms

Mar 28, 2007



Hi Experts:

I am writing a general API which would fetch synonyms from any database
providers (and would filter for a given schema).

I am using GetSchema method on DBConnection object and it works fine for
oracle.

SQL Server 2005 has a support for synonyms, but the above piece of code does
not work. Is there any API by which i can get the list?.

Thanks

AK

View 1 Replies View Related

Synonyms

Nov 20, 2006

Hi all,

Just as a curiosity (and thoroughness) thing, why are there synonyms in SQL Server? When I say synonyms, i mean INT and INTEGER, OUT and OUTPUT: These word pairs mean the same thing!

And in some examples they chop and change between the use of these words... It adds to the confusion.

Anyhows I'm curious as to the "why" behind this.

Thanks

Chris

View 3 Replies View Related

Permissions On Views And Tables

Aug 12, 2005

I am using a Microsoft Access ADP to get to data on SQL Server 2000. I would like to protect the base tables from being edited directly, but allow the views and SPs to handle all the work of getting data in and out. From what I have read in numerous articles and boods, I should be able to grant permissions just on the Views and NOT on the tables. However, the ONLY way I can make my views 'updatable' is by graniting UPDATE permissions on the TABLE! Worse yet, if I DENY permissions to UPDATE, INSERT, and DELETE in the view, but allow them in the table, the view allows the updates anyway, apparently not looking at the fact that it should be DENIED.
:confused:

View 2 Replies View Related

Granting Permissions On Set Of Tables

Jul 20, 2004

I have 500 tables in my Db.In those some tables name starts with abc (abc_emp,abc_dept) and rest of the tables name start with xyz(xyz_emp,xyz_transactions).I wanted to give select,insert,update and delete permissions for an user on the tables which starts with abc.
How can i do that in a much easier and sophisticated way.

Thanks.

View 1 Replies View Related

Permissions With Views And Tables

Jul 23, 2005

We are attempting to implement security on top of a shrink-wrapped softwarepackage and are trying to get row-level security. Here's the scenario:1. Table dbo.BOOK contains all the information about books in everydepartment.2. There are a large number of developed reports that run queries like"select * from BOOK..."3. We wish to have each Department only be able to see their books - withoutchanging the existing reports.Our thought was to create a series of views:create view Dept1.BOOK asselect * from BOOK where Dept=1....and then create Roles for each Dept. We'd then remove rights to dbo.BOOKand grant rights to DeptN.BOOK as appropriate for each role. We startedtesting this and seemed to get it working, but are now having problems. Isthis possible? Is there another, better solution?Thanks!

View 5 Replies View Related

Permissions With Sql Server Tables

Jul 20, 2005

Hello,I need some help with implenting the following:I recently migrated from access to sql server and i now i want to usemaintainable permissions on my tables, views, etc. The access database willserve as a front-end.I've created for testing purposes an testaccount with only a public role toaccess to my database.Now the hard part is when i want users to select and manipulate the datathrough views and stored procedures.I want only permissions set on views andstored procedures. The reason for this is because i don't want users to getthe data directly from tables by means of linking or importing them toaccessor other databases. Only views and stored procedures can be used.Unfortunelately it doesn't work how i wanted to. When i open a view which islinked in access as a table, i'm getting a message that the underlying tablehas not the appropiate permissions.Now there should be a way to apply a maintainable security, so if i couldhave some advice and maybe an example on this matter i would be verythankful.

View 3 Replies View Related

Recovery :: Using Synonyms On AG

Oct 28, 2015

I currently have a 2 node Availability Group that houses some big warehouse type of DB’s. It’s not uncommon to see DB1 populate DB2:

Use db1
Go
Insert into db2.dbo.table_1 values ‘ssfsfsfsf’

This all works as expected. However, we want to split these DB’s away from each other to reduce CPU impact on any one instance. Of course though we don’t want to have to go and change all the connection strings in our SSIS Packages.  By default this would now require going to a 4 part naming convention like so: Insert into newServerName.db2.dbo.table_1 values ‘ssfsfsfsf’Again though, we are trying to avoid this. That said I was thinking to use synonyms. This works as expected, until a failover occurs, and the synonym is redirected to the local Read Only version of DB2.So in other words, SQL Server is behaving exactly as it should, but I need a way to work around it.

Example below:

USE [master]
GO
/****** Object:  LinkedServer [DB2]    Script Date: 10/28/2015 11:43:46 AM ******/
--note this is pointed to the AG Listener name, for failover purposes.
EXEC
master.dbo.sp_addlinkedserver
@server = N'DB2', @srvproduct=N'sqlserver', @provider=N'SQLNCLI',
@datasrc=N'myAGListenerName', @catalog=N'DB2'

[code]....

Again, SQL Server is behaving exactly as it should. However, this synonym is now fairly worthless, as it can't handle failing from one node to the other in the AG

View 2 Replies View Related

Permissions Changed On Tables - Now Errors Appear

Sep 20, 2001

Recently some permissions were changed on the database tables and now the following message appears when a script is run to update the DB.

Msg 547, Level 16, State 1, Server SQL, Line 2
INSERT statement conflicted with COLUMN FOREIGN KEY constraint
'fk_educ_id'. The conflict occurred in database '12345', table
'educ_matters', column 'educ_id'.
The statement has been terminated.
(0 rows affected)

Thanks in advance...

View 1 Replies View Related

Getting JDBC Metadata For Synonyms

Sep 18, 2007

Using the Latest JDBC Driver from SQLExpress I'm attempting to get use the getTable() method to get information about database objects that the user can access/alter. Works fine for for tables and views, but can't seem to get any information returned for synonyms.

Is it possible to get information for synonyms, e.g. column definitions? or am I'm missing some setting in the connection.

Any Help would be appreciated!

Dave.

View 5 Replies View Related

Bulk Insert Permissions For Temp Tables

Feb 21, 2001

Does anyone know what permissions are required to run bulk insert to a temp table?

I've got a procedure that creates a temp table and runs bulk insert on it. Only problem is that it seems that only the dbo can run it. Anyone else gets the following error:
"The current user is not the database or object owner of table '#bulk'. Cannot perform SET operation."

Alternatively, does anyone know how to submit a scheduled job as a different user?

I've got my import system set up to create a scheduled job that kicks off right away. The job runs the 1st step which includes a bulk insert. The second step checks if the first step completely failed or not. Works great except that when the user runs the submission procedure, it comes back with that error.

Microsoft's brain-dead bulk insert command....aaargh. Every method around it's design flaws is blocked by another design flaw.

View 1 Replies View Related

Problem With User Permissions On Tables - Not Yet Resolved

Jul 20, 2005

I posted a message regarding a problem I'm having with SQL server 7 nottaking any notice of the permissions that I'm setting up on my databasetables (see thread "SQL Server 7 ignores user permissions" started on10/10/2003). I did get one response to this original message, butunfortunately this did not resolve my problem. Can anyone else shed anylight on this issue for me please?Thanks,Jon Ley.

View 1 Replies View Related

SQL Security :: Permissions Disappearing From Tables And Views

Feb 26, 2014

As a CRM person, I sometimes have to update the database to cope with custom reports that I have written. Usually, I will

Go into SQL Server Management Studio 2008Open the database
Locate either the table or the view
Right click on permissions.
Add in the role or user that's needed
Grant them Select permissions

This allows the report in CRM to access the database and this works.

The problem I have is that after a certain amount of time, the user or role will disappear from the permissions meaning that the report will not run. Sometimes, this can be as soon as a couple of days or it can be months. It happens on views more than tables and, whilst it's not too difficult to put the permissions back, it is annoying for the users.

I don't use SQL Server Management Studio very regularly, only to write a few queries and set up these permissions so I'm not sure if there's anything else in there that might be doing this.

View 6 Replies View Related

SQL Security :: Permissions To Create And Drop Tables?

Jul 31, 2015

what are the minimum permissions to allow a user to view, create, & drop tables within a DB (SQL 2008)?

View 4 Replies View Related

Is There A SQL Server Equivalent For Oracle Synonyms?

Jul 9, 2004

I have a SQL Server database which has one user (UserA) which owns some tables. I've added an additional user (UserB) to the database such that it has access to the tables owned by UserA. What is happening is that when I log on as UserB I have to fully qualify table names and fields in my SQL statements when I deal with tables owned by UserA. Is there a way make the tables accessible without specifying the owner? In Oracle you could create a public synonym for the table eg. <table_name>. Wherever that synonym is referenced the DBMS would know thats its refering to UserA.<table_name>. Is such functionality available in SQL Server? Thanks.

View 2 Replies View Related

Severe Error Encountered With Synonyms

Oct 10, 2006

we now used synonyms on the version 6 of our peoject, at first it turns out good. Then we migrate a database to the new database, everythings fine, its just a data migration anyway. The target database' structure and DML's wasn't change during migration. then intermittendly, we're encountering "A severe error occurred on the current command. The results, if any, should be discarded". I said its intermittent because sometime its ok, mostly its not functioning.

This is very painfull because all our scripts has this synonym. All our scripts uses an sp execution logging stored procedured of another database so we created a synonym for those sp's instead of fully qualifying the procedure name.

This is a major issue for us, please advise. You may response here, send me email or email me. Many Thanks.

Rodel E. Dagumampan
Email: dehranph@gmail.com
Yahoo: dehranph
Blog: http://community.devpinoy.org/blogs/dehranph

View 7 Replies View Related

Can Synonyms Be Used To Replace Hundreds Of Lines?

Sep 10, 2006

Hello

I'm looking for a way to store a large chunck of text (200 lines) in a variable which can be called in different objects within the database.

For example: I have several stored procedures that create the same temp table which exists of 200 column names over and over again.

It would have to look like this

Import myScript (I keep thinking of Import like used in .NET)

and myScript could exist of:

CREATE #MyTable(
...)

or even some simple text or a part of a sql statement.

I'm familiar with synonyms but you can't use that in this scenario.
Then I thought of functions. The scalar function returns a result, not what I want here. Table valued function return tables, not what I want.

Many thanks in advance!

View 3 Replies View Related

Problems With Synonyms As Data Sources

Apr 14, 2008



I am using a sql 2005 database that contains a combination of local objects plus synonyms for objects from a second database. I have had no problems using synoyms for tables and views in reporting services but can't get synonyms for stored procedures to work as a report data source. All databases are on the same server and we have installed service pack 2.

Any suggestions?

View 2 Replies View Related

Revoking Permissions On System Tables To The Public Role.

Oct 14, 2004

We have an audit issue that is requiring me to revoke the select permissions from the public role to the system tables. Has anyone had to do this?? What problems did you experience? Are their any tables that you were not able to change the permissions on? Any help is greatly appreciated.

View 5 Replies View Related

[SQL2000] Permissions To Use View Based On Tables From Many Databases

Feb 21, 2006

HiI have two databases: Customers and Operations. In Customers database I havemade a view based on a few tables from both Customers and Operations (leftjoin - customers without any operations). In the same database (Customers) Ihave created a stored procedure based on the view. Finally I'd like to giveto some users permission only to exec the stored procedure.Have I to add the users to Customers? If yes, please describe me how tolimit the users privileges only to execution the stored procedure (no rightsto open tables or view from Customers).Regards,GrzegorzPs. I had sent the post on microsoft.public.sqlserver.security, but I had noanswer.

View 5 Replies View Related

Access Permissions To Bulk Insert On # Temp Tables

Oct 24, 2007



Hi ,

I am a newbie and i need to provide access for developer for him to use bulk insert ... on temp tables.
what permission do i need to provide the developer i cannot provide bulkadmin permission to him what are the other ways to provide him the access.

Please help me with this.

View 4 Replies View Related

Implementation Of A Backend/frontend Architecture Using SYNONYMS

Mar 28, 2008

Hi!
I am evaluating an architecture for one of our project... a SQL database containing the data (backend) and a second database containing the development code (frontend) linked to the backend with synonyms.

It enables to upgrade the code without touching the data. Or to change the backend / use a different set of data at will.

Everything was going fine, the behavior was expected to be EXACTLY the same with synonyms as with real tables. But I came accross a problem:
Let's say we have a synonym (frontend) dbo.TABLE1 that points to a table (backend) with a IDENTITY column.

I have a sp (frontend) with the following code:
INSERT INTO dbo.TABLE1...
SELECT @SCOPE_IDENTITY = SCOPE_IDENTITY()

Well in that case, @SCOPE_IDENTITY is NULL!

Anyone has ever faced that problem? Should I use another function to return the last ID inserted? Or is it the backend/frontend architecture that is completely flawed? I also heard there's a way, by creating the tables and the code on different filegroups, to restore only the tables or the code...

Thanks for your input!
Frantz


View 13 Replies View Related

SQLCMD Error - Working With Variables And Synonyms

Jan 3, 2008

Hi All,

Been doing some testing with SQLCMD and variables for installation scripts, enclosed below is some source code.
The one problem, I've been getting is the following error:

Incorrect syntax near 'certification'

This has been tested only in SSMS utilising the run in SQLCMD mode.

This error only occurs on the SQLCMD variable replacement, where it replaces $(Cert_Schema) for the word Certification.
Running the CREATE Synonym with the word Certification hard-coded into the script works.

Any ideas?
Microsoft SQL Server 2005 - 9.00.3054.00 (Intel X86) Mar 23 2007 16:28:52 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

Best Regards,

D


USE [Testing]

GO

/****** Object: Table [certification].[Table_1] Script Date: 01/03/2008 11:22:48 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [certification].[Table_1](

[PKId] [smallint] NOT NULL,

[Name] [nchar](10) NULL,

CONSTRAINT [PK_Table_1] PRIMARY KEY CLUSTERED

(

[PKId] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

) ON [PRIMARY]

--- SQLCMD Script below:
-- line below should read, colon setvar cert_schema 'certification'

etvar Cert_Schema 'certification'
-- The line below fails to work for some reason

CREATE SYNONYM crt_asa FOR $(Cert_Schema).Table_1

DROP SYNONYM crt_asa

-- Hard-coded equivilant line works

CREATE SYNONYM crt_asa FOR certification.Table_1

DROP SYNONYM crt_asa

View 3 Replies View Related

How To Identify Permissions For SQL Server Tables && Stored Proc. Via VB Code

Jul 20, 2005

I'm writing an application using VB 6.0 as the front-end GUI, and theMSDE version of SQL Server as the back-end (it's a program for areally small # of users --- less then 3-4).I'm trying to determine, through the Visual Basic interface, thepermissions of each user that's using the application on his/hermachine.For example, let's say I'm user "Michael" that's sitting down at mymachine using the app. I've written. The security for logging intoSQL Server will be setup using Windows Security (Trusted Connection)as opposed to Windows & SQL Server security. When Michael accesses aparticular form in the VB 6.0 GUI, I want to run some code thatautomatically checks Michael's permission levels on the underlyingtable (actually, a stored procedure supplying the data from the table)that supplies the data to the form he's looking at and then give himsome feedback on the form as to what type of permissions he has whilehe's browsing through the data shown in the form.For example, Michael opens a particular form, code in the backgroundis run to identify that this is Michael accessing the form, the codereturns a value that identifies what type of permissions he has on thedata in the form, and a text box on the form informs Michael (forexample) that he only has read-only permissions to the data he isviewing and cannot edit any of the data.As another example, user Karen sits down at her computer, logs intothe application, opens the same form that Michael just opened, thecode is run in VB to detect the level of permissions she has on thedata being displayed in the form, and the text box on the form informsher that she has editing permissions on the data in the underlyingtable.Etc...If anyone can post an example of the code they use in accomplishingthis task in an application they've written, I'd really appreciate apoint in the right direction or a real-world example that's beenimplemented by one of you. I've written several apps. thus far usingMSDE as the back-end, but the previous apps. I've written were forclients that didn't care about restricting access to theapplication... everyone could pretty much use the application as theydesired and do anything they desired to the data.The current client I'm writing the app. mentioned here for wants tohave security in place to where various users access the applicationwith various levels of permissions to do stuff (or *not* do stuff) tothe data in the application.Thanks very much in advance for any assistance / code provided!Sincerely,Brad McCollumJoin Bytes!

View 1 Replies View Related

SQL Server 2008 :: Script To List All Database Level Permissions In A Database?

Aug 4, 2015

I found this script online..

SELECT prin.[name] [User], sec.state_desc + ' ' + sec.permission_name [Permission]
FROM [sys].[database_permissions] sec
JOIN [sys].[database_principals] prin
ON sec.[grantee_principal_id] = prin.[principal_id]
WHERE sec.class = 0
ORDER BY [User], [Permission];

but the results are this: 2 columns - User and Permission

User Permission
User1 GRANT CONNECT
User2 GRANT CONNECT

IS there a way in SQL Server (2005/2008/2012) to run a script against a Database that will show all users that have permissions to that Database and the type of permissions?

View 7 Replies View Related

Starting Out With : Views, Stored Procedures, Functions, Synonyms

Mar 22, 2006

Hi,Right, i have a fairly good understanding of SQL. However, i have a fairly basic understanding of SQL Server.I know Storedprocedures are really good and i'm starting to use them. I understand they are good for making inserting, updating very easy.However when you look at a SQL Server database you get various folder, this leaves me a little confused with what they are all used for? whats the difference between these?Thanks in advance!sorry for the basic question, i'll try to challange you next time

View 1 Replies View Related

SQL Server 2014 :: Script To Search For A String In All DB Objects (Including Synonyms)

Jun 29, 2015

I'm looking for a "God-script" to search for a given string (case invariant) in all DB objects (esp synonyms) in all DBs on a server?

View 9 Replies View Related

Database Permissions

Jan 29, 2007

Hi, In my web app I've got two databases (the asp profile one and my own custom one). If I take the code and data and use it to create another website on another box, I usually get a database error saying the permissions are wrong. In this case I usually just give everyone full control and it works, but this obviously isn't good practice!So, I'm wondering what permissions on database files does ASP need? Which users need what permissions? Thanks 

View 3 Replies View Related

SQL Database Permissions???

Mar 5, 2004

Hello everyone...

I am trying to learn ASP.NET with SQL Server and I am having trouble with database permissions...

I am trying to use the following connection code:

Public dbconnstring As String = "Data Source=.;Integrated Security=SSPI;Initial Catalog=tempdb"

Now... this code works fine for the database "tempdb"..... but gives me an "access denied" error with the database "Northwind"...

I have tried to play around with the permissions for the Northwind database... but nothing happens...

Does anyone know haw to work around this??? either through changing the connection code or through changing the database permissions????

View 7 Replies View Related

Sa Permissions On Database

Mar 20, 2000

I created a database using the sa account !!

I then created another user and made it a dbo of the database and used this account to create the tables etc and load the intital data.

My problem is that the sa account (or any new account that I create - regardless of the role) can not access the data in the tables.

Any help in resolving this would be appreciated.


Zane

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved