Help Needed: Granting Create Table Permisions On Specific Schema Options

Sep 6, 2007

Having some trouble getting my head around setting access to specific
schemas- here's my problem:

I've created a specific schema that I only want certain users to
control


Problem: Even though I give them full access....the cannot create
tables under that schema...my code is below (flyer is the schema,
eflyerAdmin is the role, and eflyer is the user):

GRANT
ALTER,
CONTROL,
DELETE,
EXECUTE,
INSERT,
REFERENCES,
SELECT,
TAKE OWNERSHIP,
UPDATE,
VIEW DEFINITION
ON SCHEMA::flyer
TO eflyerAdmin
GO
-- Add an existing user to the role
EXEC sp_addrolemember N'eflyerAdmin', N'eflyer'

View 1 Replies


ADVERTISEMENT

Problems On Create Proc Includes Granting Create Table Or View Perissinin SP

Aug 4, 2004

Hi All,

I'm trying to create a proc for granting permission for developer, but I tried many times, still couldn't get successful, someone can help me? The original statement is:

Create PROC dbo.GrantPermission
@user1 varchar(50)

as

Grant create table to @user1
go

Grant create view to @user1
go

Grant create Procedure to @user1
Go



Thanks Guys.

View 14 Replies View Related

Granting A User Permissions To Create And Drop A Table

Nov 16, 2006

How do I allow a user (or group of users) permission to create/drop a table?

I have found the 'GRANT CREATE TABLE TO username' command, which will (I assume) allow a user to create a table, but how to I allow a user to 'DROP' the created table as well?
'GRANT DROP TABLE TO username' doesn't work?
and I want the users to be able to DROP/DELETE this table (temporary table created just for printing purposes) as well.

thanks

View 3 Replies View Related

Granting Permissions Using SQL 2005 Schema...

Aug 15, 2007

All,

I have been asked to grant a Windows group Full access to all tables under our Sandbox Schema. This will allow these users to do anything to the tables under this Schema.

I created the Windows Group (Sandbox Users), created the login in SQL, created the user in the database that is tied to the Windows group, then ran GRANT CONTROL ON SCHEMA::[Sandbox] TO [Sandbox Users].

I have verified that the users are in the Windows group, but they state that they still can not delete tables under the Sandbox Schema.

Anyone have any ideas?

Thanks,

Justin

View 5 Replies View Related

Create Target Table Dynamically Based On Source Table Schema?

Sep 13, 2005

I’ve got a situation where the columns in a table we’re grabbing from a source database keep changing as we need more information from that database. As new columns are added to the source table, I would like to dynamically look for those new columns and add them to our local database’s schema if new ones exist. We’re dropping and creating our target db table each time right now based on a pre-defined known schema, but what we really want is to drop and recreate it based on a dynamic schema, and then import all of the records from the source table to ours.It looks like a starting point might be EXEC sp_columns_rowset 'tablename' and then creating some kind of dynamic SQL statement based on that. However, I'm hoping someone might have a resource that already handles this that they might be able to steer me towards.Sincerely, 
Bryan Ax

View 9 Replies View Related

Tempoary Table Question - How To Create One With The Same Schema As An Existing Table?

Jul 28, 2006

Hello,

I'd like to create a temporary table with the same schema as an exiting table. How can I do this without hard coding the column definitions into the temporary table definition?

I'd like to do something like:

CREATE TABLE #tempTable LIKE anotherTable

..instead of...

CREATE TABLE #tempTable (id INT PRIMARY KEY, created DATETIME NULL etc...

I'm sure there must be a simple way to do this!

Many thanks,

Ben S

View 3 Replies View Related

How To Create This Table With Specific Heirarchy

Feb 20, 2007

Hi i need to create this query. I have a table here named "Subject" from the database "Filteredtask". I want the output to show in this way:

Subject Quantity

Application Recieved count of application recieved
Process Application count of process application
Screen Application count of screen application
Initial Interview count of initial interview
Technical Exam and Interview count of technical exam and interview

I have used this code. My problem is that i put it in descending order to obtain this output, but if for example Screen application had more count it will ruin the hierarchy of the subject.

SELECT subject, COUNT(subject) AS Expr1
FROM dbo.FilteredTask
WHERE (subject = N'application received') OR
(subject = 'process application') OR
(subject = 'screen application') OR
(subject = N'initial interview') OR
(subject = 'profiles assessment') OR
(subject = 'technical exam and interview')
GROUP BY subject
ORDER BY expr1 DESC

__________________________________________________
Your future is made by the things you are presently doing.

Andrew

View 4 Replies View Related

How To Create A CLR Integrated Trigger On Table In Schema?

Oct 6, 2006

In CLR integrated trigger:

If I want to make a trigger:
- For Insert
- With name: NewEmployeeInserted
- On table dbo.Employees

I add the following attribute above the desired .net method logic:
[SqlTrigger(Event = "For Insert", Name = "NewEmployeeInserted", Target = "Employees")]

How to make a trigger on for example: Production.Employees table?
where Production is the schema where this table resides.

Thank you.

View 1 Replies View Related

Is It Possible To Create A Schema Or Table From A Dbf File Instead Of Manully Creating It

Oct 26, 2007

Is it possible to create a schema or table in sql server from a dbf file instead of manully creating it
 
Regards
Karen

View 1 Replies View Related

Restrict Role To CREATE TABLE On An Assigned SCHEMA

May 9, 2008

Can anyone help me with this? The objective is to allow an application user (with db_datareader & db_datawriter database roles assigned) to be able to create tables in the assigned schema (dbo) via a new role.


-- Create User

use master

go

create login DBA with password='xx', CHECK_EXPIRATION=ON, CHECK_POLICY=ON

use AdventureWorks

go

create user dba from login DBA
alter user dba with DEFAULT_SCHEMA=dbo

go

-- Create Role

use AdventureWorks

go

create role sp_ddl_role AUTHORIZATION dbo

grant CREATE TABLE to sp_ddl_role



-- assign user to Role

use AdventureWorks

go

exec sp_addrolemember sp_ddl_role, dba

go

-- Create Table statement then run with following error
Error:

Msg 2760, Level 16, State 1, Line 1

The specified schema name "dbo" either does not exist or you do not have permission to use it.

Remedy: Grant ALTER on schema::dbo to sp_ddl_role

My problem is that I want to restrict user permissions via this role to just the CREATE TABLE and granting ALTER on a SCHEMA will open up a whole lot more permissions from a security standpoint.

Question: How do I restirct this role to just the CREATE TABLE within a SCHEMA?

View 1 Replies View Related

Granting Permission To Create View

Jul 20, 2005

What is the best way to grant a user permission to create a view?I first created a role using enterprise manager but for the role Icreated it doesn't seem to offer that permission. It offers the basicstuff such as insert, select, and update.I could go in and use a grant create view sql statement I suppose butI'd rather do it through enterprise manager where it would be visibleif I need to change it in the future.-David

View 3 Replies View Related

Reporting Services :: Rendering Options For Report Specific

Apr 29, 2015

I want to Set Rendering Extension Report based,

Example

Report 1 should have the rendering options of EXCEL and PDF.
Report 2 should have the rendering extension of EXCEL only.

I referred below link for change the rendering extension. [URL] .... but its for all the reports format.

View 6 Replies View Related

Can You Backup And Restore Tables That Belong To A Specific Schema

Apr 30, 2008

Hi all,

does anyone know of a way in which you can backup and restore objects that belong to a specific schema?

So in this example, I€™d want to only back up and be able to restore the tables that belong to schema 1, leaving Schema2 stuff alone.

--DB
----Schema1.Table1
----Schema1.Table2
----Schema2.Table1
----Schema2.Table2

Thanks in advance,

Andy.

EDIT: I forgot to add that I want to backup the tables and the data contained within.

View 4 Replies View Related

Question - Replicating Schema Without Data For Specific Columns

Aug 30, 2007

Good morning,

I have a table that I am including in replication. However, I do NOT want the data for one of its columns to be included in the replication. Meaning, I want all of the schema and all of the data EXCEPT for a single column.

How do I do this?

I have searched the forum for some ideas, but did not find any.

Thanks in advance...

View 13 Replies View Related

Specific Data Needed For Testing

Jan 15, 2008



Hello,

I am looking for a number of concept hierarchies (i.e. hierarchy with is-a relationships) describing the same domain that are accompanied with the instances from which the concept hierarchy was obtained. I have been trying to find some data suitable for representing the extracted knowledge in form of concept hierarchies so that can obtain at least two concept hierarchies from the same domain that differ slightly. In this sense the data needs to have multiple class (target) values and there has to be a hierarchical relationship between the classes. I have looked at the datasets publically available from 'uci' website and some others, but so far it appears that only the Zoo dataset is suitable to be represented in a form of concept hierarchy but it is still closer to a decision tree. I have seen some bird-domain or more specifc animal kingdom hierarchies but I cannot find those more specific datasets. Does anyone know where some concept hierarchies with instances can be obtained or datasets with multiple hierarchically related class values? Any help would be greatly appreciated.

Thanks

View 4 Replies View Related

How To Create An Copy Of A Certain Record Except One Specific Column That Must Be Different && Insert The New Record In The Table

Sep 1, 2006

Hi
I have a table with a user column and other columns. User column id the primary key.

I want to create a copy of the record where the user="user1" and insert that copy in the same table in a new created record. But I want the new record to have a value of "user2" in the user column instead of "user1" since it's a primary key

Thanks.

View 6 Replies View Related

SQL Server 2014 :: How To Give Permissions To Specific Schema Only For A User

May 20, 2015

I created a new login and then created a new user [COM] in DB with default schema pointing to [COM]

I created then schema [COM] WITH AUTHORIZATION [COM]

I want this [COM] user to have all permissions it needs on [COM] schema only. How do I do that? When I try to create table [Com].Table it gives me permission denied.

What am I missing?

View 9 Replies View Related

Can Logging Be Turned Off On Inserts To A Specific Temp Table From A Specific Sp?

Oct 10, 2007

I want to ship 500,000 aged transactions each night to an archive table and delete them from their source table in one or more logical units of work (LUW). Each row is approx 60 bytes and there is only one non clustered index on the source table presently.

I'm trying to weigh the pros and cons of 3 alternatives. One of them would basically insert the non-aged rows into tempdb, ship the aged records, truncate the table and then insert the tempdb records back into their source all in the same LUW.

For this alternative, I'd at least like to turn off logging when the records get inserted into tempdb as I dont see any value in logging that part of the activity. Is this possible?

View 4 Replies View Related

SP Permisions

Oct 6, 2000

lets look in this simply SP:

---------------------------------

CREATE procedure test
as
Declare @cmd nvarchar(1000)

SET @cmd=N'Select * from Users'

exec sp_executesql @cmd

---------------------------------

User has rights only for executing SP in my DB. So my question is: why he can not execute this SP??? (error with permision on Users table). It is strange and now I have to add SELECT permision on USERS table for this user. This SP is running without problems:

CREATE procedure test1
as
Select * from Users

So why 'test' isn't running???

Fly

View 3 Replies View Related

T-SQL (SS2K8) :: Create Index With Few Options

Mar 22, 2014

I would like to create an index with a few options but having issues trying to parse and run it successfully. The issue is near the end of the statement. Here's the create statement below:

-- Index PSAPSACTIVITYDEFN on table PSACTIVITYDEFN
IF EXISTS(SELECT 1
FROM sysindexes si
INNER JOIN sysobjects so
ON so.id = si.id

[code]....

View 4 Replies View Related

Permisions To A View

Mar 18, 2008

Hi all,It is my understanding that you grant select permissions to a view for a user and they should be able to select from columns in that view. However I have done that and they receive permission denied when trying to select from that view. Am I missing something? I shouldn't have to grant permissions to that table or the database for them to select. Thanks in advanced for the help.

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

Create Schema

Feb 26, 2008

what wrong ?

IF NOT EXISTS ( SELECT * FROM sys.schemas WHERE [name] = 'ATypes' )
BEGIN
CREATE SCHEMA [ATypes] AUTHORIZATION Owner_SchATypes;
END
GO

why I get an error ?


Noam Graizer

View 3 Replies View Related

How To Create A New Schema

Apr 24, 2007



How can I create a new schema inside a database from Managment studio express.



Also can someone explain me the concept of schema clearly. If database is like a house, then is schema like a room in it ??

View 3 Replies View Related

SQL Help. CREATE SCHEMA

Nov 2, 2007

I€™m trying to create an index on a view. I get the error that €˜the view is not schema bound.€™

Soooo, I try to put it in a schema.

This is the syntax I am using -

CREATE SCHEMA AUTHORIZATION painter
CREATE VIEW large_paints AS
SELECT paint_id,color FROM paint WHERE paint_size=100
CREATE INDEX idx on large_paints (paint_id);

I get the error - Incorrect syntax near the keyword 'INDEX'.

Any ideas?

View 1 Replies View Related

Create Schema Error

Mar 25, 2008

IF NOT EXISTS (SELECT 1 FROM Sys.Schemas WHERE [Name] = N'HR4')
CREATE SCHEMA HR4 AUTHORIZATION [dbo]

The above statements gives me an error saying "Incorrect syntax near schema". But the following code works fine.


DECLARE @sql varchar(100)
set @sql='CREATE SCHEMA HR4 AUTHORIZATION [dbo]'
IF NOT EXISTS (SELECT 1 FROM Sys.Schemas WHERE [Name] = N'HR4')
exec(@sql)

Any ideas on what is causing this error?

Thanks!

View 1 Replies View Related

Create A Default Schema

May 22, 2008



I Would like to create a schema sample and make it as default schema instead of dbo.

If a user logs in and creates a table like create table t1 (no int ) .
it would be assigned to sample schema and displayed as sample.t1 not dbo.t1.


How to set the user created schema as primary schema.

View 9 Replies View Related

Create Database Models From XML Schema (.xsd)

Dec 19, 2006

Hi .Net Guru’s,I have an urgent requirement for my project; the issue is mentioned below;Using .Net(C#/VB.Net) I need to generate/created Database objects from XML schemas.I don't have any sample xml schema file to give you. You just imagine you have a sample .xsd file and this .xsd file will be used to create database tables.Please let me know if you have any queries. Thanks,nick

View 1 Replies View Related

Create An XML Schema For A SQL Database Structure

Nov 5, 2004

Hey,

I was wondering does anyone know a way to get the structure, with relationships, of a Sql Database and generate a XML Schema. I want to use the Schema to build a CrystalReport.

Thanks!
-Kevin

View 1 Replies View Related

Create New Schema Using Management Studio

Jul 30, 2007

instead of CREATE SCHEMA using T-SQL

View 1 Replies View Related

CREATE SCHEMA In Db A From A Stored Procedure In Db B

Apr 18, 2006

Hi All
I have a SP that i create tables and other objects on another database.

Creating table work well.

declare @s nvarchar(2000)
set @s = 'use db01'
set @s = @s + 'CREATE TABLE ABC (recid int)
exec (@s)
------------------------------------------------------------------------

But if i try to create a schema it gives error :
'CREATE SCHEMA' must be the first statement in a query batch.

declare @s nvarchar(2000)
set @s = 'use db01'
set @s = @s + 'CREATE SCHEMA AAA
exec (@s)
How can i solve it?

Thanks.

View 5 Replies View Related

How To Create An SQLCE Database From An XML Schema?

Oct 11, 2007

Greetings,



I've searched through this and other SQLCE newsgroups, and it would
appear that whenever this question is asked, it is deflected or left
unanswered. I'll try again:





Is there any way to create SQLCE database tables from an XML schema
(preferably in .NET with C#)? Of course this can be done with the .NET
DataSet, but there doesn't appear to be any way to get the DataSet to
create the tables in the SQLCE database (although the reverse can be
done). I won't go into long explanations of the application, but it
does not ever have any connection to an SQL server, and we don't want
to create the SQLCE tables in code. We *only* want to create them
using an XML schema. Is the only option writing our own code to do this?



TIA

View 3 Replies View Related

Deny Create Schema Still Does Not Work In 2k8

Aug 3, 2007

You can't assign a default schema for a user that maps to a Windows group. OK fine. But if you create a user for that group anyway with no default schema, any objects created by members of that group will automatically cause a schema to be created for them, EVEN WHEN THAT USER HAS BEEN EXPLICITLY DENIED THE CREATE SCHEMA PERMISSION IN THE DATABASE. This is the same as it was in 2K5, but has still not been fixed in 2k8.

To reproduce, do the following steps:
Create a windows group, either in the doman or local to the box.
Add at least one Windows user to that group.
Create a SQL login for that Windows group.
Map that login to a new user in some database.
Explicitly 'deny create schema to ' that group/user.
Grant 'create procedure' to that group/user.
Log onto SQL with a Windows login that is a member of that Windows group
Use the database that we set the permissions in above.
Create a dummy stored procedure without qualifying the name with a schema ie: 'create prodedure test1 as select 'hello world').
Look to see what you ended up with. You will have a new schema named the same as the user who created the sproc. This will now be their default schema implicitly, and the test1 stored procedure will be in that schema, EVEN WHEN THAT USER WA EXPLICITLY DENIED THE CREATE SCHEMA PERMISSION IN THE DATABASE.

Could you please fix this?

View 3 Replies View Related







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