sqlserver advanced must know - user-defined table data type

9.1.3 User-defined table data type

-- Self cultivation of programmers

--第九章课程 
-- 自定义数据类型
create type  course_tabletype as table(
cno char(4) not null,
cname char(16) not null,
credit int null,
tno char(6) null


)

declare @tb course_tabletype 
insert into @tb select * from course 
select * from @tb 

Effect 

 

Guess you like

Origin blog.csdn.net/chenggong9527/article/details/123957544