I have some tables sitting in schema "A", then I created a view in schema "B" based on the tables in schema "A". Then I gave the user just access to schema "B" to only run the view but not see the tables in schema "A".
Could it be that if the user tried to ODBC to that db, they would only see the view in schema "B" and not the tables in schema "A"?
This started as a simple thing, allow somebody to access to a database on a SQL 2005 server so they could get to it from MSAccess. I have created a login (Windows Authentication) so they can see the database and gave them "public" and "datareader" abilities.
The user then informed me that while they could see the views they could not see the data. Not being a DBA (sorry) I added "public" to the view's permissions (under properties) and granted it "Select" access and nothing else. After I completed this the user could not even see the views to pick them (via the ODBC link from MSAccess) and when I try to remove "public" from the permissions it dissapears, but when I reopen the permission "public" is back.
I then find out there is no data in the views and so the user would not have been able view anything anyway.
So what I want to do is remove "public" from the views permissions, is this possible?
Hi I'm building a data warehouse - my end users connect using Access via ODBC Microsoft SQL Server driver (2000.85.1117.00).
However, whenever they connect using Access via ODBC they get a huge list of sys and INFORMATION_SCHEMA views, in addition to the data warehouse tables they need to access.
How can I remove these sys and INFORMATION_SCHEMA views from the list of tables/views presented to the end user?
I've tried denying access by changing permissions to deny in the public role of the master database - I have also changed permissions in the public role in the data warehouse database. When I do this, the ODBC connection fails to retrieve any objects because it doesn't have access to sys.databases (and various other unspecified objects). I'm stuck - help!
I maked ODBC for SQL erver data base and linked with Access database which is working good but when I check ODBC link in access it shows alot of other stuff and all tables related to that database .
Is there any way to remove irrelevant tables/views etc from that ODBC - thanks for help
We have allowed one of our clients to create views in our .net /sql application so they can build reports using MS Access. They have been doing so successfully for years. However lately they are experiencing Timeout Expired messages when in the actual web application. I have confirmed that several of the views when opened in Access do cause blocking, the locks are promptly realeased when the the access odbc of the sql view is closed.
When the views are opened in SQL query analyzer, there is no sql blocking.
Would this be related to how the tables are linked?
Fellow database developers,I would like to draw on your experience with views. I have a databasethat includes many views. Sometimes, views contains other views, andthose views in turn may contain views. In fact, I have some views inmy database that are a product of nested views of up to 6 levels deep!The reason we did this was.1. Object-oriented in nature. Makes it easy to work with them.2. Changing an underlying view (adding new fields, removing etc),automatically the higher up views inherit this new information. Thismake maintenance very easy.3. These nested views are only ever used for the reporting side of ourapplication, not for the day-to-day database use by the application.We use Crystal Reports and Crystal is smart enough (can't believe Ijust said that about Crystal) to only pull back the fields that arebeing accessed by the report. In other words, Crystal will issue aSelect field1, field2, field3 from ReportingView Where .... eventhough "ReportingView" contains a long list of fields.Problems I can see.1. Parent views generally use "Select * From childview". This meansthat we have to execute a "sp_refreshview" command against all viewswhenever child views are altered.2. Parent views return a lot of information that isn't necessarilyused.3. Makes it harder to track down exactly where the information iscoming from. You have to drill right through to the child view to seethe raw table joins etc.Does anyone have any comments on this database design? I would love tohear your opinions and tales from the trenches.Best regards,Rod.
I'm trying to understand the schemas in SQL Server 2005. I have a script which was given to me by someone as follow and I'm trying to run the script but it gave me an error at the create view section:
Assume an empty database has been created.
CREATE SCHEMA [mySchema] AUTHORIZATION [dbo] GO
CREATE TABLE [tblABC] ( ... ) /*note: it didn't bind the table to the above schema*/
create view mySchema.vwMyView as SELECT * FROM mySchema.tblABC GO
However I'm confused because the above CREATE VIEW made a reference to the table with the schema. Can someone help clarify. When i tried to create the view, it gives me an error that it is unable to find the mySchema.tblABC table. To me, the error is correct as per my understanding of binding a table to a schema ---> If you do not create a table and bind it to a schema, you are not able to call it together with the schema.
What I'm trying to understand is, without explicitly stating [mySchema] during the table creation, is there a way where it is mysteriously binded thus the CREATE VIEW somehow understood that tblABC has been binded therefore it called the table in the view? or is this just a script error.
Btw, this script was generated from a working database.
Hi,Anyone know an online source for database schemas, or schemas for singletables i.e. where can I download a schema for an addresses table?--Richhttp://www.badangling.com -= Sea fishing badly explained =-
Is there any way to create a local database cache from an SQL 2005 database that uses non standard schemas (like AdventureWorks). I have tried in Visual Studio 2008 but any database that does not use .dbo will not allow any tables to be copied locally. Even setting the default schema for my login does not enable adding any tables in the Configure Data Synchronization dialog box. If it is not possible via Visual Studio is there any other way? I notice all examples with Sql Compact conveniently use Northwind. Seemingly Compact edition does not support non .dbo schemas.
I have schema called [sitex] for some tables . I have to perform insert or update operations in to these tables through views only and these views were created with [site] schema
All stored procedures are written in the point of view only ( all DML operations into the tables are through views).and these stored procedures has schema same as views.
Now come to the permissions and authorization.
We have some users like sa,112,janu
These users must have permissions only on site schema not on [sitex]. I have a role called €œtestrole€? with 112,janu users and I gave authorization on site schema on for testrole
ALTER AUTHORIZATION ON SCHEMA::[site] TO [testRole] Now I€™m getting error select permessions are denied on [sitex] schema.
But our requirement is 112 must don€™t have any type of permissions on tables
And also is there schema to schema permissions. (that mean [site] schema has permissions on [sitex] schema .
Can anyone give an introduction to the use of schemas i SQL Server 2005. If have noticed the feature, but i would like to know why and how the use of schemas is a good thing.
If anyobe has a link to a whitepaper or practical insight that would be nice.
We're using Sql Server 2000. The one database contained tables and stored procedures which were possibly updated with some script information. Is there an application(commercial or free) or script I can use to compare the base database against this updated database to confirm there schema information is the same.
I'm trying to find some documentation or procedures that will allow me to xfer existing users' roles, etc from sql2000 to sql2005. When our sql 2005 database was restored on a new server (from sql2000), all of the database users were orphaned. I need to create identical server logins and then make the logins database users. It is also important to understand the significance of the new schema concept. The Microsoft SQL2005UpgradeTechRef.doc white paper does not explain any of this. Ultimately, I would like to create a script for the above scenario once a sql2005 db is restored from a sql2000 db. Could someone please help me out on this?
Is there a way to create a table in SQL Server Management Studio under a different schema? I've tried setting my default schema and adding a table, but that didn't work. I know I could do it with a SQL statement, but wanted to know if I could do it with the designer.
I'm looking to gather ideas on this before I start the project; so what better way to start than to ask here? ;)
The situation is this: we are in the process of replacing a large data driven application with a new one. Before turning the old'un off (that's not for a minimum of 6 months), we need to migrate data between the two entirely different schemas, and I've been tasked with writing the interfaces.
Now, here comes the kicker; they don't just want a "straight-forward data conversion", they want to run a period where they can still update both databases and any changes in the old one are to be pushed into the new db.
Because the schemas are not the same, I believe replication is out of the question so I was looking for advice as to what possibilies I have ahead of me to achieve this.
I fear I may not have expained this well enough; so as always if there are holes in the detail let me know and I'll do my best to fill them in :)
Hi eveyone, I'm reading about namespaces and schemas in MS SQL 2005, and that's exactly what I was looking for for the structure of my database.
I've a database and 4 different applications that will use it, and every application will create a new database every year, for example, i'd like to use the following schema:
MainDatabase.MyApplication.MyYear.MyTable
In MS SQL i've created my main schema using:
USE Mydatabase; CREATE SCHEMA MyApplication GO
Now I want to add sub-groups (in this example, I need to create Year2006, Year2007, and so on).
Even If i create those schemas, how can I "add" them inside the Salary main schema? I've tryed with ALTER SCHEMA MyApplication TRANSFER Year2006
but it doesn't work since Year2006 is not an object.
We have a system with multiple modules, for each module we have a separate database. Is it better to have multiple databases or have multiple schemas. Performance, advantages, disadvantages... When is too much too much, 10-25-50-100 Schemas???
I am looking for some advice on securing a sql 2005 database.
I have a database to which I want to grant 3 different users access.
The first users, who we will call 'public' should have access to a set of stored procedures, and no access to tables without using the stored procedures they have access to.
The second users have again got access to a certain set of stored procedures, along with the stored procedures for 'public'. These should be called 'moderator'.
Finally the third set of users 'admin' should have access to all stored procedures, but again no access to the database unless its through a stored procedure.
Questions :
Using SQL 2005, how do I assign access to particular stored procedures to a user?
How do I ensure that a 'user' cannot access stored procedures I don't want them to access?
Some of the stored procedure use dynamic sql within them, will this affect my setup. If I deny direct access to the tables to all three users, but allow them access the stored procedures, can the stored procedures access the tables?
If schemas are the answer, how on earth do I set them up, Ive never seen something so badly documented online in my experience! In my development environment im using sql express, so will probably working through the query analyzer.
Hi, I am storing information being sent to me weekly into a ms sqldatabase. The one twist I am running into is that later down the linethe information I recieve may require more columns, or columns mightbe renamed so having a static database call is out of the question. Iwas using mysql but for certain reasons switched to ms sql 2000.Currently before ms sql, I query the database for show fields whichreturns all the database data such as type, column name, etc... then Iuse a giant if statement structure to deal with matching andconverting data from my users display to the information into thedatabase.So my first question is how do I either query or using datatypes builtinto C# return information about a tables setup. I was hoping therewas some sort of table array object which could be returned with namesand types, if not then just an sql statement return.My second question is I have user data which needs to be displayeddifferently then the database raw data, how do I use a C# dataset, andconvert it's column data into my raw database data without having tocreate raw insert and update sql strings myself? I would really liketo use the sort of automatic update features of the dataset.Lastly am I going about this the wrong way? Are there other ways tomap & convert datatypes between a dataset column and a table column.
My problem is very simple and that is that I'm trying to copy some tables between databases, but these tables are in different schemas. let's say I have
dbo.tableA sch1.tableA sch2.tableA sch3.tableA And I just want to copy let's say sch1.tableA to a Different DB. If I use Transfer SQL Server Object task and select the table and save the package and try to open the task again, all the tables with name TableA will be selected!! it seems like although it does show the schema ( when I am selecting the table manually ) but it doe snot store the schema detail in the tablelist collection property of the task. Would please recommend any other way to achieve this. Many Thanks in advance
I have 2 different databases and an import tool that reads from one and fills the other one and then whenever we run it, it should synch the two databases and its kind of a heavy task. I was wondering if i can replace it with replication between these databases. I defined publisher and subscriber, but i cannot find anywhere that i can say which field in source maps to which field in destination.
Is it possible at all to have a replication between 2 databases with totally different schemas? If so, please let me know how.
I'm trying to find some documentation or procedures that will allow me to xfer existing users' roles, etc from sql2000 to sql2005.
When our sql 2005 database was restored on a new server (from sql2000), all of the database users were orphaned. I need to create identical server logins and then make the logins database users. It is also important to understand the significance of the new schema concept. The Microsoft SQL2005UpgradeTechRef.doc white paper does not explain any of this.
Ultimately, I would like to create a script for the above scenario once a sql2005 db is restored from a sql2000 db.
I have noticed that some folks create a user to own a schema, with both having the same name (ex: userowner = pfm schema = pfm) and others make dbo the owner for all their schemas. From what I can tell, it doesn't really matter; what does matter is if your database users are granted access to the schema. Since most users only have public rights and dbo has database owner rights, is there any particular reasoning to use one scenario over the other?
Hi there; i've recently designed a new db for my portal website, and wanna move the old data from former db to the new one. The problem is that for the 'News' table, for instance i have two different schemas:Old >>News(id,title,summery,text,date, ... , (old columns) , ...)New >> News(id, title , summery , text , date, lastUpdated, ... , (new columns) , ...) i want to copy the bolded columns, and want to have 'lastUpdated' & 'date' in the new table to be the same as 'date' in the former one.as i googled, i just found materials on copying dbs to production servers, or cross db scenarios. thanks in advance
I have an application using SQL server 7.0 and have it installed at numerous sites. At the moment when an upgrade is carried out it generally includes changes to the database schema, at the moment these changes are tracked by saving lots of change scripts and running them as batch files. This process of update is quite time consuming and any errors that occur are not obvious so the upgrades must be carried out by our own staff. I was wondering two things:-
1) How do people manage this kind of problem. 2) Are there any tools that help to cope with this problem.
I have a SQL Server 2012 Enterprise Edition install that I am needing to do the following:
- Provide db_owner access to a single user. Have the db_owner privilege apply for the user in all Schemas of the database (this is a generic AD account that is being used for an application).
They are wanting me to do this because they do not want to get so granular as to tell me all of the objects that the user will need specific access to in any of the given Schemas of the database(s).I have 8 databases, and each one has additional Schemas. These are all contained in a Default instance.I am finding that without explicitly applying permissions to the various objects in the Schemas that are not the default Schema for this user, I am a bit stuck.Is there any way to have the db_owner permission apply to the single user for all the Schemas in a given database (without making them a Sysadmin)?