- 博客(0)
- 资源 (15)
- 收藏
- 关注
ASP动态生成HTML页面
Northwind数据存储过程实例
1.SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER PROCEDURE CustOrderHist @CustomerID nchar(5) AS
SELECT ProductName, Total=SUM(Quantity)
FROM Products P, [Order Details] OD, Orders O, Customers C
WHERE C.CustomerID = @CustomerID
AND C.CustomerID = O.CustomerID AND O.OrderID = OD.OrderID AND OD.ProductID = P.ProductID
GROUP BY ProductName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
2008-09-10
sqlserverSET QUOTED_IDENTIFIER ON
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER PROCEDURE test @From varchar(100)="zhang.zhanling@itgemini.net" , @To varchar(100)="zhang.zhanling@itgemini.net" ,@eng varchar(1000)=" ", @Bcc varchar(500)="xu.ming;xie.yansheng", @Subject varchar(400)=" "
AS
declare @sum int
DECLARE T CURSOR FOR SELECT eng FROM event_tbl where status<>'关闭' and warn<>1 and datediff(hour,logtime,getdate())>4
DECLARE @NUM BIGINT
DECLARE @VARINT VARCHAR(50)
--一定要赋初值,不然在循环中@NUM的值不会改变
SELECT @NUM = 0
OPEN T
FETCH NEXT FROM T INTO @VARINT
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @NUM = @NUM+1
2008-09-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人