Forum Replies Created

Viewing 15 posts - 1,831 through 1,845 (of 2,462 total)

  • RE: sp_executesql help

    Eirikur Eiriksson (12/4/2014)


    Quick suggestion (pseudo code)

    ๐Ÿ˜Ž

    DECLARE @ParamTable varchar(100) = N''; -- include...

    "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: Calling SSIS Package through Store Procedure

    rocky_498 (12/4/2014)


    I know, I can create SQL agent job and run that job through SP sp_start_job 'JOB Name', but How I can pass variable?

    Argh, I put together a longer reply...

    "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: Extracting XML

    -- Sample data matching what you have

    DECLARE @tblCCH TABLE

    (PKID int primary key,

    OrderID int not null,

    CCXML xml not null

    );

    INSERT @tblCCH

    SELECT 1,31677,'<?xml version="1.0"?> <CC> <Type>4</Type> <Name><![CDATA[Lisa M. xxxxx]]></Name> <Amt>51.86</Amt>...

    "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: Calling SSIS Package through Store Procedure

    You can create a SQL agent job then create a step that executes the package. SSIS Packages are one of the options under Steps for "Type"

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

    Matthias Klรคy (11/28/2014)


    Hi Alan

    Thanks for this great function. One note:

    SELECT * FROM dbo.PatExclude8K('123# What?!... ', '[^a-z!?.]')

    returns hat?!...

    So it is case sensitive, contrary to your comment in the programmers notes. I...

    "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 2014 Tribal Awards

    Did not know that this existed. Very cool.

    "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: do you have a StripNonNumeric ITVF function?

    Eirikur Eiriksson (11/6/2014)


    :blush: just noticed, had several "versions", this one is no good

    ๐Ÿ˜Ž

    This guy here is slightly slower than the last (and fastest) version of PatExclude8K that you posted.

    ALTER...

    "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: do you have a StripNonNumeric ITVF function?

    Eirikur Eiriksson (11/6/2014)


    Alan.B (11/4/2014)


    Taking this one step further... Why not just replace PatExclude8K with PatReplace8k() ?:w00t:

    I like the idea, tinkered a little bit with the code and got the average...

    "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: Creating missing records....

    Unless I'm not understanding what you are doing you can just use ISNULL to deal with the NULLs like this:

    ISNULL (<value>, 0)

    "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: Integration Services for Dummies type book/resource?

    You can start here: Stairway to Integration Services[/url]. I like all the stairways but this one is particularly good.

    I just finished reading:

    Microsoft SQL Server 2012 Integration Services

    which 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: Parsing out a Data String with Text Delimeters

    Here's a function that should do the trick:

    CREATE FUNCTION dbo.SubstringBetween

    (

    @string varchar(1000),

    @searchString1 varchar(20),

    @searchString2 varchar(20)

    )

    /*

    -- example:

    DECLARE

    @string varchar(100) = '[atc1.123/atc2.456/atc3.789/atc4.xyz/]',

    @searchString1 varchar(20) = 'atc2',

    @searchString2 varchar(20) = 'atc3';

    SELECT newstring

    FROM dbo.SubstringBetween(@string,@searchString1,@searchString2);

    */

    RETURNS TABLE 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: String splitter function for mutli-char delimeters

    emph. mine

    g.britton (11/5/2014)


    Luis Cazares (11/5/2014)


    Note that those functions aren't intended for multi-character delimiters.

    Well....a multi-character delimiter is just a simple pattern without wildcards. So even though that's not the design...

    "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: String splitter function for mutli-char delimeters

    g.britton (11/5/2014)


    I've been using Jeff Moden's excellent Tally OH splitter for a while

    http://www.sqlservercentral.com/articles/Tally+Table/72993/

    In the comments it says:

    Optimized for single character delimiter. Multi-character delimiters should be resolved externally from this...

    "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: do you have a StripNonNumeric ITVF function?

    Taking this one step further... Why not just replace PatExclude8K with PatReplace8k() ?:w00t:

    I had to use logic from earlier in the thread but what about this for starters:

    CREATE FUNCTION...

    "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: do you have a StripNonNumeric ITVF function?

    Eirikur Eiriksson (11/4/2014)


    Just dawned on me, kind of a deja vu, here is around six years old thread on the same subject.

    ๐Ÿ˜Ž

    I read through this thread - very interesting...

    Got me...

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