Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Reserved Names

Author  Topic 

Leyland
Starting Member

4 Posts

Posted - 2010-10-23 : 11:52:21
Hi All,
Just started using SQL Server 2008 exclusively and I've inherited a database that I need to get up to speed with quickly.

In this database there are three tables that are named with MS reserved names. They are Function, User and Role. I need to know how these tables were created. Did SQL Server or ASP.net create them automatically or were they created manually in error by a sloppy developer?

I've searched the internet for an answer but can't find one so can I assume that these tables were created accidentally by a previous developer? If that is the case I will look into renaming them to non reserved names to avoid any potential problems.

Thanks in advance for any direction.

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-10-23 : 12:49:43
Created by a developer. Whether it was sloppy, accidental or in error is another matter.

Be careful renaming unless you know everything that will be impacted.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-23 : 14:54:45
Pluralize them. It'll make Joe Celko happy, and they won't be reserved words.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2010-10-24 : 01:44:47
didn't know it was so easy to make him happy!


elsasoft.org
Go to Top of Page

Leyland
Starting Member

4 Posts

Posted - 2010-10-25 : 09:49:26
Thank you for your replies, Gail & Tara.

I know what you are saying Gail. Renaming is not a trivial decision because table names are woven throughout the system and changing the name creates a cascading effect; however, I don't think we have any choice. Some years ago, I had to work with an Access database where someone had used a reserved name for a table name and it created periodic database freezes when three or four users hit the database at the same time. When this happened, there was also a little data loss too. We renamed the table and painstakingly went through the code to change all the references and once the changes were deployed the problem went away. That database ran for years without issue after that. Now, SQL Server is much more robust than Access, but going against Microsoft's recommendations and using not one but three reserved names is a critical issue. It's like having a ticking time bomb that could blow up anytime.

So to address my first question, as no one has come forward with any evidence that three tables were automatically created by the system, I think that I can safely assume that this was a developer error and must be fixed.

Thanks again.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-10-25 : 09:59:30
SQL is NOT going to randomly freeze because of these. It is NOT going to lose data because of these. At absolute worst you'll have to remember to always wrap table names in [ and ] in each and every query.
Correct, it's not following recommendations, but it's not going to blow up your database at some point in time.

MS Access had problems with concurrent users no matter what the table names were.

I worked on a TB-sized database that had a table named Transaction. Other than the aforementioned need for [] around all table names, there was absolutely no effect from the naming.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -