Forum Replies Created

Viewing 15 posts - 1,876 through 1,890 (of 2,462 total)

  • RE: Data Compression and Snapshot Isolation

    Good article, very interesting.

    "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: Remove non alpha chars from a column

    Some day we might have the ANSI/ISO Standard TRANSLATE()

    In the meantime you can use the one that I created.

    I am working on an article I plan to submit...

    "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: Nightly Job Failing to Truncate Transaction Log

    As a general note, I suggest looking through this free book (free when downloaded as PDF): SQL Server Transaction Log Management by Tony Davis and Gail Shaw. It's the best...

    "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 show tooltip or message in parameter area in ssrs 2012

    how to show tooltip for parameter values in ssrs 2012?

    how to show hardcoded message in parameter area in ssrs 2012?

    You can't (not without making serious changes to your...

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

    I'm thinking something like this...

    WITH

    scores(ID, creationdate, score, MCC) AS--SAMPLE DATA

    (

    SELECT 1, '2014-08-02', 30, 7422 UNION ALL

    SELECT 2, '2014-08-03', 40, 7422 UNION ALL

    SELECT 3, '2014-08-01', 100, 7500 UNION...

    "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: SELECT lento en una tabla de 9000 filas

    It looks like John beat me to it, if you can post a query plan that would be a great help - see: 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: I'm new to SQL development..

    I would second both recommendations and add that you can't go wrong with any Itzek ben-Gan book.

    Learn what a tally table is; that has changed my career.

    This site...

    "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: SubstringIndex

    ... I was thinking, using the logic in my previous post you could create a dbo.SubstringBeforeSSI function (examples included in the code)...

    ALTER FUNCTION dbo.SubstringBeforeSSI

    (

    @string varchar(1000),

    @substring varchar(100),

    @substring_index tinyint

    )

    /*

    DECLARE @string varchar(1000)='10.0.1600.22',

    @searchPattern varchar(100)='.',

    @substring_index...

    "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: SubstringIndex

    This wont perform as well as what Eugene posted but is a solid, set-based way to solve this problem dynamically...

    Using my Ngrams8k function:

    ALTER FUNCTION [dbo].[nGrams8K]

    (

    @string VARCHAR(8000),

    @n TINYINT,

    @pad BIT=0

    )

    /*--

    Created by:Alan Burstein

    Created...

    "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: Need help in query

    Another Approach:

    ;with

    CurrentResutSet(Period, Sense, mt, Total) AS

    (

    select '2014_S27', 'CPT', 1, 215 union all

    select '2014_S27',...

    "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: Need help in query - urgent plz

    As Louis said, DDL and what you have tried will help us help you faster. That said, I think you are looking for this:

    WITH

    your_data AS

    (SELECT *

    FROM (values ('ClassA',10001,'Y','Eligible',1,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: How do I handle transactional replication when moving the Subscriber (shutdown for a day and bring online)

    dagnea (9/16/2014)


    ...he insisted that the log file on the publishing database will not get truncated and will grow until the stopped subscription is started and the subscriber synched.

    Does this make...

    "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 help to find total

    A couple variations (these will get you the same query plan as what rxm posted).

    SELECT isnull(cast(id as varchar(12)),'Total'), sum(cnt)

    FROM @rollup

    GROUP BY id with rollup;

    or...

    -- since we're only...

    "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: Splitting Strings Based on Patterns

    Jeff Moden (9/12/2014)


    fregatepllada (9/12/2014)


    Dwain you do not need CLR to use regex 🙂

    There is an old way to call Vbscript library

    From t-SQL code 😉

    sp_OA???

    I suspect they were talking about:...

    "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: Language Translation in SSRS

    :Whistling:

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