Forum Replies Created

Viewing 15 posts - 2,116 through 2,130 (of 3,957 total)

  • RE: Nested replaces ?

    Steven Willis (1/22/2013)


    Sorry dwain.c, I didn't test your code, but if you or anyone else cares enough it wouldn't be that hard to test it with the attached testing code.

    No...

  • RE: sql query

    mister.magoo (1/21/2013)


    DECLARE @t table(Col1 char(1),Col2 char(1),Col3 char(1));

    INSERT @t(Col1,Col2,Col3)

    VALUES('a','b','c');

    SELECT Col

    FROM @t as T

    CROSS APPLY (VALUES(Col1),(Col2),(Col3)) AS CA(Col);

    Silly me. I thought he was trying to split a delimited string....

  • RE: Need a Stored procedure

    Another option is the paid version of the SQL# CLR library by Solomon Rutzky: http://www.sqlsharp.com/

    There are two functions in it: INET_Ping and INET_PingTime that may be of interest to you.

    As...

  • RE: sql query

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

  • RE: Stored Proc and performance

    tyson.price (1/21/2013)


    Any old CICS mainframe programmers here remember calling a deadlock a "deadly embrace"? That wasn't limited to just databases, which were relatively new in my environment (we were...

  • RE: TSQL Subtotalling

    Mark - I'm not sure why you used two window functions:

    WITH SourceRecordset AS (

    SELECT [index], workcode, value

    FROM (

    VALUES(1, 'CL', 5),

    (2, 'CL', 10),

    ...

  • RE: Word analysis with SQL

    If Mr. Magoo's link doesn't give you any ideas, you might want to take a look at the 4th article in my signature links to retrieve the FUNCTION PatternSplitCM and...

  • RE: Nested replaces ?

    Writing the function as a iTVF might improve performance a notch.

    -- =============================================

    -- Author:ben brugman / dwain.c (sqlservercentral)

    -- Create date: 20130118

    -- Description:Does replace @in a str@ing

    -- =============================================

    -- drop function replace2

    CREATE FUNCTION...

  • RE: Recursively create Tree Structure

    Rats! Now why didn't I think of that?

    +1 Peter

  • RE: Recursively create Tree Structure

    Not a fair race!

    You:

    - Removed the tool tip column from your INSERTs

    - Your INSERTs were missing tons of commas and quotes

    - You changed the IDENTITY_INSERT setting

    - I think you changed...

  • RE: Recursively create Tree Structure

    vinu512 (1/18/2013)


    Hi Dwain,

    I don't think your query would work if I change the data a little.

    Try your query with this new data:

    Insert Into ES_SubModuleMaster

    Select 1,1,'Academic',2013-01-01 00:00:00.0002013-01-04...

  • RE: t-sql question

    anthony.green (1/18/2013)


    How many steps does the job have?

    If 1, you could look at changing the advanced properties of the step to have a retry attempts value of 2 and a...

  • RE: Nested replaces ?

    ben.brugman (1/18/2013)


    Thanks for your solution, tried to study the solution,

    'DelimitedSplit8K' is missing.

    So I could not try the solution.

    Sorry about that. I thought most folks were familiar with this FUNCTION,...

  • RE: Nested replaces ?

    Probably will run a little faster with dynamic SQL though.

    DECLARE @sql NVARCHAR(MAX) = ''

    DECLARE @MyString VARCHAR(100) = 'aaabbcdefgh'

    ;WITH Replacements (n,a,b) AS (

    SELECT...

  • RE: Nested replaces ?

    Special_replace2 ain't so hard:

    DECLARE @MyString VARCHAR(100) = 'aaabbcdefgh'

    ;WITH Replacements (n,a,b) AS (

    SELECT 1, 'aaa|bb|c|d|e|f|g|h','11|2|3|4444|5|6|7|8'),

    Transform (ItemNumber, a, b) AS...

Viewing 15 posts - 2,116 through 2,130 (of 3,957 total)