473,570 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_NU M,
@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 1485

"Rowland" <ba*****@hotmai l.com> wrote in message
news:cg******** **@titan.btinte rnet.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_NU M,
@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*****@hotmai l.com> wrote in message
news:cg******** **@titan.btinte rnet.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_NU M,
@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
2172
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 would do this by hand, but I am wondering if there are any code libraries out there that could generate the SQL for me. Basically I would have a...
15
6730
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 javascript or vbscript it works. I will appreciate any help. I do the following (C#):
12
3143
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 restarting the application. What I did was to create an AppDomain that loaded the plugins and everything was great, until I tried to pass...
2
1685
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 the db, creating the radio buttons, and setting the checked property (also based upon data in the db) in Page_Load regardless of whether a postback...
16
2344
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 or another (could also be 3) different web servers to use these Web Services. The Web Services are identical on all the machines. I tried just...
0
7724
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7633
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7944
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8149
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7699
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
3681
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.