ICU 는 말 할 수 없 는 아픔 이 죠.
2721 단어 c
USE [Nursing] GO
/****** Object: StoredProcedure [dbo].[P_GetICUVitualSign] Script Date: 05/21/2015 21:47:21 ******/ SET ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER ON GO
CREATE PROCEDURE [dbo].[P_GetICUVitualSign] @VisitNumberParam varchar (30), @RecordTypeParam datetime AS BEGIN
SELECT * into #temp FROM [Nursing].[dbo].[V_ICUVitualSign] where VisitNumber=@VisitNumberParam order by RecordTime -----------------------2----------------- create table #tempdata ( visitnumber varchar(30), recordtime datetime, code varchar(100), value varchar(100) )
create table #tempdata2 ( rowindex int, visitnumber varchar(30), recordtime datetime, code varchar(100), value varchar(100) ) -----------------------3----------------- declare mycursor cursor for select VisitNumber,ItemNo,Value,RecordTime from #temp
declare @VisitNumber varchar(100) declare @ItemNo varchar(100) declare @Value varchar(100) declare @RecordTime datetime
open mycursor
FETCH next from mycursor into @VisitNumber,@ItemNo,@Value,@RecordTime
if @ItemNo=0 begin insert into #tempdata2(rowindex,visitnumber,code,value) select pos as rowindex, @VisitNumber as visitnumber, nvalue as code ,'' as value from Nursing.dbo.SplitToTable(@Value) where LEN(nvalue)>0 end
while @@FETCH_STATUS=0 begin
FETCH next from mycursor into @VisitNumber,@ItemNo,@Value,@RecordTime
declare @count int select @count=COUNT(1) from #tempdata2
if(@ItemNo=0) begin delete from #tempdata2 insert into #tempdata2(rowindex,visitnumber,code,value) select pos as rowindex, @VisitNumber as visitnumber, nvalue as code ,'' as value from Nursing.dbo.SplitToTable(@Value) where LEN(nvalue)>0 end else begin if(@count>0) begin delete from #tempdata where recordtime=@RecordTime insert into #tempdata( visitnumber, recordtime , code , value ) select a.visitnumber as visitnumber, b.recordtime as recordtime , a.code as code , b.value as value from #tempdata2 as a left join (select pos as rowindex, @RecordTime as recordtime, nvalue as value from Nursing.dbo.SplitToTable(@Value) where LEN(nvalue)>0) as b on a.rowindex=b.rowindex end end end
close mycursor DEALLOCATE mycursor -----------------------return data-----------------
select ltrim(rtrim(visitnumber)) as visitnumber, recordtime as recordtime, ltrim(rtrim(code )) as code, ltrim( rtrim( value )) as value from #tempdata where recordtime=@RecordTypeParam ------------------------------over----------------- drop table #temp drop table #tempdata drop table #tempdata2 END
GO
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Docker를 사용한 React 및 .NET Core 6.0 샘플 프로젝트 - 1부이 기사에서는 Entity Framework Core Code First 접근 방식을 사용하는 ASP.NET Core 6.0 WEP API의 CRUD(만들기, 읽기, 업데이트 및 삭제) 작업에 대해 설명합니다. 웹 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.