哪里有存储过程的教程下载??
哪里有存储过程的教程下载??
[解决办法]
知道sql写的方式,会增删改查,剩下的就是sql语句的使用的
一些例子
---------------添加的存储过程-- ===========================================-- Author: <Author Name : Charry Chen>-- Create date: <Create Data : 2007-5-14>-- Description: <Description : 添加科室信息>-- ===========================================ALTER PROCEDURE [dbo].[OfficeInfo_AddOfficeInfo]( @Office_Name nvarchar(50), @Phone nvarchar(30), @Position nvarchar(100), @Director_Name nvarchar(50) )ASbegin INSERT INTO OfficeInfo ( Office_Name, Phone, Position, Director_Name ) VALUES ( @Office_Name, @Phone, @Position, @Director_Name )End-----------------------更新的存储过程-- =============================================-- Author: <Author Name : Charry Chen>-- Create date: <Create Data : 2007-5-14>-- Description: <Description : 更新科室信息>-- =============================================ALTER PROCEDURE [dbo].[OfficeInfo_UpdateOfficeInfo]( @Office_ID int, @Office_Name nvarchar(50), @Phone nvarchar(30), @Position nvarchar(100), @Director_Name nvarchar(50) )ASBEGIN update OfficeInfo set Office_Name = @Office_Name , Phone = @Phone, Position = @Position, Director_Name = @Director_Name where Office_ID= @Office_IDEND-- =============================================-- Author: Marry-- Create date: 2007-02-14-- Description: Add or Update Larger=-- ================================================ 更新或删除ALTER PROCEDURE [dbo].[mis_SystemSetup_AddorUpDateLargerUpload] @radix Int, @taskNum Int, @PRI Nvarchar(50), @dateTime DatetimeASBEGINSELECT *FROM FtpSecondUpLoadMaintenanceIF @@Rowcount < = 0INSERT INTO FtpSecondUpLoadMaintenance( radix, taskNum, PRI, dateTime)VALUES( @radix, @taskNum, @PRI, @dateTime)ELSE UPDATE FtpSecondUpLoadMaintenance SET radix = @radix, taskNum = @taskNum, PRI= @PRI, dateTime = @dateTimeEND--------------------------更新ALTER PROCEDURE [dbo].[mis_SystemSetup_DeleteTifFolderPathInfo] @TifID int, @IsUsing INT OUTPUTASSELECT Flag FROM TifFolderPathWHERE Flag = 0 And TifFolderPath_ID = @TifIDIF @@Rowcount > 0UPDATE TifFolderPathSET InActive=0, @IsUsing = 0WHERE TifFolderPath_ID = @TifIDELSE SET @IsUsing = 1----删除的存储过程-- ==========================================-- Author: <Author Name : Charry Chen>-- Create date: <Create Data : 2007-5-14>-- Description: <Description : 删除科室信息>-- ==========================================ALTER PROCEDURE [dbo].[OfficeInfo_DelOfficeInfo]( @Office_ID int)ASBEGIN DELETE From OfficeInfo where Office_ID = @Office_ID END----查找----排序-- ===========================================-- Author: <Author Name : Charry Chen>-- Create date: <Create Data : 2007-5-14>-- Description: <Description : 获得科室信息>-- ===========================================ALTER PROCEDURE [dbo].[OfficeInfo_GetAllOfficeInfo]ASBEGIN SELECT Office_ID,Office_Name,Phone,Position,Director_Name from OfficeInfo order by Office_ID asc/descEND