USE [InformationSystem]
GO
/****** Object:  StoredProcedure [dbo].[Addcount]    Script Date: 05/06/2015 15:29:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<>
-- Create date: <2015-5-6 15:55:20>
-- Description:	<存储过程 while循环>
-- =============================================
ALTER PROCEDURE [dbo].[pro_whileTest]
AS
  BEGIN
	DECLARE @n bigint 
	DECLARE @Sql nvarchar(225)
	DECLARE @GetTime NVARCHAR(225)
	
	set @n=0
	SET @GetTime= Convert(varchar,getdate(),120)

	while @n<10
 
	begin Set @Sql='
	 INSERT INTO [InformationSystem].[dbo].[D_PortlCoutInfo]
			   (readtime,Count,Added,Status) VALUES ('''+@GetTime+''',44,0,0)'
     PRINT @Sql
           
	Exec (@Sql)  
 
	set @n=@n+1
	
  END


END

  

 

相关文章:

  • 2021-12-23
  • 2021-09-28
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
  • 2021-12-23
  • 2021-12-23
  • 2021-04-05
猜你喜欢
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2021-12-23
  • 2021-07-26
  • 2022-01-02
  • 2021-12-23
相关资源
相似解决方案