--테이블에값추가 Insert InTo Memos(Name, Email, Title, PostDate, PostIP) Values('홍길동', 'h@h.com', '안녕', Default, '127.0.0.1') Go /* Insert InTo Memos(Name, Email, Title) --PostDate, PostIP를입력하지않고사용해도Default로자동으로값이저장된다. Values('뷁', 'h@h.com', '안녕') Go */ --Num을기준으로내름차순으로정렬(높은숫자가위로) Select *From Memos Where 1 = 1 Order By Num Desc Update Memos Set Name = '백두산' Where Num > 0 Delete Memos Where 1 1 --1부터10..
-- 한줄메모장만들기 Create Table dbo.Memos --dbo.최고권한으로...생략가능 ( Num Int Identity(1, 1) Primary Key, Name VarChar(25) Not Null,--한글기본3자리일때VarChar(7) Email VarChar(50) Null, Title VarChar(150) Null, PostDate SmallDateTime Default(GetDate()), PostIP VarChar(15) Null --정해짐 ) Go --테이블변경 /* Alter Table Memos ( --SSMS 사용 ) Go */ --테이블삭제 /* Drop Table Memos Go */