牡丹鹦鹉吃什么,吴艳樱,ca1327航班
实现这篇之前,可以先参考这篇《数据表列值转换为逗号分隔字符串》
上这篇,只是输出一个值,现我们把数据表进行分组。
先把上一篇的源始数据再组织一下:
if object_id('tempdb..#temptable') is not null begin drop table #temptable end create table #temptable ([id] int not null,[type] nvarchar(20) null,[category] nvarchar(40) null) insert into #temptable ([id],[type],[category]) values (1,'table','table'), (2,'table','view'), (3,'sp','store procedure'), (4,'fun','table-valued function'), (5,'fun','scalar-valued function'), (6,'type','user-defined table type') select [id],[type],[category] from #temptable go
接下来,再修改一下那个存储过程:
举例说明:
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
数据库SQL---数据库、基本表、视图、索引的定义、修改、删除
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (上)
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (下)
网友评论