Forum Replies Created

Viewing 15 posts - 496 through 510 (of 3,544 total)

  • RE: joining two select queries results in one row

    stevefromOZ (6/12/2015)


    ahh but David, Surname is in table2 not table1. How would we get the value from table2 instead? :hehe:

    Deliberate mistake 😛

    😀

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: joining two select queries results in one row

    Phil Parkin (6/12/2015)


    vipin_jha123 (6/12/2015)


    What if out form both statement comes from 2 different table.

    Regards,

    Vipin jha

    JOIN the tables.

    Don't need any JOIN 😛

    DECLARE @Name varchar(255),@Surname varchar(255);

    SELECT @Name = [Name] FROM [table1];

    SELECT @Surname...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Apply And operator on same column

    Bit late 😀

    SELECT NewsId

    FROM #NewsEntities

    WHERE EntityId IN (1,2)

    GROUP BY NewsId

    HAVING SUM(EntityId) = 1

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SSIS package to split address into 3 fields

    W4Designs (6/10/2015)


    David, you jumped WAY over my head with that one!

    Mine too LOL I just an idea that jumped into my head

    I was thinking of adding a new derived...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Like to have data returned in 1 row vs. multiple rows

    Jeff Moden (6/10/2015)


    David Burrows (6/10/2015)


    Jeff Moden (6/9/2015)


    Is the number of columns in the final output a given or do we have to have the code figure that out?

    Shouldn't that be...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SSIS package to split address into 3 fields

    This might be possible using derived columns but would be a very complex expression or using several derived columns to pad the string into 50 column chunks and a final...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SSIS package to split address into 3 fields

    In that case a script task is probably the way to go but in your case change the code to

    start at col 50 and work backwards to first non space...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Like to have data returned in 1 row vs. multiple rows

    Your welcome

    For quick, excellent and efficient answers Jeff's articles should always be your starting point 😉

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Like to have data returned in 1 row vs. multiple rows

    Jeff Moden (6/9/2015)


    Is the number of columns in the final output a given or do we have to have the code figure that out?

    Shouldn't that be max number of rows...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SSIS package to split address into 3 fields

    With derived column transformation set it to new column and use an expressions like

    SUBSTRING([address ] +REPLICATE(" ",50),1,50)

    SUBSTRING([address ] +REPLICATE(" ",100),51,50)

    SUBSTRING([address ] +REPLICATE(" ",150),101,50)

    *NOTE* Not tested

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Primary Key / Index Question

    Jeff Moden (6/3/2015)


    David Burrows (6/3/2015)


    Jeff Moden (6/3/2015)


    If the PeriodNo is ever increasing, then yeah, I agree.

    Thanks Jeff

    Yes PeriodNo will always be increasing

    I will go with Tom's suggestion 🙂

    Just one...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Primary Key / Index Question

    Jeff Moden (6/3/2015)


    If the PeriodNo is ever increasing, then yeah, I agree.

    Thanks Jeff

    Yes PeriodNo will always be increasing

    I will go with Tom's suggestion 🙂

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Primary Key / Index Question

    Brandie Tarvin (6/3/2015)


    If UploadID is used for anything at all, I might make it part of a composite clustered index. But, as Tom suggested, make it a separate UNCLUSTERED PK...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Primary Key / Index Question

    Thanks Tom 🙂

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Primary Key / Index Question

    Thanks for the feedback Tom

    1) How frequent are deletes?

    Unknown as the user can run a process any number of times or not at all

    2) How frequent are updates? Or are...

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 496 through 510 (of 3,544 total)