听说MS SQL 2005自带报表功能,于是我测试了一下,还算比较好用,所以我就录了一个用存储过程来写报表的例子。由于测试过程当中没有语音,所以我在这里讲解一下。
使用的存储过程如下(录象中到最后我更改了一下存储过程):
使用的数据库是MS SQL 2000的Northwind数据库,表是orders。
if exists(select * from sysobjects where name='procTest' and xtype='P')
drop proc procTest
go
create proc procTest
@CustomerId varchar(20)
as
if @CustomerId='*'
select * from Orders
else
select * from Orders where CustomerID=@CustomerId
可以用exec procTest 'VINET' 或者exec procTest '*'来测试
之后...[ 查看全文 ]