Selecting From A View, Permissions Issue?

Oct 3, 2001

I have created a view where the data is a subset of the table. When a non dbo user selects only the first column from that view, the query returns the value. However, when the non dbo user selects any of the other columns or a combination of columns I get an invalid column name error. The syntax of my query is correct because it works when I use QA using a login with dbo permissions. Ideas?

Any help would be appreciated.

View 1 Replies


ADVERTISEMENT

Selecting A View And Selecting FROM A View Is Wildly Different

Feb 21, 2006

A colleague of mine has a view that returns approx 100000 rows in about 60 seconds.

He wants to use the data returned from that view in an OLE DB Source component.

When he selects the view from the drop-down list of available tables then SSIS seems to hang without any data being returned (he waited for about 15 mins).



He then changed the OLE DB Source component to use a SQL statement and the SQL statement was: SELECT * FROM <viewname>

In this instance all the data was returned in approx 60 seconds (as expected).





This makes no sense. One would think that selecting a view from the drop-down and doing a SELECT *... from that view would be exactly the same. Evidently that isn't the case.

Can anyone explain why?

Thanks

-Jamie

View 2 Replies View Related

Table Permissions Versus View Permissions

Aug 2, 2006

Using SQL Server 2k5 sp1, Is there a way to deny users access to a specific column in a table and deny that same column to all stored procedures and views that use that column? I have a password field in a database in which I do not want anyone to have select permissions on (except one user). I denied access in the table itself, however the views still allow for the user to select that password. I know I can go through and set this on a view by view basis, but I am looking for something a little more global.

View 5 Replies View Related

View Returning 0 When Selecting, But Fine In QA

Feb 6, 2006

I have created the view below, when I highlight the select statement in QA it works fine, but when I try to access the view I get back 0 records!
ie:
select * from Email_All

It believe its something to do with the last not in section:
EmailsAddresses.Email not in (
if I comment it out everything works fine!

does not make any sense...anyone have any clues?

they are all views except the EmailSubscriptions table.

-------------------------------------------
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [dbo].[Email_All]
AS




select * from
(
--SHELBY
select * from hcf..HM_EmailAddressShelby
union all
--KMS
select * from hcf..HM_EmailAddressKmai
union all
--EMAIL SUBSCRIPTIONS
select * from hcf..HM_EmailAddressWeb
where id in (select distinct id from hcf.dbo.EmailSubscriptions where List = 'PeriodicEmailsFromGreg' and status = 1)
) as EmailsAddresses
where
ltrim(rtrim(isnull(EmailsAddresses.Email,''))) <> ''
and
EmailsAddresses.Email not in (
select Email from hcf..ShelbyIdEmailSkip --OFF list SHELBY
union
select Email from hcf..KmaiIdEmailSkip --OFF list KMAI
union
select Email from hcf..EmailSubscriptions where List = 'PeriodicEmailsFromGreg' and status = 0 --OFF list PERIODIC FROM GREG
)




GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

View 2 Replies View Related

Conversion Error When Selecting From View?

Sep 11, 2013

I have a view that is involved in an import. Sometimes the import will fail with the following error:

Msg 242, Level 16, State 3, Line 2
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

I can recreate the error just from selecting from the view. Why would something be converting when just selecting from view?

View 4 Replies View Related

Indexes Being Improperly Used When Selecting Data Through A View

Nov 23, 2005

I am having a problem with indexes on specific tables. For some reasona query that runs against a view is not selecting the correct index ona table. I run the same query against the table directly and it looksfine. Can anyone give me some insight? Thanks.PRODUCTION1:CREATE TABLE MyTest1 (ID INT IDENTITY(1,1), COLUMN1 CHAR(10), COLUMN2CHAR(10))CREATE CLUSTERED INDEX IDX_MyTest1 ON MyTest1 ON (ID)CREATE NONCLUSTERED INDEX IDX_MyTest2 ON MyTest1 ON (COLUMN2, ID)ARCHIVE1:CREATE TABLE MyTest1 (ID INT IDENTITY(1,1), COLUMN1 CHAR(10), COLUMN2CHAR(10))CREATE CLUSTERED INDEX IDX_MyTest1 ON MyTest1 ON (ID)CREATE NONCLUSTERED INDEX IDX_MyTest2 ON MyTest1 ON (COLUMN2, ID)REPORTDB:CREATE VIEW MyTest1 ASSELECT ID, COLUMN1, COLUMN2 FROM PRODUCTION1..MyTest1UNION ALLSELECT ID, COLUMN1, COLUMN2 FROM ARCHIVE1..MyTest1While in PRODUCTION1:SELECT ID, COLUMN2 FROM MyTest1 WHERE COLUMN2 = 'Testing'--> Clustered index seek PRODUCTION1..IDX_MyTest2--> Results returnedWhile in ARCHIVE1:SELECT ID, COLUMN2 FROM MyTest1 WHERE COLUMN2 = 'Testing'--> Clustered index seek ARCHIVE1..IDX_MyTest2--> Results returnedWhile in REPORTDB:SELECT ID, COLUMN2 FROM MyTest1 WHERE COLUMN2 = 'Testing'--> Index seek PRODUCTION1..IDX_MyTest2--> Bookmark lookup PRODUCTION1..IDX_MyTest1--> Index seek ARCHIVE1..IDX_MyTest2--> Bookmark lookup ARCHIVE1..IDX_MyTest1--> Concatenate data and results returned

View 3 Replies View Related

A Deadlock When Selecting From A View With Replicated Tables.

Dec 15, 2006

I moved this from another forum because it seems more related to replication the longer I look into it!
The following code often dies on a deadlock. I have also seen "Spid x blocked by Spid x", where x is the spid of this connection. The view selects from several tables and some other views as well, and many of the underlying tables are being updated by replication. I have seen cases where the replication Insert proc participated in the deadlock, and the table being inserted into is joined twice in the view, suggesting that somehow this
causes the deadlock or makes a deadlock more likely?

SELECT * INTO dbo.tbl_stg_LoansMarketingFirstBorrower
FROM view_loans_marketing_first_borrower OPTION (MAXDOP 1)

I do not understand how selecting from a view can cause a deadlock with a
proc which does not reference tbl_stg_LoansMarketingFirstBorrower. Any
suggestions on how to diagnose this? I used (1204) to identify the proc and underlying table.

Thanks a bunch.

View 1 Replies View Related

View Permissions

Jun 7, 2007

I followed T-SQL instructions from Steve Gott (Thanks!) to alter the dbo schema and granted create a view permissions for one of my users. She can now create a view, however, she can not save the view she creates such as dbo.view1. Additionally, when she right-clicks on and existing view, it shows the ability to create views, however, greyed out are the options to edit or design the view.



What other steps should I take to ensure she can create, edit, design and save new and existing views?

View 3 Replies View Related

How To View All User Permissions?

Mar 14, 2007

I've seriously looked, but this simple concept eludes me. How do I go about viewing all the permissions granted to a database user? Like whether or not they can execute a stored procedure.

View 1 Replies View Related

View Permissions Alter

Aug 10, 2000

I have granted a developer the alter view permissions on some views in our production server which now allow him to open the view for modification. When he tries to save his changes he gets an error that he doesn't have create view permission. If seen this behavior before when you modify a table, does SQL Server 7.0 actually drop and recreate the object? If so, would he then need create permissions on views also?

View 2 Replies View Related

HELP - View Permissions Not Change In EM

Nov 6, 2000

Is there a way to set it so that a user can view permissions in EM but not change them? I have tried using the SecurityAdmin role on the database, but this lets the user change the permissions. I really need to be able to do this, is there any way or can anyone make any other suggestions about this i.e., can you place the user in this role yet revoke the ability to commit a change?

View 2 Replies View Related

View Job History Permissions For Non SA&#39;s

Mar 27, 2002

How can I allow non SA accounts access to view completed Job History of certain jobs.

Development application owners may receive notification of a Production SQL job failing and have no way to see step "details" of the failed job.

View 3 Replies View Related

Permissions To See Design View

Jul 23, 2005

Is there a way to allow users to see the design view of a table withouthaving dbo permissions?Thanks

View 1 Replies View Related

Table And View Permissions

Aug 2, 2007

I have a list of users that I want to restrict access to tables in a database. The goal is to allow the users to use select statements on the views instead of the tables. How can this be accomplished?

View 14 Replies View Related

Permissions To View INFORMATION_SCHEAM Views

Aug 9, 2002

SQL7, sp3

What specific permissions do you need to be able to view information_schema views? I thought public role had permissions to select on these views, but this is not the case? What do I do?

my developers have db_reader, db_writer, and db_ddladmin. They do not have db_owner. If I make them Sysadmin in sql they can view them, but that doens't fit in our security setup we have. THoughts?

Thanks,

View 2 Replies View Related

Table/View Permissions Snafu

Mar 3, 1999

I am having trouble with permissions on views and tables. I have a set of tables owned by dbo, and then a set of view owed by another user, say User1.
So I have a table dbo.Airports, and then a view User1.Airports. User1 has all permissions on dbo.Airports, and via ISQL I can select and update with no problem. MY VB application is working with User1.Airport, and it will select from User1.Airport fine, but I keep getting an error when I try to Update User1.Airport. I have many other tables set up the same way, and they all work fine - my VB app updates no problem. Any ideas?

I have dropped and recreated the table and all views, assigned all permissions, everything looks good, but...

Another strangev thing is if I use Enterprise Manager, and display permissions by user, and display all tables and views, the permissions are checked off for the view, but not the table, (which is incorrect) but if I don't display permissions for view, the permissions are checked off forv the table, which is correct. So that seems not to be working correctly.

View 1 Replies View Related

How To View Permissions Using Management Studio?

Apr 5, 2007

How do you view permissions granted to an id, such as ALTER TRACE permission, using Management Studio? I want to see if ALTER TRACE permission has been granted to an id, but am unable to find this information in the GUI.

Thanks, Dave

View 2 Replies View Related

View Stored Procedure Permissions

Jul 20, 2005

We are running SQL Server 2000 Developer Edition. I don't want tomake the developers the sysadmin or even the dbo in the userdatabases. Is there a way to give them access to only view thepermissions for the stored procedures in the user database withoutmaking them dbo?When I take them out of the db_owner role, when they open a storedprocedure they no longer see the permissions tab. I would like forthem to see the permissions tab and be able to view the permissionsbut not change the permissions.Is that doable?

View 1 Replies View Related

User Permissions - Read Only With Create View

Jan 11, 2008

I need to create a new login with SELECT rights so the users can view all tables with no UPDATE, DELETE, OR INSERT rights. But this user needs to be able to CREATE VIEWS. I have assigned the user to the Public role and gone in and modified Securables for the Database to be able to CREATE VIEW. When I connect using my new user and try to create a view, I get the error message: CREATE VIEW permissions denied in database 'test01'.

Help Please

TMDavis

View 1 Replies View Related

Permissions With Windows Groups And View To Other Databases

Aug 24, 2007

I am having a problem with permissions using Windows groups. I have a database (database1) that has permissions granted via Windows groups. Two groups (group1 and group2) are members of the db_datareader role in database1, and this work fine. Do to the number of tables that get created during our work, using db_datareader is the easiest way to keep up with permissions without creating a maintenance problem. Now I have a table that I want to add to this database, but I only want group2 to have select permission on this one table which is a problem because group1 has the db_datareader role. So I thought I could create a view in this database to the restricted table that I put in database2. Then in database2 I only added group2 as a user with the permission to select from this table. Unfortunately the group membership does not seem to get interpretted correctly in database2 and no one can successfult select from the view in database1.

In other words, user1 who belongs to group1 connects to database1 and cannot select from the restricted view -- this is what I would expect. However, when user2 who belongs to group2 connects to database1 they also cannot select from the restricted view -- not the behvior I would expect. Now, if I make user2 a user in database2 with select on the restricted table then user2 can connect to database1 and successfuly get data from the restricted view. So it looks like the fact that user2 belongs to group2 is never passed to database2 via the select from the view on database1. Is this indeed the way that Windows group security is working or is meant to work in SQL Server?

I realize I could solve this simplified version of the problem by creating my own role in database1 for group1 etc., but I am trying to solve a bigger problem in our environment that has hundreds of databases across numerous servers.

Thanks
Rob

View 4 Replies View Related

Permissions To View Stored Procedure Property

Feb 9, 2007

My Production servers are SQL Server 2005 x64. I would like to allow my developers the ability to look at permissions on production stored procedures but not be able to change those permissions or alter the production code. What has to be set to allow this sort of security.

View 8 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

Permissions In SQL Server 2005 To Allow Users To View The Management Activity Monitor?

Sep 27, 2006

For SQL Server 2000 we have a user login mapped to msdb with database role membership of db_datareader and public checked. This seems to allow the developers to view the Management Activity monitor. For SQL Server 2005 the same mapping is in place but the developers cannot view the Management Activity monitor. Developers are NOT granted the sysadmin role, and should not have that role.

What permissions need to be set for SQL Server 2005 to allow users to view the Management Activity monitor? They should not be allowed to take actions on the activities.

View 13 Replies View Related

How To View Permissions Of User-defined Database Roles In Management Studio?

Dec 20, 2005

As part of our security project, I've done the following when logged in as 'sa':

Created database roles 'dbrole1' within dbAccount

Created login and user 'user1' and added user to be a member of 'dbrole1'

Granted execute permissions on sp1 and sp2 to 'dbrole1'

However, I didn't see the above permissions listed in SQL Server Management Studio - Database - Security - Roles - Database Roles - 'dbrole1' properties - securables

Any ideas?  Thanks!

View 4 Replies View Related

SQL Server 2008 :: Granting Explicit View Definition Permissions On Stored Procedure To DBO?

Mar 6, 2013

The developers in our shop have a need to explicitly grant view definition permissions to themselves on stored procedures they create in their development databases. They have dbo level permissions in these databases and although they can explicitly grant view definition permissions to other developers in the same database, they are unable to do so for themselves. When they attempt this, it appears that they are successful but when they check the stored procedure afterwards the permission is not there for themselves.

While this does not cause an issue in development, the intention is for these view definition permissions to be carried forward to the test and production databases where they only have datareader permissions.

When these stored procedures are scripted out by the dba to move to Test and Production the view definition permissions are not scripted out for the developer in question.

Is there a way that a developer with dbo rights in a database can explicitly grant themselves view definition permissions on a stored procedure they create as dbo?

View 9 Replies View Related

Selecting The Most Recently Edited Item AND Selecting A Certain Type If Another Doesn't Exist

Sep 20, 2007

I've got a big problem that I'm trying to figure out:
I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those.

I don't need this for an individual ID select, I need it applied to every record from the table.

My address table has some columns that look like:
[AddressID] [int]
[LocationID] [int]

[Type] [nvarchar](10)
[Address] [varchar](50)
[City] [varchar](50)
[State] [char](2)
[Zip] [varchar](5)
[AddDate] [datetime]
[EditDate] [datetime]

AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table.
So there will be multiple addresses to one LocationID, but each address will have it's own AddressID.

How can I do this efficiently with perfomance in mind???

Thank you in advance for any and all replies...

View 2 Replies View Related

Creating Index On A View To Prevent Multiple Not Null Values - Indexed View?

Jul 23, 2005

I am looking to create a constraint on a table that allows multiplenulls but all non-nulls must be unique.I found the following scripthttp://www.windowsitpro.com/Files/0.../Listing_01.txtthat works fine, but the following lineCREATE UNIQUE CLUSTERED INDEX idx1 ON v_multinulls(a)appears to use indexed views. I have run this on a version of SQLStandard edition and this line works fine. I was of the understandingthat you could only create indexed views on SQL Enterprise Edition?

View 3 Replies View Related

Write A CREATE VIEW Statement That Defines A View Named Invoice Basic That Returns Three Columns

Jul 24, 2012

Write a CREATE VIEW statement that defines a view named Invoice Basic that returns three columns: VendorName, InvoiceNumber, and InvoiceTotal. Then, write a SELECT statement that returns all of the columns in the view, sorted by VendorName, where the first letter of the vendor name is N, O, or P.

This is what I have so far,

CREATE VIEW InvoiceBasic AS
SELECT VendorName, InvoiceNumber, InvoiceTotal
From Vendors JOIN Invoices
ON Vendors.VendorID = Invoices.VendorID

[code]...

View 2 Replies View Related

Calling A Stored Procedure From A View OR Creating A #tempTable In A View

Aug 24, 2007

Hi guys 'n gals,

I created a query, which makes use of a temp table, and I need the results to be displayed in a View. Unfortunately, Views do not support temp tables, as far as I know, so I put my code in a stored procedure, with the hope I could call it from a View....

I tried:

CREATE VIEW [qryMyView]
AS
EXEC pr_MyProc


and unfortunately, it does not let this run.

Anybody able to help me out please?

Cheers!

View 3 Replies View Related

Different Query Plans For View And View Definition Statement

Mar 9, 2006

I compared view query plan with query plan if I run the same statementfrom view definition and get different results. View plan is moreexpensive and runs longer. View contains 4 inner joins, statisticsupdated for all tables. Any ideas?

View 10 Replies View Related

Alter View / Create View

Aug 14, 2000

I had given one of our developers create view permissions, but he wants to also modify views that are not owned by him, they are owned by dbo.

I ran a profiler trace and determined that when he tries to modify a view using query designer in SQLem or right clicks in SQLem on the view and goes to properties, it is performing a ALTER VIEW. It does the same for dbo in a trace (an ALTER View). He gets a call failed and a permission error that he doesn't have create view permissions, object is owned by dbo, using both methods.

If it is doing an alter view how can I set permissions for that and why does it give a create view error when its really doing an alter view? Very confusing.

View 1 Replies View Related

Updating My View Changes My View Content

Feb 17, 2006

I have this view in SQL server:

CREATE VIEW dbo.vwFeat
AS
SELECT dbo.Lk_Feat.Descr, dbo.Lk_Feat.Price, dbo.Lk_Feat.Code, dbo.SubFeat.SubNmbr
FROM dbo.Lk_Feat INNER JOIN
dbo.SubFeat ON dbo.Lk_Feat.Idf = dbo.SubFeat.Idt


When ever I open using SQL Entreprise manager to edit it by adding or removing a field i inserts Expr1,2.. and I don t want that. The result I get is:

SELECT dbo.Lk_Feat.Descr AS Expr1, dbo.Lk_Feat.Price AS Expr2, dbo.Lk_Feat.Code AS Expr3, dbo.SubFeat.SubNmbr AS Expr4
FROM dbo.Lk_Feat INNER JOIN
dbo.SubFeat ON dbo.Lk_Feat.Idf = dbo.SubFeat.Idt

I don t want Entreprise manager to generate the Expr fields since I use the real fields in my application.
Thanks for help

View 4 Replies View Related

Selecting NOT TOP 1

Jun 10, 2004

Hi,

I am trying to select all entries from a database apart from the top/latest entry, via a stored procedure.
Below is the code that i have but i am doing it wrong somehow.

Any ideas?

Thanks


CREATE PROCEDURE spNEWSARCHIVE AS

SELECT *
FROM tblNEWS
WHERE NewsID NOT TOP 1
ORDER BY NewsID DESC
GO

View 7 Replies View Related







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