Forum Replies Created

Viewing 15 posts - 421 through 435 (of 812 total)

  • RE: CTE

    Dscheypie (9/25/2013)


    Carlos,

    sure, you may be right.

    And the topic of this QotD is CTE and the usage of DML.

    With the example for identifying duplicate records I wouldn't agree to CTEs...

  • RE: CTE

    CTE is useless and complicated!

    The same result is reachable in a standard way:

    create table #a (i int)

    insert #a SELECT object_id FROM sys.objects

    delete from t

    from (SELECT * FROM #a WHERE i...

  • RE: CTE

    Koen Verbeeck (9/25/2013)


    Very interesting question. Never used a CTE with a DELETE statement before.

    +0.5

    Never used a CTE at all.

  • RE: Dynamic Query

    kapil_kk (9/23/2013)


    While using SELECT it will give the output in a commented lines while using EXEC it gives the error :crazy:

    declare @var Varchar(1000)

    set @var = '-- /* select ''Samith'' name

    ...

  • RE: Declare Variable

    Dscheypie (9/16/2013)


    Carlo Romagnano (9/16/2013)


    No, the scope is to the end of the batch, here, you can reference @j-2 out of the loop.

    declare @i int

    set @i = 2

    while...

  • RE: Declare Variable

    Stewart "Arturius" Campbell (9/16/2013)


    Carlo Romagnano (9/16/2013)


    In the following batch @j-2 is declared once, but initialized at every loop:

    declare @i int

    set @i = 2

    while @i < 10

    begin...

  • RE: Declare Variable

    In the following batch @j-2 is declared once, but initialized at every loop:

    declare @i int

    set @i = 2

    while @i < 10

    begin

    declare...

  • RE: Declare Variable

    Koen Verbeeck (9/15/2013)


    The question itself is great, however the explanation is lacking.

    There's no reference, and the explanation itself is incorrect.

    There's no variable that is "reset".

    The DECLARE is not ignored, it...

  • RE: Datefirst

    The scope of "set language" and "set datefirst" is per session and also per procedure/function

    Try this:

    create procedure proc_datefirst

    as

    set language 'us_english'

    select @@DATEFIRST

    go

    set language 'Italian'

    exec proc_datefirst

    select @@DATEFIRST

  • RE: Datefirst

    Clear and easy question!

    Thanks:-)

  • RE: Alter Certificate

    Thanks!

    Clear qotd!

    😛

  • RE: Alter Certificate

    Thanks!

    😛

  • RE: wildcards

    A version of the query without the use of local table:

    SELECT *

    FROM (

    VALUES ('Steve')

    , ('Stephan')

    , ('Stephanie')

    ...

  • RE: wildcards

    The correct exceution of the query depends on ansi_warnings

    set ansi_warnings off

    DECLARE @i TABLE( mychar VARCHAR(10));

    INSERT @i VALUES ('Steve'), ('Stephan'), ('Stephanie')

    ...

Viewing 15 posts - 421 through 435 (of 812 total)