Forum Replies Created

Viewing 15 posts - 2,011 through 2,025 (of 2,458 total)

  • RE: what is the use of Over Clause

    Duh... Here's a few more :hehe:

    http://www.sqlservercentral.com/Forums/Topic1519856-824-29.aspx#bm1522006

    "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 few reflections on RBAR by a weary application developer

    patrickmcginnis59 10839 (12/9/2013)


    peter-757102 (12/9/2013)


    Charles Kincaid (12/9/2013)


    So let's take an example of a SELECT that does not make any use of indexes.

    RBAR fetches more rows from the table. False. ...

    "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: SQLServerCentral apologizes and you can win a book

    bhw0006 48811 (12/9/2013)


    This is awesome ya'll are doing this

    if object_id('tempdb..#table') is not null drop table #table

    go

    select first_name, last_name, age

    into #table

    from (

    select 'Chuck' as first_name, 'Norris' as last_name, '32' as...

    "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: Merge - Pros and cons

    Dwain Camps posted a great article on Performance of the SQL MERGE vs. INSERT/UPDATE[/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: what is the use of Over Clause

    Here's a good article by Robert Sheldon with some examples:

    Working with Window Functions in SQL Server[/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: SQLServerCentral apologizes and you can win a book

    Plagiarism stinks.

    ...on that note, here's an ITVF that uses ROW_NUMBER() for calculating the longest common substring.

    -- (1) Function to find the longest common substring

    CREATE FUNCTION CommonSubstrings(@s1 varchar(8000),@s2 varchar(8000))

    RETURNS...

    "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: High-Performance Transact-SQL with Window Functions

    dwain.c (12/3/2013)


    GordonLiddy (12/3/2013)


    This article is a complete ripoff from Itzik Ben-Gan's book Microsoft SQL Server 2012 High-Performance T-SQL Using Window Functions! Nowhere is there any credits to the original author...

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

    This should get you what you need:

    WITH

    xxx AS

    (

    SELECTpe.IPCode AS pe_ip,

    pr.IPCode AS pr_ip,

    pr.ID,

    DENSE_RANK() OVER (PARTITION BY pr.IPCode ORDER BY ID) AS x

    FROM Person pe

    CROSS APPLY [Profile] pr

    WHERE pe.IPCode=pr.IPCode

    ),

    qualifiers...

    "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 display totals grand total in t-sql

    Jeff Moden (11/20/2013)


    Alan.B (11/20/2013)


    clayman (11/20/2013)


    Jeff Moden (11/19/2013)


    clayman (11/19/2013)


    dastagiri16 (11/19/2013)


    hi,

    i need the text like "TOTAL" ...rollup wont give it...

    Please advice

    Use SSRS

    BWAAAA-HAAAA!!!! Sure it's easy to get to 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: Count for each account no -parent and childsql

    Operating under the assumption that items beginning with L are children:

    DECLARE @lines TABLE

    (line_no int,

    code varchar(3) not null,

    account_no varchar(10) not null)

    INSERT @lines

    SELECT Line_no = 123,...

    "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 display totals grand total in t-sql

    clayman (11/20/2013)


    Jeff Moden (11/19/2013)


    clayman (11/19/2013)


    dastagiri16 (11/19/2013)


    hi,

    i need the text like "TOTAL" ...rollup wont give it...

    Please advice

    Use SSRS

    BWAAAA-HAAAA!!!! Sure it's easy to get to the moon. All...

    "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 display totals grand total in t-sql

    pietlinden (11/19/2013)


    If you're fairly new to SQL, I would do this in SSRS, because you can get SSRS to do pretty much all the hard work for you (sorting, grouping,...

    "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: Changing replication publication name

    No

    "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: Programmatically get SSRS Database Name

    This could do this trick:

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

    CREATE TABLE ##ssrs_candidates (c_id int identity, ssrs_db varchar(100));

    EXEC sp_msforeachdb'

    INSERT INTO ##ssrs_candidates

    SELECT TABLE_CATALOG

    FROM [?].information_schema.columns

    WHERETABLE_NAME =''Catalog''

    ANDCOLUMN_NAME =''ItemID''

    ANDORDINAL_POSITION =1

    ANDDATA_TYPE=''uniqueidentifier''

    '

    SELECT * FROM...

    "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: convert CSV file to XML file format based on XSD file using SSIS (SQL Server 2008R2)

    krish.sett (8/3/2011)


    Thanks for the info.....so basically i need to create a XSLT file for my XML file so that i can use XML Task Editor for the conversion.

    This is really...

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