Permission To Use Table Variable?

Oct 4, 2004

I am trying to get around business logic that does not give the user permissions to create any temp tables or tables.

If a user falls into this category, will they still be allowed to create "table variables"? (Declare @x table (i int)

...I'm obviously trying to find a way around this permission issue.

Thanks... :D

View 5 Replies


ADVERTISEMENT

Transact SQL :: Insert Values From Variable Into Table Variable

Nov 4, 2015

CREATE TABLE #T(branchnumber VARCHAR(4000))

insert into #t(branchnumber) values (005)
insert into #t(branchnumber) values (090)
insert into #t(branchnumber) values (115)
insert into #t(branchnumber) values (210)
insert into #t(branchnumber) values (216)

[code]....

I have a parameter which should take multiple values into it and pass that to the code that i use. For, this i created a parameter and temporarily for testing i am passing some values into it.Using a dynamic SQL i am converting multiple values into multiple records as rows into another variable (called @QUERY). My question is, how to insert the values from variable into a table (table variable or temp table or CTE).OR Is there any way to parse the multiple values into a table. like if we pass multiple values into a parameter. those should go into a table as rows.

View 6 Replies View Related

SQL Server - Permission Issues : Execute Permission Denied On Object 'SprocName'

Dec 13, 2005

I have an application that uses Integrated Windows authentication. My Web.config looks like below
<add key="dbconnection" value=" server=XXX;Initial Catalog=XXX;persist security info=False;Integrated Security=SSPI;Pooling=true" />
When users try to access my application, they get the below error:
Execute permission denied on object 'SprocName', database 'DBNAME',Owner,'dbo'
The Only way I  could get rid off the error is if I set DBO permissions for the user group on the databse.
Can someone suggest how to set up a security group with the ‘necessary’ permissions on SQL SERVER (ie read,write execute Sproc etc) and not too many extra ones, like DBO.
Thanks,
 

View 2 Replies View Related

Truncate Table Permission

Jul 16, 2001

I have somme users who need to truncate some tables owned by DBO. I know that only table owner or DBO can execute TRUNCATE TABLE but I don't want grant DBO permission to those users. Do you have any suggestion ? Thanks a lot.

View 4 Replies View Related

Truncate Table Permission

Mar 17, 2000

I know that only the owner of a table can truncate it.
I want a user to run a procedure that truncates a table. Both the procedure and the table are owned by dbo, however the system says that the user can't truncate the tables because she doesn't have permission. The user has dataread and datawrite global permissions, and I do not want to give her dbo perimssions.
Is there a solution to this?

View 1 Replies View Related

Create Table Permission

Nov 4, 2005

Hi,

Is there any query available to check the existence of 'CREATE TABLE' permission in a database
?

Please advice,

Thanks,
MiraJ

View 1 Replies View Related

CREATE Table Permission

Sep 20, 2007

I gave a user explicit permission to create table, but still gettingthis error:Property Default Schema is not available for database[DBNAME]. Thisproperty may not exist for this object or may not be recoverable due toinsufficient access right. Microsoft.SQLServer.Express.SQLEditorsDo I need to create a new schema?--sharif

View 1 Replies View Related

Alter Table Permission To Dbo

Jul 20, 2005

I have the following requirementI am creating a login and database user 'test' on a database with dborole .I want to remove create table , alter table permisions to this user.I am able to revoke create table permission but alter table goesthrough.I gave a command deny insert,delete,update on ssycolumns to test.Still I am not able to prevent user altering schema . Alter tablesuccessfully goes throgh.I do not want to use datreader and datwriter role.since I want user 'test' to create storred procedure with dbo ownerIs there a way to achieve this ?ThanksM A Srinivas

View 1 Replies View Related

Critical Table Permission

May 12, 2008



Publc role has been grannted 'SELECT' privelege to syslogins and sysusers tables in the Master and GTSS database


The syslogins table contains all the logins that were created on the server. The sysusers table contains the users that are mapped to the database. Unauthorised access to these tables would reveal critical authentication info of other users

Restrictive permissions should be configured on critical database tables such as sysusers and syslogin.

How to set this.

View 1 Replies View Related

Permission On View Not On Table

Dec 14, 2007

I am trying to create a set of "Reporting" views and grant Select permission on those views instead of the tables. I created the view in the same database but under a different schema from the tables. When the user tries to select from the views they get an error saying they do not have select privilege on the tables. Do I need to grant them select on the underlying tables?

View 4 Replies View Related

Can't Create Table .no Permission?

Sep 25, 2007



question 1 :
I create a login account and a user account ,and then grant create table permission to the user.
But the user can't create table yet,it return a error message:
The specified schema name "dbo" either does not exist or you do not have permission to use it


But i can find the dbo scheam by querying sys.schemas.

the sql script i execute:

(sa login)



Code Snippet
use tempdb
go
create login l1 with password='a' ,check_policy=off
go
create user u1 for login l1
go
grant create table to u1





Code Snippet
(l1 login)
use tempdb
create table table1
(
col int
)


--fail
--error message:The specified schema name "dbo" either does not exist or you do not have permission to use it




question 2 :
The granularity of "grant permission to useraccount" command is database,while i want to get a table level of granularity.. how?

thanks

View 5 Replies View Related

What Is The Difference Between: A Table Create Using Table Variable And Using # Temporary Table In Stored Procedure

Aug 29, 2007

which is more efficient...which takes less memory...how is the memory allocation done for both the types.

View 1 Replies View Related

Create Table Permission Denied

Jul 8, 2007

Hi,i run an asp.net application which uses sql server express.i defined a login 'aspnet' (IIS 5.0) and for the specific database, an user 'aspnet' with following roles:db_datareader and db_datawriter.Now, any user who uses that application must also be able to create programmatically tables in that database. My question is: which role do i have to give to user 'aspnet'?
I use Studio Management express.ThanksTartuffe

View 8 Replies View Related

Permission Problems With A #temp Table

Aug 2, 2004

Hi,

I am having problems running a stored procedure that was created by the sa account. The stored procedure creates a temp table ( #temp_basf) and performs a bulk insert into it. The user account has execute privileges against the stored procedure. The error I am getting is:

The current user is not the database or object owner of table '#temp_basf'. Cannot perform SET operation.

Here is the code from stored procedure:


create procedure processFarmChemDataFile
as
begin
create table #temp_basf
(RTUId varchar(15),
LName varchar(20),
Address1 varchar(50),
City varchar(20),
StateCode varchar(9),
ZipCode varchar(15),
CName varchar(30),
Voice varchar(30),
Name varchar(25),
TankCap varchar(15),
TankHgt varchar(9),
notUsed varchar(20),
ProdDesc varchar(20),
InvTime smalldatetime,
GrVolume varchar(15))
end
begin
bulk insert #temp_basf from 'c: estdata.txt' with
(FIELDTERMINATOR = ',',ROWTERMINATOR = '')
end
begin
update #temp_basf
set RTUId = replace(RTUId,'"',''),
LName = replace(LName,'"',''),
Address1 = replace(Address1,'"',''),
City = replace(City,'"',''),
StateCode = replace(StateCode,'"',''),
ZipCode = replace(ZipCode,'"',''),
CName = replace(CName,'"',''),
Voice = replace(Voice,'"',''),
Name = 'Tank '+replace(Name,'"',''),
TankCap = replace(TankCap,'"',''),
TankHgt = replace(TankHgt,'"',''),
notUsed = replace(notUsed,'"',''),
ProdDesc = replace(ProdDesc,'"',''),
InvTime = replace(InvTime,'"',''),
GrVolume = replace(GrVolume,'"','')
end
begin
select CustomerId,LocationId,TankId,Temp,Alarms,SpecGrav,
CoeffExp,ProdCode,a.ProdDesc,UserProdId,UserTankId,
b.InvTime,b.RTUId,b.GrVolume,ChartId
from Tank a
inner join #temp_basf b on a.Name = upper(b.Name)
end


Thanks

View 1 Replies View Related

Select Permission Denied On Table

Feb 15, 2000

Why would we get the error 229 Select Permission on object denied when the user has select permissions granted? All tables in the database are accessible by the user but this one. All tables for this user have the same permissions: Select, Insert & update.

I noticed that the indexes were not set up correctly but even after fixing them it didn't help. what other reasons would cause this error.

This is an Access 97 database linked to SS7.

thanks

View 1 Replies View Related

Deny Drop Table Permission

Mar 9, 2000

Can any body tell me how can I restrict a user who has Sa previlages, from droping a table. He should be able to do everything except droping the table.

Thanx in advance.

Ram

View 2 Replies View Related

SQL 2012 :: Full Permission For Table

May 6, 2015

i need to set permission like full control, insert, update, delete etc .so the user can drop index and recreate and truncate data from a table.

View 2 Replies View Related

What Permission Required To DROP TABLE ?

May 2, 2007

Hi,
I would execute the following query to allow a user to create table

USE dbname
GRANT CREATE TABLE TO username

but it doesnt let me execute the following query
GRANT DROP TABLE TO username

I am wondering if there is a way to do this.

I know db_ddladmin does that. But I dont want to assign the whole role or schema to do that. I want specific privilege

According to SQL Server documentation, we need CONTROL permission to do this so I tried following query

GRANT CONTROL TO username

and

GRANT CONTROL ON tablename TO username

neither of them helped..

Please tell me what permission do I require to DROP a table.

Thanks,

View 5 Replies View Related

Grant Permission On More Than One Table In A Single Command

Aug 24, 2000

Hi

Does anyone know how i can grant select permission on more than one table in the same database using a single grant commmand....its painful to use grant statement seperately on each table

thanks and regards,
reshma

View 3 Replies View Related

Cannot Drop The Table '#ZipLatLong', Because It Does Not Exist Or You Do Not Have Permission...

Apr 8, 2008



I have a stored procedure that I am writing that is giving me trouble dropping a temp table in SQL Server 2005. I have to use the SQL in Query 1, marked below, to get the temp table. I can find the table but I get the error listed in this message's subject. If I try to run DROP TABLE #ZipLatLong I will get an error telling me that the table already exists but then I can run CREATE TABLE #ZipLatLong ( ZIP INT, Latitude DECIMAL(18,6), Longitude DECIMAL(18,6)) and that will work...

In short, SQL Server 2005 is not letting me drop temporary objects. I am getting return messages telling me that an object already exists in the database by the name I am trying to delete and then it will let me create a table with the same name...

Figure 1
USE TEMPDB
GO
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_CATALOG = 'tempdb'
AND TABLE_SCHEMA = USER
AND TABLE_NAME LIKE '#ZipLatLong%'
GO
DROP TABLE #ZipLatLong
GO

View 5 Replies View Related

Cannot Add Select User Permission For A Person On A Table

Feb 24, 2008



Hello,

I am trying to grant solely the SELECT privilige to a particular user and to a particular database.I am using Sql server management studio express to do this and SQL Server 2005.

I have created a new login and set the server roles to public, then on the user mapping page, I have checked the box next to the table I wish the user to access and have selected the database membership role - public.
Next, On the Table Properties, I have added the user on the Permissions Page and Selected "Select" under the grant column

When I click on effective permissions, the select command does not show and when I try to login with that user, the table does not display.

What I am doing wrong?

Thanks

View 7 Replies View Related

Insert Permission Denied After Granting Permission

Sep 19, 2007



SQL Server 2005 anomoly?
In SQL Server Management Studio I granted specific permissions to user "A" to do Select, Insert, Update, Delete on Table "B" -
When I logged on as User "A" and attempted the Insert imto table "B" I got the following error:
"Insert Permission Denied on Table B, Database C, Schema dbo"
Is this a problem with the dbo schema?

Then I went back and created a stored proccedure "D" with the exact same Insert statement inside the procedure. I granted User "A" execute permission on the stored procedure "D".
I then logged on as User A and executed Stored Procedure "D". No Problem - stored procedure executed fine with the Insert.
I attempted the Insert statement again - straight SQL - as User "A" and got the same error as above ("Insert Permission Denied.....")
Strange behavior - cannot do a SQL. Insert even though user has permissions but can execute a store procedure with the same Insert statement.
What gives?


View 2 Replies View Related

SQL 2012 :: Grant DROP Table Permission Within Database

Mar 26, 2015

How to grant DROP table permission within a database to an SQL login. I could see in Databae properties-> permission tab, there is an option to grant CREATE TABLE, EXECUTE permission etc, but not DROP table permission. How to grant it?

View 3 Replies View Related

SQL Security :: Provide Truncate Table Permission For A User

May 1, 2015

best possible way to provide truncate table permission to a SQL Server Database user (ddl_admin role cannot be granted to the user in my case)

View 3 Replies View Related

Permission On View. Is There Way To Avoid Granting Persmission On The Underlying Table?

Jul 13, 2007

I want to grant access on the below view for an end user so that he connect to our SQL server and retrieve data. The view looks like the below


CREATE VIEW DB1.[dbo].[View1]
AS
-- For brevity, I made it as simple statement.
SELECT *
From DB2.dbo.table2
GO

For the above view, it looks like I have to grant select and connect permission for the DB1. [dbo].[View1] as well as DB2.dbo.table2.

1. Is my understanding correct?

2. I want the user to access only DB1. [dbo].[View1] and not the underlying tables. Is there a way to grant access only on the view and execute the statement on a different security context so that the user can€™t access DB2.dbo.table2 directly?

3. When the user uses SQL Server Management Studio to connect to SQL server, he is able to connect and select DB2.dbo.table2 directly. Is there any way to restrict user from viewing and executing select statement on DB2 database from SQL Server Management Studio

Thanks in advance for your help

With regards
Ganesh

View 5 Replies View Related

SQL Server 2008 :: SSIS Login Role Permission To Insert Data Into Table?

Jul 9, 2015

When assigning permission to an authentication user to connect to a server database, if I want the user to be able to insert / update / delete data on db objects specifically tables, what permission should be assigned to that user?

My thoughts were Insert / Update / Delete; however, someone suggested that the Execute permission would do this ...

View 1 Replies View Related

Power Pivot :: Temp Table Or Table Variable In Query (not Stored Procedure)?

Jul 19, 2012

I don't know if it's a local issue but I can't use temp table or table variable in a PP query (so not in a stored procedure).

Environment: W7 enterprise desktop 32 + Office 2012 32 + PowerPivot 2012 32

Simple example:
    declare @tTable(col1 int)
    insert into @tTable(col1) values (1)
    select * from @tTable

Works perfectly in SQL Server Management Studio and the database connection is OK to as I may generate PP table using complex (or simple) queries without difficulty.

But when trying to get this same result in a PP table I get an error, idem when replacing table variable by a temporary table.

Message: OLE DB or ODBC error. .... The current operation was cancelled because another operation the the transaction failed.

View 11 Replies View Related

Is A Temp Table Or A Table Variable Used In UDF's Returning A Table?

Sep 17, 2007

In a table-valued UDF, does the UDF use a table variable or a temp table to form the resultset returned?
 

View 1 Replies View Related

SQL Server 2012 :: Update Table From Variable Table Column?

Oct 6, 2014

I am trying to use a stored procedure to update a column in a sql table using the value from a variable table I getting errors because my syntax is not correct. I think table aliases are not allowed in UPDATE statements.

This is my statement:

UPDATE [dbo].[sessions_teams] stc
SET stc.[Talks] = fmt.found_talks_type
FROM @Find_Missing_Talks fmt
WHERE stc.sessionid IN (SELECT sessionid FROM @Find_Missing_Talks)
AND stc.coupleid IN (SELECT coupleid FROM @Find_Missing_Talks)

View 2 Replies View Related

Indexes On Table Variable Of Table Valued Function

Jan 6, 2004

Hi there,

Can someone tell me if it is possible to add an index to a Table variable that is declare as part of a table valued function ? I've tried the following but I can't get it to work.

ALTER FUNCTION dbo.fnSearch_GetJobsByOccurrence
(
@param1 int,
@param2 int
)
RETURNS @Result TABLE (resultcol1 int, resultcol2 int)
AS
BEGIN

CREATE INDEX resultcol2_ind ON @Result

-- do some other stuff

RETURN
END

View 2 Replies View Related

How To Create Index On Table Variable (Table Don't Have Primary Key)

Feb 26, 2008



Hi all,


my stored procedure have one table variable (@t_Replenishment_Rpt).I want to create an Index on this table variable.please advise any of them in this loop...
below is my table variable and I need to create 3 indexes on this...


DECLARE @t_Replenishment_Rpt TABLE
(
Item_Nbr varchar(25) NULL,
Item_Desc varchar(255) NULL,
Trx_Date datetime NULL,
Balance int NULL,
Trx_Type char(10) NULL,
Issue_Type char(10) NULL,
Location char(25) NULL,
Min_Stock int NULL,
Order_Qty int NULL,
Unit char(10) NULL,
Issue_Qty int NULL,
Vendor varchar(10) NULL,
WO_Nbr varchar(10) NULL,
Lead_Time int NULL,
PO_Nbr char(10) NULL,
PO_Status char(10) NULL,
Currency char(10) NULL,
Last_Cost money NULL,
Dept_No varchar(20) NULL,
MSDSNbr varchar(10) NULL,
VendorName varchar(50) NULL,
Reviewed varchar(20) NULL
)

I tryed all below senarios...it is giving error...


--Indexing the @t_Replenishment_Rpt table on the column Names Item Number, Vender , Department Number
--EXEC sp_executesql(CREATE UNIQUE CLUSTERED INDEX Replenishment_index ON @t_Replenishment_Rpt (Item_Nbr))
--CREATE UNIQUE CLUSTERED INDEX Idx1 ON @t_Replenishment_Rpt.Item_Nbr
INDEX_COL ( '@t_Replenishment_Rpt' , ind_Replenishment_id , Item_Nbr )
--EXEC sp_executesql('SELECT INDEXPROPERTY('+ '@t_Replenishment_Rpt' + ', ' + 'Item_Nbr' + ',' + 'IsPadIndex' + ')')
--EXEC sp_executesql(SELECT INDEXPROPERTY('@t_Replenishment_Rpt', 'Vendor','IsPadIndex'))
--EXEC sp_executesql(SELECT INDEXPROPERTY('@t_Replenishment_Rpt', 'Dept_No','IsPadIndex'))


View 3 Replies View Related

The Age Old Argument Of Temp Table Vs Table Variable

Jan 26, 2007

Hi All,Hope someone can help me...Im trying to highlight the advantages of using table variables asapposed to temp tables within single scope.My manager seems to believe that table variables are not advantageousbecause they reside in memory.He also seems to believe that temp tables do not use memory...Does anyone know how SQL server could read data from a temp tablewithout passing the data contained therein through memory???Is this a valid advantage/disadvantage of table variables VS temptables?

View 2 Replies View Related

Delete SQL Table Using A Variable That Refers To The Table Name

Jul 20, 2005

SQLLY challenged be gentle --Trying to create code that will drop a table using a variable as theTable Name.DECLARE @testname as char(50)SELECT @testname = 'CO_Line_of_Business_' +SUBSTRING(CAST(CD_LAST_EOM_DATEAS varchar), 5, 2) + '_' + LEFT(CAST(CD_LAST_EOM_DATE AS varchar),4)+ '_' + 'EOM'FROM TableNamePrint @testname = 'blah...blah...blah' (which is the actual tablename on the server)How can I use this variable (@testname) to drop the table? Undersevere time constraints so any help would be greatly appreciated.

View 2 Replies View Related







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