Introduction to the use of SQL Server cursor statements

--Declare a cursor

DECLARE MyCursor CURSOR

FOR SELECT TOP 5 FBookName, FBookCoding FROM TBookInfo / / define a cursor called MyCursor, store the data for the select

--Open a cursor

OPEN MyCursor / / open this data set

-- loop a cursor

DECLARE @BookName nvarchar(2000), @BookCoding nvarchar(2000)

FETCH NEXT FROM MyCursor INTO @BookName, @BookCoding//Moving cursor points to the first piece of data, extracting the first piece of data stored in the variable

WHILE @@FETCH_STATUS =0//Continue to cycle if the last operation was successful

BEGIN

Print 'name'+@BookName

FETCH NEXT FROM MyCursor INTO @BookName, @BookCoding//Continue to draw a line

END

--Close the cursor

CLOSE MyCursor

-- Release resources

DEALLOCATE MyCursor

Code:

Create table #a

(

Id varchar(20),

Name varchar(20)

)

Insert into #a select 1, 'jack'

Insert into #a select 2,'join'

Insert into #a select 3,'make'

Declare mycursor cursor

For select * from #a

Open mycursor

Declare @id varchar(20),@name varchar(20)

Fetch next from mycursor into @id,@name

While @@fetch_status=0

Begin

Select @id,@name

Fetch next from mycursor into @id,@name

End

Close mycursor

Deallocate mycursor

Cursors belong to the row-level operation. The SQL query is based on the data set. Therefore, the general query can use the data set. The data set is used. The cursor data is large and the performance killer.

IGBT Module

IGBT Module

High short circuit capability, self limiting short circuit current
IGBT CHIP(Trench+ Field Stop technology)
VCE(sat) with positive temperature coefficient
Fast switching and short tail current, Low switching losses
Free wheeling diodes with fast and soft reverse recovery
Temperature sense included

IGBT Module

YANGZHOU POSITIONING TECH CO., LTD. , https://www.cndingweitech.com