Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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,


 
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).
 
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.



 
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.




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.