Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 19th, 2004, 09:16 AM
Registered User
 
Join Date: Mar 2004
Location: Kingston, ON, Canada.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Table and User Defined Type with same Name

So I just found out that I really messed up!

I have managed to create several user defined data types and several tables in the same database with the same name.

I wanted to change the data type of one of my UDDT's and I found some strange behaviour. For one, If I rename the UDDT using EM, it actually renames my table!

Has anyone run into this before? How would I rename my UDDT's without causing big problems with my tables?

Thanks,


Reply With Quote
  #2 (permalink)  
Old April 19th, 2004, 11:16 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Romania.
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try to do it with a script in Query Analyzer. look in BOL for help on sp_rename; i thinl you need to specify the @objname parameter, and probably this is the mistake tha EM makes (in the back EM uses batch commands to accomplish stuff).
Reply With Quote
  #3 (permalink)  
Old April 19th, 2004, 11:24 AM
Registered User
 
Join Date: Mar 2004
Location: Kingston, ON, Canada.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the tip, but I have found a solution for my situation already.

I renamed the table with EM.
I then renamed the UDDT with EM.
I then renamed the table with EM (Back to the original name.)

This worked fine in my case, but it may not work for everyone because there are things that get lost / or break if you rename tables.



Reply With Quote
  #4 (permalink)  
Old April 20th, 2004, 12:33 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Romania.
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you found a quicker solution. nice.

i think this solution would work for more cases then you might expected, since i believe that nothing gets lost. the only problem is with batches or scripts that are running in the time interval when you do the renaming, and that reference the table.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection user-defined type not defined Wall st Guru Excel VBA 2 March 26th, 2014 03:44 PM
User-Defined Type Error - Re: File Dialog Coby Access VBA 1 January 16th, 2008 09:42 AM
Setting variable to user defined type mantle51 SQL Server 2000 3 August 10th, 2007 03:52 AM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
Using a user defined type and the Split Function nikotromus Access VBA 2 August 20th, 2004 12:02 PM



All times are GMT -4. The time now is 07:52 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.