Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)

  • Reply To: Minus Query

    (SELECT FIRSTNAME

    FROM EMPLOYEE

    EXCEPT

    SELECT FIRSTNAME

    FROM PERSON)

    UNION

    (SELECT FIRSTNAME

    FROM PERSON

    EXCEPT

    SELECT FIRSTNAME

    FROM EMPLOYEE)

    ORDER BY FIRSTNAME;

  • Reply To: Delaying the code

    between "WAITFOR DELAY '00:02.5':  and "WAITFOR DELAY '00:02:00.5'" is the big difference

  • Reply To: The Derived Table

    GO

    CREATE procedure spt

    as

    SELECT C.CustomerID

    FROM

    (

    SELECT

    sh.CustomerID,

    OrderDate = MAX(sh.OrderDate)

    FROM dbo.SalesHeader AS sh

    GROUP BY sh.CustomerID

    ) AS C

    INNER JOIN C AS c2

    ON C.CustomerID = c2.CustomerID;

    GO

    select * from sys.procedures p where p.name='spt'

    GO

    drop procedure if exists dbo.spt

    GO

    select...

  • Reply To: Reindexing a database

    REBUILD [ WITH (<rebuild_index_option> [ ,... n]) ]

    Applies to: SQL Server (Starting with SQL Server 2012 (11.x)) and Azure SQL Database

    Specifies the index will be rebuilt using the same columns, index type, uniqueness attribute,...

  • Reply To: Storing JSON data

    LOB storage - JSON documents can be stored as-is in NVARCHAR columns. This is the best way for quick data load and ingestion because the loading speed is matching loading of string columns....

  • Reply To: Creating a DDL Trigger

    The following shows the syntax of creating a DDL trigger:

    CREATE TRIGGER trigger_name

    ON { DATABASE |  ALL SERVER}

    [WITH ddl_trigger_option]

    FOR {event_type | event_group }

    AS {sql_statement}

  • RE: Using table hint TabLock

    In TabLockTable are as minimum two fields.
    Insert Into TabLockTable Values ('Test TabLock') - syntax error

  • RE: STRING_SPLIT()

    DECLARE @cars VARCHAR(200) = 'Porsche, Ferrari, Bentley, Jaguar,Range Rover'
    SELECT *
    FROM STRING_SPLIT(@cars, ', ') 
    please, remove last blank from separator

  • RE: Primary and Foriegn Keys on Temp Tables

    http://www.sqlservercentral.com/questions/Foreign+Keys+(FK)/144670/

    CREATE TABLE #TableTest1 (

    ID INT NOT NULL,

    CONSTRAINT PK_ID1 PRIMARY KEY(ID)

    );

    CREATE TABLE TableTest2 (

    ID INT NOT NULL

    CONSTRAINT FK_TableTest1_ID FOREIGN KEY (ID) REFERENCES #TableTest1(ID)

    );

    INSERT INTO #TableTest1 (ID)

    VALUES

    (1);

    INSERT INTO TableTest2 (ID)

    VALUES

    (2);

    select...

  • RE: Automatic update of outdated statistics

    modification_counter

    bigint

    Total number of modifications for the leading statistics column (the column on which the histogram is built) since the last time statistics were updated.

  • RE: Table Variables

    Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.0...

  • RE: SQL Server Browser & DAC

    The DAC port is assigned dynamically by SQL Server during startup. When connecting to the default instance, the DAC avoids using a SQL Server Resolution Protocol (SSRP) request to the...

  • RE: TRUNCATE TABLE and ROLLBACK TRAN

    CREATE TABLE t(id INT IDENTITY, i INT)

    BEGIN TRAN

    INSERT INTO t VALUES (4),(2),(3)

    SELECT * FROM t

    ROLLBACK TRAN

    SELECT * FROM t

    INSERT INTO t VALUES (4),(2),(3)

    SELECT * FROM t

    where is rollback?

  • RE: Summing

    DECLARE @t TABLE (id INT)

    SELECT SUM(1) AS sum_, COUNT(*) AS cnt_ FROM @t

    sum_=NULL

    cnt_=0

  • RE: Transparent database encryption

    ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_4deptrbl/html/c75d0d4b-4008-4e71-9a9d-cee2a566bd3b.htm

    The pages in an encrypted database are encrypted before they are written to disk and decrypted when read into memory

Viewing 15 posts - 1 through 15 (of 15 total)