Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Oracle VS Sql Server 2000

Author  Topic 

mdanwerali
Starting Member

30 Posts

Posted - 2002-11-23 : 02:55:48
Hi,

I have a table with Objects as datatype which was written in Oracle.
Now how to create the same table in Sql Server 2000.

for example:

CREATE TABLE STUDENTMASTER (
SMSTUID VARCHAR2 (10) NOT NULL,
SMNAME VARCHAR2 (100),
SMEDU EDUCATION)

here Education is an object type. and this object education acts like a table and store data.

TYPE EDUCATION AS OBJECT
(
NAME VARCHAR2 (100),
YEAROFPASSING DATE,
MEDIUMOFSTUDY VARCHAR2 (20),
PERCENTAGE NUMBER(5,2),
SPECIALIZATION VARCHAR2 (200),
NAMEOFINSTITUTE VARCHAR2 (200),
UNIVERSITY VARCHAR2 (100));



Thanks in Advance

Md Anwer Ali



Edited by - mdanwerali on 11/23/2002 04:05:47

Edited by - mdanwerali on 11/23/2002 04:06:35

burbakei
Yak Posting Veteran

80 Posts

Posted - 2002-11-23 : 10:53:36
when you create a table in Sql Server you can only use predefined data types and user defined data types. and user defined datatype are much more simpler than "TYPE EDUCATION AS OBJECT ...". search Book OnLine for sp_addtype



Go to Top of Page

Lavos
Posting Yak Master

200 Posts

Posted - 2002-11-24 : 11:09:00
The correct way is to create your Education object as a new table, and introduce a studentID field to the Education table to track which rows belong to which students.

You would then have to use JOIN's to associate the data back and forth.


Okay, now can someone please explain to me why Oracle allows for nice un-relational concepts like this to be used? I mean, I thought array columns in Progress was bad, but.....

----------------------
"O Theos mou! Echo ten labrida en te mou kephale!"
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-11-24 : 11:28:06
quote:
Okay, now can someone please explain to me why Oracle allows for nice un-relational concepts like this to be used?
Well, I'd argue that their cursor-based approach to everything is not particularly relational either...

Go to Top of Page
   

- Advertisement -