Wrox Programmer Forums
|
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 July 30th, 2003, 04:35 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default User Data Type

How can I define user data type
that will include Identity and char(4) for example.

Prod1
Prod2
Prod3
....
Thanks
 
Old July 30th, 2003, 06:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

There are three ways. Via TSQL you can use the stored procedure 'sp_addtype'. SQL-DMO has a 'UserDefinedDatatype' object as a member of a database's 'UserDefinedDatatypes' collection. Add the object to this collection creates the user defined type.

Probably the simplest way is to use Enterprise Manager. Expand the database to add the type, right click 'User defined types' amd select 'New User defined type'.

You cannot define a user defined type as having the identity property, as this is a property of a column in a table, and not a property of a datatype itself.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old July 30th, 2003, 08:26 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Current user type dotnetprogrammer VS.NET 2002/2003 0 February 1st, 2005 07:20 AM
Using a user defined type and the Split Function nikotromus Access VBA 2 August 20th, 2004 12:02 PM
Table and User Defined Type with same Name djuricd SQL Server 2000 3 April 20th, 2004 12:33 AM
Converting user input - SmallMoney type saturdave ASP.NET 1.0 and 1.1 Basics 1 April 8th, 2004 08:16 PM
Data Type error but it is the correct type Mitch SQL Server 2000 2 March 19th, 2004 11:31 AM





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