SQL 2005 Schema Best Practices

Jan 3, 2008

Hello,

In general, with the introduction of schemas in 2005, is it considered "bad practice" to tell people to create new tables in the "dbo" schema?

Our product documentation contains a "quick start" guide for users who just want to get the product up and runing. We suggest that the customer creates a database for our application. This database is configured with a user that is assigned to the 'db_owner' role (we want to keep things as simple as possible) that we use to connect to the database. This database will only be used by our application. In this situtation is it okay to use the "dbo" schema, or should we consider creating another schmea for all our tables?

Are the any "best practices" for using schemas in SQL 2005?

Thanks,
Brenden.

View 7 Replies


ADVERTISEMENT

SQL Best Practices Analyzer Rule: Use Of Schema Qualified Tables/Views

Dec 17, 2005

SQL BPA says the following:"One or more objects are referencing tables/views withoutspecifying a schema! Performance and predictability of theapplication may be improved by specifying schema names.""When SQL Server looks up a table/view without a schemaqualification, it first searches the default schema and then the'dbo' schema. The default schema corresponds to the currentuser for ad-hoc batches, and corresponds to the schema of astored procedure when inside one. In either case, SQL Serverincurs an additional runtime cost to verify schema binding ofunqualified objects. Applications are more maintainable andmay observe a slight performance improvement if objectreferences are schema qualified."How important is to specify the schame (dbo. in my case) instored procedures? Will it really improve performance if I goand fix each object that is missing "dbo."?The problem is I have thousands and thousands of themwith no schemas. Before I invest a lot of time fixing themI am trying to determine if it's really worth it or not?Thank you

View 1 Replies View Related

Best Practices For Accessing A Sql 2005 Db On The SAME Box As IIS 6.0 Serving Asp.net 2.0

May 17, 2007

I am re-posting this from the security Forum where it remains un-answered.

OK, Here's the set up.

I have a Windows 2003 box, soon to have SSL installed

On it is IIS 6.0, SQL 2005 Standard Edition (5Cal user lic)



SOON I'll have a prod enviornemnt where a web app being served by IIS is accessing SQL. I can go into SQL and set up a user account, call it MyAppSQLAcess, and code that into the connectionn string and lock it down to the tables/db it has access to. Or I can do it w/windows authentication, or I can do it a number of other ways, the question is this:

What is the best way for an asp.net app being server by IIS 6.0 to access data from SQL 2005 server when they are all on the same BOX? WRT Speed and security?



Thanks



Dan

View 2 Replies View Related

Fresh 2005 Install Best Practices

Oct 16, 2007

I have just completed a default install of MS SQL Server 2005 x64 edition on a 1 processor Quad core, 8GB, Windows Server 2003 Standard x64 R2 machine in an Active Directory Domain. It has 2 arrays configured with 2) 36Gb drives mirrored for the OS as C: and 3) 147Gb drives in a RAID5 array as E: drive.

I am simply the server guy who was asked to install SQL server for some projects in the future. The company will be bring in people to to the dev.

I wanted to setup the server as best as I can and so I've been searching around for "best practices" for fresh installs.

Anyone have any suggestions on things to configure/setup to improve the performance of the default install?

In addition, I want to redirect the databases to the E: drive and separate them from the OS drive (C:). Does anyone have any information on doing this? I have searched and found a few articles, but thought I would ask first.

It is probably noticeable that I have limited SQL configuration skills.

Thanks,
A simple IT guy trying to build a system right

View 4 Replies View Related

SQL Server 2005 Min/Max Security Best Practices

Jun 13, 2007

Does anybody have a link to either of these two documents. My company is getting ready to go through an audit and we need some firepower and to know what is expected. Any help with obtaining microsoft SQL Server 2005 best practices documents is appreciated.

-Kyle

View 3 Replies View Related

Best Practices For Handling Deadlocks In Sql 2005 And Beyond

Jan 14, 2008

Greetings
I have a scenario where a table's after insert & after update triggers write to a history table. On this particular table, the history rows are quite small, so the occassional deadlock condition is inevitable.

In SQL Server 2000, I taught the application guys to handle these kinds of exceptions themselves, sleep a second, and retry. In 2005 (and I assume 2008) we now have TRY CATCH in T/SQL.

What are the pro's and con's of catching deadlocks in your T/SQL code (triggers or sprocs) .vs. the "old way" of catching it at the application level? I'm sure this has been discussed before, but search returns a lot of unrelated postings...

I'm thinking it's better to catch this at the application level, under the assumption that it's better to make the client(s) do the work than the database, but I'm sure there are considerations I'm not taking into account here. What experiences do you folks have to share on this?

Thanks!!

View 8 Replies View Related

2000/2005 Memory Best Practices

May 9, 2007

Does anyone have any advice or useful experience configuring memory management for SQL Server 2000 and 2005 instances residing on the same box? I'm looking for advice on whether I should just completely leave it up to SQL Server and Windows to allocate memory or should I attempt to put ceilings on certain instances.

Any help is appreciated!

View 6 Replies View Related

Upgrading SQL Server 2000 To 2005 Best Practices

Dec 23, 2007



Hello all,

I'm finding the documentation online to upgrading from 2000 to 2005 fairly poor.

What are the upgrading options and which one is the best option for a web server database.

Also what are best practices pre-upgrade, during upgrade and post-upgrade.

Cannot find much online.

Also since this question will be asked often might as well make it a sticky.

Thanks

View 3 Replies View Related

Best Backup/restore (OLTP/OLAP) Practices In 2005

Aug 14, 2007

We have a live OLTP database for which we create full backups every week and differential backups every day. Recently we added an OLAP database, which we need to update daily with changes from the live database.

This is the process we are planning to use.
1. Restore last full OLTP backup.
2. Apply the last differential OLTP backup.
At this point we should have a replica of the live OLTP database.
3. Update OLAP database based on the OLTP replica database.
4. Delete the OLTP replica database.

Two questions.
1. If different from the process above, how is this OLTP-to-OLAP transformation typically done in the industry?
2. What is the best way to implement this process with SQL Server 2005?

Thanks.

View 3 Replies View Related

Best Practices SQL Server 2005, SSRS, SSAS, SSIS Setup

Oct 8, 2007

I would like to know best practices for setting up my environment. To date, I've had everything running on a single server. That would include the database engine, SSIS, SSAS and SSRS. The box configuration is dual hyperthreaded 3.6GHz Xenon with 4GB of RAM on Windows Server 2003. I just received a much larger server and want to configure it to maximize our environment. The new box contains four 2.6GHz Quad Core processors with 16GB of RAM. I would like to know if I should split the ETL and database engine from SSAS and SSRS, or should this box have enough horse power to house it all and use my other box as a dev environment. Also, we are planning to purchase Performance Point 2007 primarily for PAS and Scorecard Manager so please take that into consideration as well. Any comments are greatly appreciated.

Thanks.

View 1 Replies View Related

Microsoft Best Practices For Implementing Windows Authentication For Sql Server 2005

Nov 10, 2005

Microsoft recommends using Windows authentication instead of SQL Server authentication in SQL Server 2005 for improved security. What are the Microsoft best practices for implementing this? Will be helpful if someone also provides some links that talks about this.... 

View 5 Replies View Related

Best Practices (set-up): Should SQL Server (2005) *not* Be Installed On The Same Physical HD As The Windows OS (Server 2003 R2

May 22, 2008

Re: Best Practices (security): Should SQL Server (2005) *not* be installed on the same physical HD as the Windows OS (Server 2003 R2) ?

Hi,

We're setting up some new servers, and today I'm looking into best practices for the SQL Server Setup portion of it.

The servers have include 2 x 250G HD, and from what I've read, where IIS is concerned, it should not be installed on the drive that has the OS on it, for security reasons. I was wondering if the installation of SQL Server should be on the non-OS drive as well ?

Thanx,

Barry O'Neill

View 6 Replies View Related

SQL 2005 Schema Issues

Aug 31, 2007

I just upgraded from SQL 2000 to 2005 and have been reading up on the new 2005 schemas and how they can be used to simplify assigning permissions, etc.  I started experimenting yesterday with a dummy database and ran into a few issues in which I have questions.  Note, I am wanting to use Windows authentication as much as possible where end users will be accessing the database via a mapped Windows group.  Based on what I've read thus far on the net this presents an issue in that users who access the database via a mapped windows group are not assigned a default schema.
My concern with migrating to using schemas for protecting objects is the potential for breaking existing applications based on the way objects are referenced in code.  Most of the existing code simply references the object only ...such as 'mytable' vice 'dbo.mytable'.  If I understand SQL 2005 schemas correctly if only the object is referenced in code (i.e. 'mytable') then SQL 2005 looks in the sys schema first then the dbo schema, etc. in attempt to find the object.  Basically it defaults to the dbo schema.  But issue I forsee is if I used a custom schema ('MySchema') coupled with users accessing the database via a mapped windows group.  This is supposedly where a default schema cannot be assigned ...and since db objects won't reside in the 'dbo' schema the SQL won't be able to locate the referenced objects (I.e. 'mytable') and will in turn break applications?
 If my assumptions above are correct then it would appear I have limited choices.  Use the 'dbo' schema for everything ...or abandon schemas entirely?

View 4 Replies View Related

[2005 Express]Add SPs To A Schema?

Oct 30, 2006

I have SQL Server 2005 Express set up on a PC. I imported a backup of an MSDE database. All of the database objects are there. However, I need to assign permissions to my Stored Procedures. So, using Management Studio Express, I saw absolutely no way of adding a stored procedure to a schema or to a user. So I downloaded SQL Server 2005 Developer from my MSDN account. I installed the client tools to get the full version of Management Studio. Same thing. No way to add permissions to a SP. Some web articles say to right-click the SP and select Properties. However, there is no "Properties" in the right-click menu!!! There is only Rename, Delete, Modify, etc. How can something so easy with an old product be so difficult with a new one? Does anyone know how to accomplish adding permissions to SPs?I can right-click a table or a View and get the popup window with the list view and contents to set permissions to tables and views.

View 7 Replies View Related

SQL Server 2005 Schema

Sep 27, 2006

A database was created in SQL 2000. We are going to move to sql 2005. So I attached a database to SQL 2005 and now I have a problem with name resolution. When I worked with SQL 2000 I did not put my schema's name before table name (select * from table1). The schema's name is my user name (IQA) and by default the schema name is a name of user who loged in. (in 2000)

Here is a problem with SQL 2005. The schema's name is still IQA. But I need to do select * from IQA.table1.

I created IQA login and IQA user is an onwer my IQA schema but I still can not do a select without schema name. I need to resolve this because VB.Net code has all select statement without schema's name. Need help!!!

View 4 Replies View Related

Schema Name Has Changed In SQL-server 2005!

Nov 9, 2007

I am using sql server 2005 express. When I created a new database my schema name was dbo and my stored procedures looks like this:
dbo.sp_name
Now when I am creating new sp:s my schema name has change to DOMAINUsername:
 DOMAINUsername.sp_name
 My webb application cant find any sp:s with this schema name and I don't now how to change schema name back to dbo. What has happened, what is this schema name and why has my schema name been changed!? Please help me out!
 

View 1 Replies View Related

Information Schema In SQL Server 2005

Sep 6, 2007

Information Schema is the part of the SQL-92 standard which exposes the metadata of the database. I have written a small article that exposes the same. Let me know your comments on the same. http://aspalliance.com/1380_Information_Schema_and_SQL_Server_2005

Uday Denduluri
Software Engineer
Refer my articles at http://aspalliance.com/author.aspx?uId=62740

View 5 Replies View Related

SQL 2005 Standard Report Schema Changes

Jan 28, 2008

i notice there is a nice little report that is maintaining all schema changes, this is becoming rather large.

Is there a way to tidy up the changes on a weekly basic.

Thanks

View 1 Replies View Related

Export Schema In SqlServer 2005

Sep 1, 2005

Hi all,sorry for the rather trivial question but I couldn't figure this out bymyself.How do you export a db schema either from the commandline or from theGUI (if I remember correctly it's called Management Studio in the newversion).Thanks in advance,Lorenzo

View 2 Replies View Related

Relation Schema SQL Server 2005

Nov 26, 2007

Hi Group,(I am just starting with SQL Server 2005.)On SQL Server 7 I used often the nice relation schema, where I used todraw out the whole database, especially the Foreign Keys constraints.I found these relational schemas very handy to study an old database Ibuild a few years earlier that needs some updating.I tried to find such an utility in SQL Server 2005, but cannot find it.I did found the FK-constraints, but it is just an popup where I candefine them.The overview such a visual schema gave was really great and I miss it.Question: Is it gone in SQL Sevrer 2005, or do I just not know where tolook? If the latter, please guide me. :)Thanks for your time.Regards,Erwin Moller

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

Programmatically Remove Schema From SQL 2005 (C#)

Dec 11, 2007



I NEED HELP! Does anyone know how to remove a database schema from SQL Server 2005 using C#? I have a web application that deletes users. In SQL2k, I am able to simply delete the users. In SQL2005, I must delete or alter the schema BEFORE I can delete the users. Of course, the query below works, but how can I get this to work in code for a web application?


USE EAST_USERS

DROP SCHEMA "plijsmith"

Thanks

View 4 Replies View Related

Tracking Schema Changes In SQL Server 2005 Db

Jul 11, 2006

I wonder how can I track the changes in the columns whether added, deleted or their name is changed and how can I test that?

your help is appreciated

View 9 Replies View Related

Schema Issue - MSSQL 2005

Mar 27, 2008

Hi,


In one of the application we recently migrated the database from MSSQL
2000 to MSSQL 2005.





We are using the user sa for our database and when we import data from one table to another ,we
are getting the error as "Ambigoius table name Address".






and in another machine we got this error message.

"The source DB Connection have access to multiple schemas. Restrict the
access to required schema for the user."




It is expecting some schema to be refered since all the database have
'sa' as user in common in MSSQL database.





can anyone show how the jdbc url syntax for including the schema in
MSSQL 2005 for the user sa ?



Thanks

View 3 Replies View Related

Schema And Principals (Sql Server 2005)

Aug 29, 2005

Hello Everyone,

View 12 Replies View Related

SQL Server 2005 Schema And Security

Aug 7, 2006

Hi everyone,

I'm currently investigating the security improvements of SQL Server 2005. I've got some problems with the schemas introduced in SQL 2005 and security settings.

For my test I've created two schemas: UserManagement and Sales. A user "test" is attached to the UserManagement schema. There's a table Sales.Users containing a list of users (varchar) and a stored procedure named UserManagement.AddUser that can be executed by the UserManagement schema (GRANT EXECUTE, so "test" can execute the SP). UserManagement.AddUser simply inserts a new row into Sales.Users.

Because the Sales schema doesn't contain any user, nobody (except the sysadmin, of course) can do a INSERT/SELECT/DELETE in the Sales.Users table. As expected, the following SQL statement fails:

EXECUTE AS LOGIN='machine est';
INSERT INTO Sales.Users VALUES('Test User');

INSERT was not allowed: object 'Users', database 'test', schema 'Sales'.
The second way of inserting rows into Sales.Users is to execute the stored proc UserManagement.AddUser:
CREATE PROCEDURE [UserManagement].[AddUser]
WITH EXECUTE AS CALLER
AS
INSERT INTO Sales.Users VALUES('Test User');
The user "test" can execute this sproc without problems:
EXECUTE AS LOGIN='machine est';
EXECUTE UserManagement.AddUser;

(1 row(s) affected)To my astonishment the INSERT statement inside the stored proc does execute - although UserManagement.AddUser and Sales.Users are two different schemas. Why is that, is there a chaining happening? To my understanding SQL Server should test INSERT rights on Sales.Users for the UserManagement schema and deny the INSERT statement because UserManagement isn't allowed to INSERT in the Sales schema.

Any ideas? Help regarding the issue is greatly appreciated.

Best regards,

Alex

View 3 Replies View Related

The 'System.Web.Security.SqlMembershipProvider' Requires A Database Schema Compatible With Schema Version '1'.

Sep 27, 2007

Locally I develop in SQL server 2005 enterprise. Recently I recreated my db on the server of my hosting company (in sql server 2005 express).I basically recreated the tables and copied the data in it.I now receive the following error when I hit the DB:The 'System.Web.Security.SqlMembershipProvider' requires a
database schema compatible with schema version '1'.  However, the
current database schema is not compatible with this version.  You may
need to either install a compatible schema with aspnet_regsql.exe
(available in the framework installation directory), or upgrade the
provider to a newer version.I heard something about running aspnet_regsql.exe, but I dont have that access to the DB. Also I dont know if this command does anything more than creating the membership tables and filling it with some default data...Any other solutions/thought on what this can be?Thanks!

View 4 Replies View Related

Needs A SQL 2005 Data And Schema Compare Tool

Mar 12, 2008

Just wondering if there are any tools available for SQL Server 2005 which allow the comparison and scripting of data and schema between two databases. This is so that I can migrate between Dev, QA, and Live easily.

A free tool would be best please..

Thanks in advance.
Gaj

View 11 Replies View Related

How To Change The Schema Owner In Sql Server 2005?

Apr 22, 2008

Hi,
While i trying to drop the user,i getting the following error:
(Microsoft SQL Server, Error: 15138)"

Now,i wanna change the owner of that schema,Which is associated with the schema,which i am trying to delete.

How to transfer the owner?

Plz help me.

View 1 Replies View Related

User/schema Problem In SQL Server 2005!

Oct 13, 2006

do the following steps:1:Use Manage Studio login the server with Integrated security.2:Create a dabase named testdb;3:Create a SQL Server login named amber ,and set it to be dbowner oftestdb;4:Create a SQL Server login named guxiaobo ,set it's default databse tobe testbd,and in the testdb databse map login guxiaobo to userguxiaobo;5:Close Manage Studio and reopen it ,this time use login amber log tothe server.6:In database testbd create a databse role role1 owned by dbo;7:In database testdb create a schema schema1 owned by dbo;8:Set user guxiaobo to be member of role1,and set guxiaobo's defaultschema to be schema1;9:In the schema properties-schema1 dialog choose permissions,in theusers or roles listview I add role1 to it.in the explicit permissionsfor role1 listbox,I choose select /update/insert/delete/view definitiongrant checkboxes.and apply the selects.10:In the schema1 schema I create a table:create table a(a int ,bvarchar(10));11:In the dabase role properties-role1 dialog choose securables panel,int securable listview I add the schema1.a table( choose all thecolumns of table a for all permissions),and in explicit permissions forschema1.a I choose all for grant ,then apply the selects.12:Now I use login guxiaobo to log into dabase and issue "select * froma",but got a error msg saying guxiaobo has not enough permission toselect form table a.Does anyone has found anything I missed?

View 6 Replies View Related

SQL 2005 Security - Schema && Username... Very Annoying

Jun 8, 2007

So on my local server I have a username CWI. I have my main DB: CW.

CWI is the owner of 5 schemas on CW, and everything works great.
---
I now go and create a new DataBase called CWTest. I want to now add the user CWI to the security section of CWTest (The same way I did it in 2000).
However, now I get the error message:
"The login already has an account under a different user name."

When I created my DataBase, IT had the default user, but now I want to add another user so I can create my schemas.
---
On our live servers, we will have 100-300 Databases all using the same useraccount as the "God Mode" user.

Any advice?

View 1 Replies View Related

SQL 2005 Schema Problem After Installing SSIS

Feb 8, 2006

I restored a backup from SQL 2000 onto a new SQL 2005 server. The
database restored and the matching user who was the owner of that
database in SQL 2000 was created as a user in SQL 2005 as well as being
designated as the "schema" for that database. I was having
trouble logging in with the user that was created after the restore, so
I created a new user and assinged the new user as DBO of the new
database, set up the new users default database and schema, and
everything was working fine, my database driven application worked
perfectly under that user.



Then I installed SSIS, as it was recomended as a solution to another
problem. After installing SSIS I can not run queries without
specifying a schema name. For example this query will not work,
it returns table not found:



SELECT * FROM <table_name>



However if I specify the schema name like this, the results return:



SELECT * FROM <schema>.<table_name>



This screws up my database application as it does not include the schema name in its transactions.



I do not understand why installing SSIS would have changed this.

View 1 Replies View Related

Transferring Schema From SQL SVR 2005 To Compact Edition?

Mar 4, 2007

I'm building my app in the full blown MS SQL 2005 Standard Edition as our new app will have a enterprise version using SQL 2005 and a desktop version using either SQL Compact Edition 2005, VistaDB3, or maybe even (uggh) SQL Express 2005. I would prefer SQL Express 2005 but the install size of my app + DB would kill sales.

Back to my question. I'm building out the schema in the full SQL 2005, how do I take this schema and get the schema applied to a SQL Compact Edition DB?

Does SQL Compact Edition support DDL?

Thanks.

View 3 Replies View Related







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