EXEC @_= [, [, ]]
Use aromatherapy
Go
Declare @count int
Exec sp_table_validation
oils,
@count OUTPUT,@full_or_fast=0
CREATE PROCEDURE _
[_]
AS
_
[_] :
@_ _ [= ] [OUTPUT]
:
1:
CREATE PROCEDURE fam
@tab int=100
AS
SELECT tn,f,ok FROM bd
WHERE tn = @tab
:
Use
Go
EXEC fam 18
2:
USE
GO
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'p5' AND type = 'P')
DROP PROCEDURE p5
GO
CREATE PROCEDURE p5
@a1 DEC(7,2)=10,
@as CHAR(15)=''
AS
PRINT ' '+
STR(@a1,7,2)+' '+@as
PRINT ' '+STR(@a1*@a1*3.14,8,3)+' '+@as+'^2'
:
EXEC p5 1,''
:
CREATE PROCEDURE tt
@a1 char(6)OUTPUT
AS
SET @a1 = '12345'
:
declare @a2 char(6)
exec tt @a2 output
select @a2
:
CREATE PROCEDURE tt
AS
DECLARE @dd int
SELECT ot,tn, FROM bd
--
SET @dd = @@ERROR
RETURN(@dd)
:
declare @a1 int
exec @a1=tt
select @a1 as ' '
DECLARE @v1 datetime, @v2 datetime
SET @v1=Getdate()
SET @v2=@v1+1.5
SELECT ' . . ' =@v1, ' . . ' =@v2
DECLARE @v1 char(15), @v2 varchar(15)
SET @v1= ' '
SET @v2= ' '
SELECT @v1+ ' ' +@v2 ' + ' - '
=, >, <, <=, >=, <> !=,!<,!>
IF Datepart(hh, Getdate() > 12 SELECT
ELSE SELECT
NOT, AND, OR, BETWEEN, ALL, IN, EXISTS, ANY, SOME, LIKE
ALL ,
TRUE
IF (' .. ' <>ALL (SELECT f FROM bd))
IF (' Moskow ' <> ALL (SELECT f FROM bd))
PRINT ' '
ELSE PRINT ' .. '
ANY, SOME
IF (' .. ' =ANY (SELECT f FROM bd))
PRINT ' .. '
ELSE PRINT ' '
IN ( ANY), . .
IF (' Moskow ' IN (SELECT city FROM authors))
|
|
WHERE ot in (21,15,200)
EXISTS TRUE, ,
ANY
IF EXISTS (SELECT * FROM bd WHERE f= ' .. ' OR )
PRINT ' .. '
ELSE PRINT ' '
LIKE
% -
_ -
[] -
^ -
WHERE city LIKE ' _Sa% '
WHERE city LIKE ' _[^a-gh]% '
IF EXISTS (SELECT * FROM bd WHERE f LIKE ' % ')
PRINT ' '
ELSE PRINT ' '
, SQL Server INSERT, UPDATE, DELETE.
: AFTER, INSTEAD OF.
AFTER
.
.
INSTEAD OF
, .
. . .
CREATE TRIGGER _
ON
{table | view [WITH ENCRYPTION]
[{AFTER | INSDEAD OF}]
{[DELETE], [INSERT], [UPDATE]}
AS
[{IF UPDATE (colum)
[{AND | OR} UPDATE (column)]
[n] | IF (columns_update()
{ bitwise_operator} updated_betmask}
(comparison_operator} column_betmask
[n]
sql_statement [n]}}
:
table | view
WITH ENCRYPTION
{[DELETE], [INSERT], [UPDATE]}- c , ,
AS
IF UPDATE (colum)- . : UPDATE (a1) OR
UPDATE (a2) AND UPDATE (a3)
IF (columns_update() , . , , . .
, :
bitwise_operator & ( AND). . .
updated_betmask , .
: (columns_update() & 9) 1 4
comparison_operator , .. =,<,> ..
column_betmask , . , .
: IF (columns_updated() & 9) = 9 1 4
IF (columns_updated() & 9) > 0 1 4
IF (columns_updated() & 9) < 9 1 4
|
|
[n] , .
sql_statement [n] tsql,
DROP TRIGGERS {trigger} [,n]
:
:
CREATE TABLE
(US char(5), DAT varchar(30), com varchar(30)