Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 SQL » Шпаргалки
Заголовок



DECLARE @TypeID INT
SET @TypeID = 2

SELECT
CASE
        WHEN @TypeID = 0 THEN 'Тип=0'
        WHEN @TypeID = 1 THEN 'Тип=1'
        ELSE 'х.з.' END



IF NOT EXISTS (SELECT * FROM tab1 WHERE Param1 = 10)
BEGIN
        PRINT 'NOT EXISTS'
END



DECLARE @DateBegin datetime
DECLARE @DateEnd datetime

SET @DateBegin = 'aug 15 1969'
SET @DateEnd = 'aug 16 1969'

IF DATEDIFF(DAY, @DateBegin, @DateEnd) <> 1
BEGIN
    DECLARE @@DateBegin varchar(11)
    DECLARE @@DateEnd varchar(11)

    SET @@DateBegin = CAST(@DateBegin AS varchar(11))
    SET @@DateEnd = CAST(@DateEnd AS varchar(11))

    RAISERROR ('Разница между ''%s '' и ''%s '' не равна 1', 16, 1, @@DateBegin, @@DateEnd)
    RETURN
END