8

SQL Server TSQL 01 Slides

Embed Size (px)

DESCRIPTION

SQL Server TSQL 01 Slides

Citation preview

  • insert into Accounts (1, 50), (7, 100), (3, 43);

  • begin transelect * into #deleted from Accounts where balance < 100update Accounts set balance=balance + 1 where balance < 100select * into #inserted from Accounts where id in (select id from #deleted)-- use #deleted and #inserted tables to see what happenedcommit tran

  • create table documents(id int identity primary key,name varchar(20),document varbinary(20000))

    image

    create function gettext(@t text)returns textasbeginreturn @t;end

  • 12;24->1212;30->3115;09->0715;11->1519;14->0819;17->2119:50->05

    05;19:5007;15;0908;19;1412;12;2415;15;1121;19;1731;12;30

    select width from sizeswhere length = 15

    create table sizes(id int primary key,length int,width int)