Forum Replies Created

Viewing 15 posts - 391 through 405 (of 562 total)

  • RE: Random fill.

    spaghettidba (4/19/2014)


    Oh, I see what you mean.

    Try this:

    Tried the solution.

    And I am trying to understand the solution.

    First the solution does not work if the target table is larger than the...

  • RE: Random fill.

    spaghettidba (4/18/2014)


    Well, it worked on the sample data you provided.

    If you gave us more significant sample data, maybe someone could come up with something better.

    Both tables where of the same...

  • RE: Random fill.

    print '-- Start of use_value.full_name_txt : '+convert(varchar(30),getdate(),126)

    --

    -- Get the max from the use_value table.

    --

    declare @Max_number int

    select @max_number = count(*) from use_value

    print 'number use_value, full_name_txt :'+convert(varchar(10), @max_number)

    ;

    WITH

    T...

  • RE: Random fill.

    ben.brugman (4/18/2014)


    spaghettidba (4/18/2014)


    WITH T1 AS (

    SELECT *, randowCol = NEWID()

    FROM Target

    ),

    T2 AS (

    SELECT *, RN = ROW_NUMBER() OVER (ORDER BY randowCol)

    FROM T1

    )

    UPDATE T2

    SET full_name_txt = (SELECT column1 FROM Use_value V...

  • RE: Random fill.

    spaghettidba (4/18/2014)


    WITH T1 AS (

    SELECT *, randowCol = NEWID()

    FROM Target

    ),

    T2 AS (

    SELECT *, RN = ROW_NUMBER() OVER (ORDER BY randowCol)

    FROM T1

    )

    UPDATE T2

    SET full_name_txt = (SELECT column1 FROM Use_value V WHERE...

  • RE: Random fill.

    ScottPletcher (4/18/2014)


    You don't want to modify the target table structure, as that will have lots of overhead.

    Actually adding a RND column to the table, using it and removing it hardly...

  • RE: Random fill.

    spaghettidba (4/18/2014)


    My bad.

    The subquery returns always the same value because it is not correlated with the outer query.

    Well, looks like you solved your issue.

    This was the old solution.

    But I...

  • RE: Random fill.

    spaghettidba (4/18/2014)


    This could be one way to do it.

    UPDATE T2

    SET SomeColumn = RandomValues.SomeValue

    FROM Table2 AS T2

    CROSS APPLY (

    SELECT TOP(1) SomeValue

    FROM Table1

    ...

  • RE: recursive structure.

    Brandie Tarvin (4/16/2014)


    FYI: I added semi-colons to the above statements so you don't have to stick a ; before the WITH CTE statement. Not that it helps. Your lines don't...

  • RE: recursive structure.

    Thanks Lowell for the example.

    I am trying to order the data which I have. Which is the relations between the 'child' and 'parent'.

    So I took your example and 'removed' the...

  • RE: Need a query to select aggregate data by buckets

    SQL Guy 1 (3/24/2014)


    I have a table which has a unique integer column. It's not contiguous, it has some gaps.

    I need to find a count of records within...

  • RE: Need help, SSIS:Multiple Flat files with diferent format

    Similar question from here.

    Regulary I want to import Excel files. (Or CSV files).

    Extention is known.

    Format is not predetermined.

    Is there a solution for this ?

    A general solution which imports data without...

  • RE: SSIS importing of Excel information.

    JohnFTamburo (3/24/2014)


    Hi.

    1. What problems are you running into prior to using the SP?

    2. Exactly what solution are you trying to accomplish that the DTSX is not accomplishing for you?

    The question...

  • RE: Number of times a function is accessed.

    SQLRNNR (2/6/2014)


    You can try this code that may get some execution counts for the function you are investigating.

    Thanks for the script, in the script I noticed a number of nested...

  • RE: Number of times a function is accessed.

    Eugene Elutin (2/6/2014)


    If you want to see how many times any sql executed with calling this functions, Gail's suggestion with profile might help.

    But it has nothing to do with...

Viewing 15 posts - 391 through 405 (of 562 total)