Forum Replies Created

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

  • Reply To: The JSON Table

    JSON_OBJECT

    https://learn.microsoft.com/en-us/sql/t-sql/functions/json-object-transact-sql?view=sql-server-ver16

    Return value

    Returns a valid JSON object string of nvarchar(max) type.

  • Reply To: A NOT NULL Default

    set ansi_null_dflt_ON OFF

    create table TDfTest(i int)

    insert into TDfTest values (NULL)

    --Cannot insert the value NULL into column 'i', table 'test.dbo.TDfTest'; column does not allow nulls. INSERT fails.

  • Reply To: Rounding in Python

    the answer for val2[-3] is 3, and -3 is not equal to -2

  • 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...

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