指针使用

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:  <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
alter PROCEDURE Syn_Data_Test
 
AS
BEGIN

declare @contentType varchar(50)


declare cur_contentType Cursor
for select distinct contentType from dbo.stock_news
open cur_contentType
    fetch next from cur_contentType into @contentType
      while @@fetch_status=0
              begin
               print @contentType
             fetch next from cur_contentType into @contentType
               end
     close cur_contentType
     deallocate cur_contentType

END
GO

你可能感兴趣的:(Go)