Forum Replies Created

Viewing 15 posts - 1,786 through 1,800 (of 2,462 total)

  • RE: How to compare a list of numbers, kind of like lottery results

    Using the unpivot method in Dwain's article I came up with this solution...

    (Note that I used 4 numbers for brevity)

    USE SSRS_POC

    GO

    IF OBJECT_ID('tempdb..#tablewinners') IS NOT NULL DROP TABLE #tablewinners;

    IF OBJECT_ID('tempdb..#tableguesses') IS...

    "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: Query fast one day, slow the next day - can indexes go bad

    Igor Micev (2/5/2015)


    Alan.B (2/5/2015)


    Igor Micev (2/5/2015)


    Alan.B (2/5/2015)


    Or you can run DBCC FREEPROCCACHE & DBCC DROPCLEANBUFFERS (caution: this will cause other queries to slowdown as they will need to recompile)....

    "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: How to compare a list of numbers, kind of like lottery results

    Interesting...

    I have never unpivoted a table, but I think I understand what it is your are saying. I will read up on unpivot to see how to make it...

    "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: Query fast one day, slow the next day - can indexes go bad

    Igor Micev (2/5/2015)


    Alan.B (2/5/2015)


    Or you can run DBCC FREEPROCCACHE & DBCC DROPCLEANBUFFERS (caution: this will cause other queries to slowdown as they will need to recompile).

    No this! It...

    "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: Looking for suggestions

    I have also had luck with recruiters. I have a couple that I have worked with for years and they periodically send me a 20 hour-project where someone needs some...

    "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: Query fast one day, slow the next day - can indexes go bad

    Tom John-342103 (2/5/2015)


    Steve Jones - SSC Editor (2/5/2015)


    Could be parameter sniffing, perhaps a plan flush that compiled poorly the next time, it's not the index itself.

    We identified the offending query...

    "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: Parameter Sniffing or Something else?

    This will give you the info that you need:

    How to Post Performance Problems[/url]

    "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: Get Date Of Tuesday of Past x Years From Now

    I don't get exactly what you are trying to do but I know that a calendar table is helpful in this kind of situation. If you don't have one available...

    "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: Parameter Sniffing or Something else?

    If using option Recompile fixes it then you may be dealing with parameter sniffing. One way to know for sure is to capture the query plan when running the query...

    "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: practical advice arounding indexing and ETL?

    I just left a longer reply and got an error when I attempted to post it :angry:

    Anyhow, take a look at

    SQL University: Advanced Indexing – Indexing Strategies[/url]

    "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: get xml text from varchar column

    Anju Renjith (2/3/2015)


    create table tblxmldata

    (id int, xmltext xml)

    insert into tblxmldata values(1,'<associatedText><value type="PO">GTT taken</value></associatedText><associatedText><value type="PO">Check sugar today please</value></associatedText>')

    insert into tblxmldata values(2,'<associatedText><value type="PO">Check BP today please</value></associatedText>')

    I want the output as

    1 ...

    "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: get xml text from varchar column

    I want the output as

    GTT taken

    Check sugar today please

    SELECT id, xmltext.value('(/associatedText/value/text())[1]','varchar(100)')

    FROM tblxmldata;

    Note that you don't need the nodes() method in this case because you are only retrieving one value...

    "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: Curious interview question

    I have had to read from the registry when creating DTS (back in the day) and SSIS packages. Some app developers like to store information about that custom app in...

    "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: Search for specified items in report.

    Something to note...

    If you are only looking to extract report data from the reportserver..catalog table it's good to filter for Content that is not null and [Type] = 2....

    "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: Where do senior SQL DBAs land finally?

    I agree with all the previous comments, particularly what Jeff said about the "better" jobs find you. I am certainly not anywhere at the same DBA skill level as say...

    "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,786 through 1,800 (of 2,462 total)