以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  sql数据库  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=133451)

--  作者:qinjh18935180888
--  发布时间:2019/4/14 15:49:00
--  sql数据库
老师:考试系统涉及到一些数据库语法,能推荐一些这方面的学习资料吗?谢谢。
--  作者:有点甜
--  发布时间:2019/4/14 16:42:00
--  

http://www.w3school.com.cn/sql/index.asp

 


--  作者:qinjh18935180888
--  发布时间:2019/4/14 17:01:00
--  
是这一方面的:

CREATE PROCEDURE [dbo].[usp_GetCode4]
- - Add the parameters For the stored procedure here
@deptCode nvarchar(50),
@key int OUTPUT
As
BEGIN
Declare @count int;
Sele ct @count = count(部门代码) from dbo.编号 where 部门代码 = @deptCode;
    If @count = 0
        begin
        set @key = 1;
        in sert into 编号(部门代码,顺序号) values(@deptCode,@key);
        Return ;
        End
    Else
        begin
        up date 编号 set 顺序号 = 顺序号+1 where 部门代码 = @deptCode;
        Sele ct @key = 顺序号 from dbo.编号 where 部门代码 = @deptCode;
            Return ;
                End
                End

--  作者:有点甜
--  发布时间:2019/4/14 17:20:00
--  

你的这个是存储过程,是多条sql语句集合在一起而已

 

https://www.cnblogs.com/chaoa/articles/3894311.html