Forum Replies Created

Viewing 15 posts - 7,486 through 7,500 (of 15,381 total)

  • RE: Stored procedure working very slow

    huum (7/18/2013)


    No no as you mentioned about un necessary repetative part of SP, thats what i meant

    Ahh gotcha. 😉

    Consider this piece of code.

    INSERT INTO @OfficeAccess (lOffice)

    SELECT map.loffice

    FROM map_PatientToOffice map

    INNER JOIN...

  • RE: Stored procedure working very slow

    huum (7/18/2013)


    can you please post the changes you like to make then i will test it?

    Regards

    Are you asking me to spend a whole day to try to restructure your code...

  • RE: Stored procedure working very slow

    huum (7/18/2013)


    This SP is running ON

    Microsoft SQL Enterprise Manager

    Microsoft Corporation

    Version: 8.0

    There is nothing like table definitions, index definitions and execution plan as Gail requested, and what you posted is nothing...

  • RE: Tell me if I'm crazy - Recursive CTE + View (Materialized, indexed?)

    jace.bennett (7/18/2013)


    I'm thinking these tables:

    Set(

    Id,

    Name,

    Dimension,

    ...)

    Person (

    Id,

    Name,

    ...)

    SetRelationships (

    ParentSetId,

    ChildSetId

    )

    PersonSets (

    PersonId,

    SetId

    )

    And then these tables give me a lot of my queries directly. The ones I want to denormalize would be

    PersonContainedBy(

    PersonId

    SetId

    )

    SetContainedBy(

    SetId,

    AncestorId

    )

    Which would be a...

  • RE: Stored procedure working very slow

    Phew!!! That is a lot of unformatted code to read.

    CREATE PROCEDURE dbo.NIC_CPP_LABRESULTS_GetReviewedPatientLabTests_AOS @lPatient INT,

    @nRecordStatus INT,

    @nClassLevel INT = 5,

    @nSecurityLevel INT = 0,

    @lMap_UserToOffice INT = 0

    AS

    SET TRANSACTION ISOLATION LEVEL READ COMMITTED

    BEGIN

    DECLARE @lUser...

  • RE: SPs inside BEGIN/ROLLBACK TRAN

    GilaMonster (7/18/2013)


    Sean Lange (7/18/2013)


    You can begin as many as you like but after the first all it does is increment @@TRANCOUNT. Then when there is a commit or rollback they...

  • RE: Tell me if I'm crazy - Recursive CTE + View (Materialized, indexed?)

    It sounds like you are thinking about having 3 columns that each have a delimited list of IDs or something like that? That is certainly not a normalized version. Or...

  • RE: Error inserting data with T-sql

    jdbrown239 (7/18/2013)


    Thanks

    Thanks Sean that worked. I also found that substring worked too.

    That is because in this case they are doing the same thing. 😉

  • RE: SPs inside BEGIN/ROLLBACK TRAN

    dan-572483 (7/18/2013)


    The answer is yes. If the code in the inner BEGIN/COMMIT TRAN runs without a SQL error, I was able to undo the changes with the outer ROLLBACK...

  • RE: Are the posted questions getting worse?

    WayneS (7/18/2013)


    Jeff Moden (7/17/2013)


    Steve Jones - SSC Editor (7/17/2013)


    Koen Verbeeck (7/17/2013)


    Jeff Moden (7/16/2013)


    Steve Jones - SSC Editor (7/16/2013)


    Arrgggg, some days I hate software.

    BWAAA-HAAA!!!! You mean like the stuff that generates...

  • RE: Can SSMS be made to display a column wider?

    There is probably an add-on somewhere that you can find for this...if not...you could write your own and reap the $1M rewards for yourself instead of MS. 😀

  • RE: HEAP

    The script you posted should be returning only heaps. If you want to only view user tables you just need to add

    and o.type_desc = 'USER_TABLE'

  • RE: Stored Procedure Repeating Last Line Of Loop

    skempf (7/18/2013)


    Sean Lange (7/18/2013)


    Or even simpler would be to change the loop condition.

    WHILE EXISTS(SELECT * FROM #TempTable)

    You posted in the sql 7, 2000 forum. Are you actually using an old...

  • RE: Error inserting data with T-sql

    Here is how you would do that for the two columns you say are the problem.

    update XDDDepositor

    SET XDDdepositor.WBeneName = Vendor.RemitName,

    XDDDepositor.WBeneAddr = left(Vendor.RemitAddr1, 35),

    XDDDepositor.WBeneAddr2 = left(Vendor.RemitAddr2, 35),

    XDDDepositor.WBeneCity = Vendor.RemitCity,

    XDDDepositor.WBeneState = Vendor.RemitState,

    XDDDepositor.WBeneZipPostal...

Viewing 15 posts - 7,486 through 7,500 (of 15,381 total)