Forum Replies Created

Viewing 15 posts - 916 through 930 (of 2,458 total)

  • RE: Automation to find element path in xml files

    Here's some code to get you started. Note my comments:

    -- Two variables designed to emulate your XML files

    DECLARE @emp XML =

    '<?xml version="1.0" encoding="utf-8"?>

    <EmployeeDetails RunDate="2016-03-07">

    <Employees EmployeesCount="3">

    ...

    "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: Which indexes out of MISSING INDEXes report are most important to implement?

    VoldemarG (3/21/2016)


    WHen you look at query plans or query DMVs for missing indexes,

    it is an obvious practice not to implement them all. What is one most important criteria

    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: The New Men of IT

    The SQL world is like the Wild West. I have stories similar to everyone on this thread and have also been interviewed by idiots. I'll offer some advice to people...

    "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: problem with the query plan cache probably

    Mad-Dog (3/21/2016)


    Hi,

    i'm using sql server 2008 R2 sp3 and i have some weird issue with some queries. every few days some of my query become very slow.

    if i clean the...

    "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: Trim string based on characters

    -- Sample values in a table

    DECLARE @repository TABLE(someid int, string varchar(100));

    INSERT @repository VALUES (1,'WebApp - 10148'),(2,'Smart - App - 1458'),(3,'No Number - here');

    -- Solution if there's always a number

    SELECT String,...

    "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: 2014 SSMS - SA Account password changing on it's owm - how to get rid off this issue.

    I'm a fan of disabling the SA account and using a SQL account with a different name if I need a SQL account with elevated privileges.

    In addition to what...

    "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: Trying to count distinct warehouses per order and get the total

    You can't do what Luis suggested because you can't COUNT(DISTINCT) with an OVER clause.

    That said, you may want to try to do the aggregations in SSRS because the 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: Looping and scalar value

    drew.allen (3/21/2016)


    Eirikur Eiriksson (3/21/2016)


    kuopaz (3/21/2016)


    I see, thanks. As it's scanning the tally table row-by-row from start to the predicate value, the order of N may be important in some cases...

    "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?

    yb751 (3/21/2016)


    SQLRNNR (3/21/2016)


    Brandie Tarvin (3/21/2016)


    Lynn Pettis (3/21/2016)


    Okay, my daughter and I are in Providence, RI. We were scheduled to do campus visit at Johnson & Wales University this morning...

    "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?

    Any CLR savvy people want to take a look at this? http://www.sqlservercentral.com/Forums/Topic1766573-3412-1.aspx

    Solomon Perhaps?

    "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: Trouble Deploying CLR functions

    fxferguson (3/4/2016)


    Thanks Alan,

    The CLR assemblies I'm trying to deploy performs a lot of external file manipulation. I attempted to use them on a 2014 server and they would bomb. The...

    "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: Avoid Blank Values in a column

    Ed Wagner (3/11/2016)


    Alan, I stand corrected. I've never seen it done this way. I learned something new, so thank you.

    Sorry for the late reply Ed (I was away...

    "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?

    Jack Corbett (3/21/2016)


    Alan.B (3/21/2016)


    Quick question: I got the standard email saying that someone replied to a comment on one of the forum threads but when I go to...

    "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?

    Quick question: I got the standard email saying that someone replied to a comment on one of the forum threads but when I go to that thread the comment 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: Find a String in a String

    quagmired (3/20/2016)


    This is exactly what I'm talking about when I mention "cumbersome TSQL solution". For arbitrary 0s, I'd say a tally table would have to have over 2 billion records,...

    "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 - 916 through 930 (of 2,458 total)