Sql Server 2008
2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1062
2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址:https://www.aliyun.com/minisite/goods
SQL Server 2008简体中文企业版下载(SQL2008) SQL Server 2008分为SQL Server 2008企业版、标准版、工作组版、Web版、开发者版、Express版、Co
创建函数:
create function sector_pid(@id varchar(10)) returns @t_level table(id varchar(10))
as
begin
insert into @t_level select @id
select @id = sct_pid from sector where sct_id = @id and sct_pid not in(1)
while @@ROWCOUNT > 0
begin
delete from @t_level
insert into @t_level select @id
select @id = sct_pid from sector where sct_id = @id and sct_pid not in(1)
end
return
end
go
create function Sector_Name(@sctId varchar(10))
returns varchar(50)
as
begin
declare @ccode varchar(50)
declare @name varchar(50)
declare @pid varchar(10)
declare @sctpid varchar(10)
declare @spid varchar(10)
select @pid=SCT_PID from SECTOR where SCT_ID=@sctId
if(@pid=1)
set @ccode=(select SCT_NAM from SECTOR where SCT_ID=@sctId)
else if(@pid=0)
set @ccode=(select SCT_NAM from SECTOR where SCT_ID=@sctId)
else
begin
select @name =SCT_NAM from SECTOR where SCT_ID=@sctId
select @sctpid=SCT_PID from SECTOR where SCT_ID=@pid
if (@sctpid=1)
set @ccode =(select SCT_NAM from SECTOR where SCT_ID = @pid )+'-'+@name
else
begin
while @sctpid <>1
begin
select @spid=SCT_PID from SECTOR where SCT_ID = @sctpid
set @ccode =(select SCT_NAM from SECTOR where SCT_ID = @sctpid )+'-'+@name
set @sctpid=@spid
if @sctpid=1
break
end
end
end
return @ccode
end
go
相关阅读排行
- 1在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接
- 2Microsoft SQL Server 2008安装图解(Windows 7)
- 3win8系统下安装SQL2005(SQL Server 2005)图文教程
- 4C#连接SQL SERVER数据库的详细步骤!
- 5SQL Server 2008 R2 序列号 key 产品密钥