Forum Replies Created

Viewing 15 posts - 1,156 through 1,170 (of 2,462 total)

  • RE: Row number over guid

    <removed> Mistaken.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Querying AdditionalInfo xml field from ExecutionLog2?

    We have one particular report that contains 18 datasets, all stored procedure based, that needs to be studied for performance reasons, especially. Every now and then this particular report gets...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Improvements or enhancements from 2008 to 2014

    Sapen (11/20/2015)


    Is there a document or a url that discusses only about the improvements or enhancements or new features that were added in

    Database mirroing, logshipping, replication, clustering from version...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: String Compare

    This is where a Tally Table is a good thing. I run into this kind of problem and want to know why 2 strings are not equal. This would probably...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    -- TheTimeIs Script

    -- start script

    CREATE PROC TheTimeIs AS

    SELECT CREATED FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME = 'TheTimeIs';

    GO

    EXEC TheTimeIs;

    DROP PROC TheTimeIs;

    GO

    -- end script

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    Lynn Pettis (11/19/2015)


    Jeff Moden (11/19/2015)


    Eirikur Eiriksson (11/19/2015)


    So to recap, here are 9 different methods for getting the current time, any additions anyone?

    😎

    SELECT

    GETDATE()

    ,SYSDATETIME()

    ...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Unable to print the charindex of a special character of its 4th occurrence.

    Just for fun and practice:

    DECLARE @x varchar(100) = 'AB_CD_EF_GH_IJ';

    WITH L1 AS (SELECT N=1 FROM (VALUES (1),(1),(1),(1),(1),(1),(1),(1),(1),(1))X(x)), -- 10 rows

    iTally(N) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT 1)) FROM L1...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: A Case FOR Cursors...

    Sean Lange (11/17/2015)


    Alan.B (11/16/2015)


    The Dixie Flatline (11/16/2015)


    Without using specific examples to test, it is hard to explain why set-based processing outperforms cursor-based code. ..."It depends" to coin a...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    Brandie Tarvin (11/17/2015)


    Ed Wagner (11/17/2015)


    Brandie Tarvin (11/17/2015)


    Ed Wagner (11/17/2015)


    Lynn Pettis (11/16/2015)


    Ed Wagner (11/16/2015)


    Lynn Pettis (11/16/2015)


    And then you this type of question:

    ************(11/16/2015)


    How can i round off decimal number. E.g if i...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: A Case FOR Cursors...

    The Dixie Flatline (11/16/2015)


    Without using specific examples to test, it is hard to explain why set-based processing outperforms cursor-based code. ..."It depends" to coin a cliche. ...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Good Basic T-SQL Exercises

    I thought more people would jump on this. :Whistling:

    Anyhow I took a few minutes to throw some stuff together for you. Perhaps this will be helpful.

    USE tempdb

    GO

    /****************************************************************************************

    (1) Create Sample...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Getting previous month data when new year starts

    alex_martinez (11/14/2015)


    Thank you, I still a little fizz on this, can you give me an example. Thank you.

    I'm not at a PC so I can't test this but...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Whether my table is stored as heap or b-tree?

    Jeff beat me to it. Tables are either HEAPS or Clustered Tables (e.g. a table with a clustered index which means it's a B-Tree).

    I would add, you could run this...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Using the Stuff Function

    Luis Cazares (11/12/2015)


    Do you know what the stuff function does?

    https://msdn.microsoft.com/en-us/library/ms188043.aspx

    SELECT STUFF ( 'This is a lack of knowledge' , 11 , 7 , 'great' )

    Though STUFF is an insignificant and...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Using the Stuff Function

    This should get you started.

    http://www.sqlservercentral.com/articles/comma+separated+list/71700/%5B/url%5D

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 15 posts - 1,156 through 1,170 (of 2,462 total)