Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Reverse Engineering Alias Data Yypes in SQL Server 2000 Expand / Collapse
Author
Message
Posted Friday, May 25, 2007 2:46 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: 2 days ago @ 9:33 AM
Points: 33, Visits: 385
Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/yShlafman/3038.asp
Post #369193
Posted Tuesday, June 19, 2007 9:13 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 10:42 AM
Points: 1,502, Visits: 2,669

Are ADT's compatible with the current release of Visual Studio .NET?

A couple years ago I had done some C# programming with .NET 2003 and a SS2000 db that used UDT's but .NET did not recognize the UDT's. That actually made programming harder, since you had to go look up the definition for the UDT and use a native .NET data type.

Does Visual Studio .NET 2005 allow you to use ADT's, and how is that done?

Post #374989
Posted Tuesday, June 19, 2007 11:08 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, May 6, 2014 5:51 AM
Points: 6,266, Visits: 2,028
Other drawbacks of the ADT:
* When you need to "change" the type the effort is more than with native
* When dealing with temporary tables you have to have them in model by the time you restart SQL Server or use a startup procedure to add them to tempdb. This is harder than native datatypes
* replication has issues with some of these types
* Because it hides implemetation details it forces you to find out the definition.
* Like posted above not many providers deal with this successfully
* Linked servers can be trashed because of this

Because of all the above (and possibly more that I may be missing) I would vote for the use of ADT as a BAD parctice!

Cheers!





* Noel
Post #375039
Posted Tuesday, June 19, 2007 12:30 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, November 13, 2008 9:13 AM
Points: 499, Visits: 76
I had to deal with ADT's in a previous nightmare job. Oh what a total pain it was! Just use the system types. The biggest pain was having to script removal of the use of the types by every table that used one when needing to change the definition of the type. There were some benefits to using the ADTs, but the drawbacks were much larger.
Post #375062
Posted Tuesday, June 19, 2007 2:00 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Saturday, May 24, 2014 7:58 PM
Points: 219, Visits: 824
I prefer to use C++ approach - I define macros in a *.h file and have them replaced by actual definition by the preprocessor. For instance, I used to have BIGGEST_VARCHAR defined as VARCHAR(8000). WHen I migrated to 2005, I just replaced that with VARCHAR(MAX) in only one place in my ConstantDefinitions.h file. Next time I generated my deployment script, it had VARCHAR(MAX) wherever I had BIGGEST_VARCHAR in my source.
Post #375084
Posted Thursday, September 13, 2007 3:28 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, September 27, 2011 6:31 PM
Points: 32, Visits: 174

If the ADT is also used in stored procedures, is there a way to drop the ADT without changing the stored procedure first?




Post #399130
Posted Friday, September 14, 2007 9:31 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, August 5, 2010 2:07 PM
Points: 17, Visits: 281

Hi pcwc66,

you have a very intresting question.

Could you please provide a sample of you stored procedure,

what do you want to accomplish and I will be glad to answer.

Regards

Post #399362
Posted Friday, September 14, 2007 12:22 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, September 27, 2011 6:31 PM
Points: 32, Visits: 174

Hi Yakov,

The idea to replace the old ADT with a new ADT is good.  However, for maintenance purpose, I'm thinking whether I can replace the old ADT with a new ADT and then replace the new ADT with another ADT which has the same name as the old ADT but has the definition of the new ADT.

Replacing ADT for columns can follow the article and write a not too complicated script to go thru all tables in a database.  Writing a script to replace ADT in stored procedures may be complicated.  If there is a way to suppress SQL Server to check ADT existence in other SQL Server objects, then othe SQL Server objects may not need to be replaced.

 

 




Post #399422
Posted Monday, September 17, 2007 6:30 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, August 5, 2010 2:07 PM
Points: 17, Visits: 281

Hi pcwc66,

you can replace the old ADT with a new ADT and then replace the new ADT with another ADT which has the same name as the old ADT but has the definition of the new ADT. The procedure provided in the article allows you to do it.

There is no way to suppress SQL Server from checking ADT existence in other SQL Server objects.

Please read more on ADT in coming parts of this article.

Regards

Post #399642
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse