Forum Replies Created

Viewing 15 posts - 1,426 through 1,440 (of 2,458 total)

  • RE: A question on JOIN

    Sean Lange (5/29/2015)


    sarath.tata (5/29/2015)


    Sean Lange (5/29/2015)


    sarath.tata (5/29/2015)


    Sean Lange (5/29/2015)


    Your question is not at all clear. What would be helpful is if you could post ddl and sample data in addition...

    "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 question on JOIN

    Based on your original post, this will give you exactly what you were requesting:

    DECLARE @order TABLE (OrderNbr int);

    DECLARE @dept TABLE (Dept CHAR(1), Person varchar(3));

    INSERT @order VALUES (1),(2),(3),(4),(5),(6);

    INSERT @dept VALUES

    ('A','P1'),

    ('A','P2'),

    ('B','P3'),

    ('B','P4'),

    ('B','P5'),

    ('C','P6'),

    ('C','P7'),

    ('C','P8'),

    ('C','P9');

    SELECT d.Dept,...

    "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: Big Data for SQL folks: The Technologies (Part II)

    Just read this. Amazing work Frank!

    Looks like SQL 2016 is going to be very Big Data-Centric from what I have read.

    "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: ReportServer.Calalog.Content = Very Slow/Expensive XML query

    Jason A. Long (5/29/2015)


    Well now... Turns out that the SQL Server instance that's running Reporting Services only has a single CPU core available to it...

    I suppose that's why a 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: Statistical Analysis

    simon.barnes (5/29/2015)


    I then discovered that there's no median function built into SQL Server (2008 R2, at least). Simple enough to write. I then heard the words "interquartile range" (75th percentile...

    "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: Documenting a Report in SSRS 2008 R2

    You can get most of what you are looking for by querying <your ReportServer DB>.<schema>.catalog. You can get the RDL/XML by casting the Content column as varbinay then as XML...

    "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: ReportServer.Calalog.Content = Very Slow/Expensive XML query

    Jason A. Long (5/28/2015)


    First thing first, here is the query that I'm using...

    WITH ContentToVarBin AS (

    SELECT

    c.Name,

    CAST(c.Content AS VARBINARY(MAX)) AS Content

    FROM

    ReportServer.dbo.Catalog c

    WHERE

    [Type] = 2

    ), ContentToXML AS (--The second...

    "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: List of databases have objects (like views or stored procs?) that reference a server

    Not clear what you mean by:

    reference to a particular server?

    If you are talking about checking Objects on other servers you can loop through the server you are on as well...

    "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: If Celko was a rock star, which one would he be?

    I'm going to go with Jim Morrison seeing that he's been banned from another Venue.

    "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: replace help

    This is not a very clear description of what you are trying to do. Can you post some DDL, consumable sample data and an example of the expected results?

    "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: What is the difference between DMV, DBCC and DMF

    DMV's are views, DMF's are functions. Dynamic Management Views and Functions were introduced in SQL 2005 and allow you to look at information that is stored in the Query Cache,...

    "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: Statistical Analysis

    I think this is one of the areas where our profession will grow more and more across the next decade. As we deal with lots of data of varying types,...

    "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: Tuning expensive query III

    You've been around enough to know about posting DLL, sample data, etc... You're also posting the estimated query plan. The actual query plan would be better.

    Anyhow, from a birds-eye...

    "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: REPLACE Multiple Spaces with One

    Gary Harding (5/28/2015)


    Alan.B (5/27/2015)


    Michael Meierruth (5/27/2015)


    Alan B.

    How does your function stand up to a varchar(8000) column with an * at the beginning and end and all blanks in between?

    Okay, first...

    "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 generate week ranges like this picture in sql

    I wrote a numbers function some time ago that is designed for exactly this type of thing.

    IF OBJECT_ID('dbo.GetNumsAB','IF') IS NOT NULL

    DROP FUNCTION dbo.GetNumsAB;

    GO

    CREATE FUNCTION dbo.GetNumsAB(@low int, @high int, @range...

    "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,426 through 1,440 (of 2,458 total)