ASP.NET 기초 강의실

시삽: 레드플러스 님 
게시판 이동:
 제목 : [1] 테이블과 저장 프로시저 : ~/Schedule/Documents/Schedule.sql
글번호: 244
작성자: 레드플러스
작성일: 2008/07/01 오후 3:03:00
조회수: 4686
--[1] 스케줄 테이블(공통)
CREATE TABLE dbo.Schedule
(
    [Num] [Int] IDENTITY (1, 1) NOT NULL Primary Key,    --일련번호
    [SYear] [SmallInt] NOT NULL ,                        --년
    [SMonth] [SmallInt] NOT NULL ,                        --월
    [SDay] [SmallInt] NOT NULL ,                        --일
    [SHour] [SmallInt] NOT NULL ,                        --시
    [Title] [VarChar] (150) NOT NULL ,                    --일정제목
    [Content] [Text] NULL ,                                --일정내용
    [PostDate] [SmallDateTime] NULL                     --등록일
    -- 추가 기능은 필드로...
)
Go

--[4] 일정 입력 저장 프로시저 : AddSchedule
Create Procedure dbo.AddSchedule
    @SYear SmallInt,
    @SMonth SmallInt,
    @SDay SmallInt,
    @SHour SmallInt,
    @Title VarChar(150),
    @Content VarChar(8000)
As
    Insert Into Schedule
    Values
    (
        @SYear, @SMonth, @SDay, @SHour, @Title, @Content, GetDate()
    )
Go

--[5] 일정 출력 저장 프로시저 : GetSchedule
Create Proc dbo.GetSchedule
    @SYear SmallInt,
    @SMonth SmallInt,
    @SDay SmallInt
As
    Select * From Schedule
    Where SYear = @SYear And SMonth = @SMonth And SDay = @SDay
Go

--[6] 상세 저장 프로시저 : ViewSchedule
Create Proc dbo.ViewSchedule
    @Num Int
As
    Select * From Schedule Where Num = @Num
Go

--[7] 수정 : ModifySchedule
Create Proc dbo.ModifySchedule
    @SYear Int,
    @SMonth Int,
    @SDay Int,
    @SHour Int,
    @Title VarChar(150),
    @Content VarChar(8000),
    @Num Int
As
    Update Schedule
    Set
        SYear = @SYear, SMonth = @SMonth,
        SDay = @SDay, SHour = @SHour,
        Title = @Title, Content = @Content
    Where Num = @Num
Go

--[8] 삭제 : DeleteSchedule
Create Proc dbo.DeleteSchedule
    @Num Int
As
    Delete Schedule Where Num = @Num
Go
 
이전 글   다음 글 삭제 수정 답변 글쓰기 리스트


관련 아티클 리스트
  제       목 파일 작성자 작성일 조회
이전글 이전 10개 / 다음 10개 페이징 처리 메서드 - 레드플러스 2008-07-07 5845
  [!] 일정관리 모듈 : /WebSchedule/Schedule/ - 레드플러스 2008-07-01 8179
현재글 [1] 테이블과 저장 프로시저 : ~/Schedule/Documents/Schedul... - 레드플러스 2008-07-01 4686
  [2] 일정 입력 : ~/Schedule/ScheduleWrite.ascx - 레드플러스 2008-07-01 4650
  ~/Schedule/ScheduleWrite.ascx.cs - 레드플러스 2008-07-01 4056
  [3] 일정 출력 : ~/Schedule/ScheduleList.ascx - 레드플러스 2008-07-02 4120
  ~/Schedule/ScheduleList.ascx.cs - 레드플러스 2008-07-02 4348
  [4] 일정 수정 / 삭제 : ~/Schedule/ScheduleView.ascx - 레드플러스 2008-07-02 4084
  ~/Schedule/ScheduleView.ascx.cs - 레드플러스 2008-07-02 4248
다음글 3계층 프로그래밍 관련 단어 - 레드플러스 2008-06-30 4730
 
손님 사용자 Anonymous (손님)
로그인 Home