I have read SQL server 2000 stored procedures HandBook,just do some easy examples of it.here is the code:
create procedure Example_05 @ValIn bigint,@ValOut bigint output
as
begin
if @ValIn > 20
begin
print 'Invalid starting point should be <=20'
return -99
end
declare @WorkValIn bigint, @WorkValOut bigint
if @ValIn != 1
begin
set @WorkValIn = @ValIn -1
print @@NESTLEVEL
exec Example_05 @WorkValIn,@WorkValOut output
set @ValOut = @WorkValOut * @ValIn
end
else
set @ValOut = 1
end
declare @FactIn int,@FactOut int
set @FactIn =6
exec Example_05 @FactIn,@FactOut output
print 'Factorial of ' + convert(varchar(3),@FactIn) +' is '+convert(varchar(20),@FactOut)
create procedure Example_03
as
begin
declare @var1 int,@var2 int
set @var1 = 1
set @var2 = 1
while @var1 <10
begin
if @var2>20
break
set @var1 = @var1+1
set @var2 = @var2+@var2
end
print 'var1='+convert(char(5),@var1) +'and var2='+convert(char(5),@var2)
end
create procedure example_02
as
begin
select product_id,mfr_id,qty_on_hand,
case qty_on_hand
when 0 then 'No qty'
when (select max(qty_on_hand) from [products]) then 'top qty'
else 'aver qty'
end as disc
from [products]
end
I will learn it more :)
分享到:
相关推荐
Although we do not cover the totality of SQL Server in this book, references are provided and some concepts are explained in case you are not familiar with SQL Server, as is often the case with data ...
and analysis services Includes real-world case examples and best practices from Microsoft insiders If you're a database administrator eager to get started with the newest version of SQL Server,...
《SQL Server Bible 2000 With Examples》是一本针对微软SQL Server 2000深入解析的权威指南。这本书全面覆盖了SQL Server 2000的各种特性和功能,旨在帮助读者掌握数据库管理和开发的核心技能。以下是该书可能涵盖...
Some understanding of the basic database concepts and Transact-SQL language is assumed. What You Will Learn Explore the new development features introduced in SQL Server 2016 Identify opportunities...
1. The Evolution of Microsoft SQL Server: 1989 to 2000 [加入我的離線書架] . SQL Server: The Early Years . Ron's Story . Kalen's Story . Microsoft SQL Server Ships . Development Roles Evolve . OS...
SOME EXAMPLES OF THE USE OF IEC 60870-5-101 PROTOCOL STANDARD
And if you know SQL Server 2005, you’ll learn about some exciting new capabilities in SQL Server 2008. Information Technology professionals in many different roles use T-SQL. Our goal is to provide...
Within the book, there are plenty of examples of tasks that developers routinely perform. You'll learn to create tables and indexes, and be introduced to best practices for securing your valuable ...
【JSP+SQL Server 2000 人才招聘网站】是一个基于JavaServer Pages(JSP)技术构建的,利用SQL Server 2000作为后台数据库的招聘平台。在这个项目中,JSP用于创建动态网页,而SQL Server 2000则负责存储和管理网站的...
defi nition, design, and implementation of the Query Processing engine of SQL Server for over a decade, and I deeply respect his insight. They make an outstanding team of guides who can help you ...
Take advantage of the real power ... The book is packed with real-world examples that will give you a good understanding of the BI and DW components of SQL Server 2014, Excel 2013, and SharePoint 2013.
07年新书 884页 Summary: Professional SQL Server 2005 Programming shows experienced developers how to master the substantially revamped feature set of the latest release of Microsoft SQL Server....
Filled with new real-world examples and hands-on exercises, Microsoft SQL Server 2016: A Beginner’s Guide, Sixth Edition 版本, starts by explaining fundamental relational database system concepts....
Review the new features of SQL Server that will be of interest to you as an experienced developer and move on to more detailed, practical code examples. Learn how to write complex queries, build ...