473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Creating UDT from another UDT

Hi,
I have a User Defined Datatype, which I want to use to define another
data-type. I tried the obvious:

EXEC sp_addtype
@typename = UDT_OBJECT_ID,
@phystype = 'NUMERIC (5)',
@nulltype = 'NULL'
GO

EXEC sp_addtype
@typename = UDT_TRACKING_NUM,
@phystype = UDT_OBJECT_ID,
@nulltype = 'NOT NULL'
GO

but that didn't work :

Msg 15036, Level 16, State 1, Server SKINNER, Procedure sp_addtype, Line 186
The data type UDT_OBJECT_ID does not exist.

Has anyone done this before,

Thanks,
Rowland.
Jul 20 '05 #1
2 1475

"Rowland" <ba*****@hotmail.com> wrote in message
news:cg**********@titan.btinternet.com...
Hi,
I have a User Defined Datatype, which I want to use to define another
data-type. I tried the obvious:

EXEC sp_addtype
@typename = UDT_OBJECT_ID,
@phystype = 'NUMERIC (5)',
@nulltype = 'NULL'
GO

EXEC sp_addtype
@typename = UDT_TRACKING_NUM,
@phystype = UDT_OBJECT_ID,
@nulltype = 'NOT NULL'
GO

but that didn't work :

Msg 15036, Level 16, State 1, Server SKINNER, Procedure sp_addtype, Line
186
The data type UDT_OBJECT_ID does not exist.

Has anyone done this before,

Thanks,
Rowland.


No - see the documentation for sp_addtype. You can only create a UDDT based
on a native MSSQL data type, not on another UDDT.

The best way to manage this is probably to script your UDDTs, so you can
create a new one by just changing the name in the script.

Simon
Jul 20 '05 #2

"Simon Hayes" <sq*@hayes.ch> wrote in message
news:41**********@news.bluewin.ch...

"Rowland" <ba*****@hotmail.com> wrote in message
news:cg**********@titan.btinternet.com...
Hi,
I have a User Defined Datatype, which I want to use to define another
data-type. I tried the obvious:

EXEC sp_addtype
@typename = UDT_OBJECT_ID,
@phystype = 'NUMERIC (5)',
@nulltype = 'NULL'
GO

EXEC sp_addtype
@typename = UDT_TRACKING_NUM,
@phystype = UDT_OBJECT_ID,
@nulltype = 'NOT NULL'
GO

but that didn't work :

Msg 15036, Level 16, State 1, Server SKINNER, Procedure sp_addtype, Line
186
The data type UDT_OBJECT_ID does not exist.

Has anyone done this before,

Thanks,
Rowland.
No - see the documentation for sp_addtype. You can only create a UDDT

based on a native MSSQL data type, not on another UDDT.

The best way to manage this is probably to script your UDDTs, so you can
create a new one by just changing the name in the script.

Simon


Thanks for the info - I think scripting the UDDTs should work well in my
case, so I'll give that a go.

Rowland.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Joshua Beall | last post by:
Hi All, I am working on a registration system, and one of the things I am going to need to be able to do it setup the database tables for each event that I have registration for. Normally I...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
2
by: epigram | last post by:
I'm dynamically creating a number of radio buttons on my aspx page based upon data read from a db. Each radio button has autopostback turned on. I'm experiencing two problems. 1) I am reading...
16
by: tshad | last post by:
This is a little complicated to explain but I have some web services on a machine that work great. The problem is that I have run into a situation where I need to set up my program to access one...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.