Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)

  • RE: Query Against Temp Table not Working (includes Max Function)

    SELECT PV_Readmissions.admission, PV_Readmissions.disdate, PV_Readmissions.crn, PV_Readmissions.EXPR1, PV_Readmissions.admdate,

    PV_Readmissions.admtime, PV_Readmissions.EXPR2, PV_Readmissions.admsource, PV_Readmissions.admtype, PV_Readmissions.disepisode,

    PV_Readmissions.readmit

    FROM PV_Readmissions LEFT OUTER JOIN

    medrec ON PV_Readmissions.crn = medrec.crn LEFT OUTER JOIN

    adm_tfer ON PV_Readmissions.crn = adm_tfer.crn AND PV_Readmissions.admission =...

  • RE: Column of table

    Right. 😀

  • RE: Column of table

    Answer is big NO.

    Note: Why don't you read books before posting theoretical questions like this. The forum is for solving problems/for advanced topics and not for answering basic questions.

  • RE: I want optimize the store procedure-It's take more time to excecute by use while loop

    If it's not urgent then I would suggest try it on your own. You have the code and the logic as well

    If you don't understant part of the code then...

  • RE: Store Procedure Issue

    why don't you try

    INSERT INTO TableName SELECT Column List FROM TableName

    and get rid of the cursor

    may be you need to apply CASE for if conditions in the above select statement

  • RE: Store Procedure Issue

    Probably the problem is with the application. Check inside the application. As far as I know temp table will drop automatically when the session closes

  • RE: To make a audit vertically in TSQL

    Try something like this:

    SELECT

    c1,

    CASE

    WHEN T1.C2 <> T2.C2 THEN 'C2'

    WHEN T1.C3 <> T2.C3 THEN 'C3'

    WHEN T1.C4 <> T2.C4 THEN 'C4'

    WHEN T1.C5 <> T2.C5 THEN 'C5'

    End Field_Name,

    CASE

    WHEN T1.C2 <> T2.C2 THEN...

  • RE: simple SELECT query takes ten seconds to return 5000 rows - can I optimize?

    SELECT X.*

    FROM X

    WHERE HistoryId In (

    SELECT MAX(HistoryID)

    FROM X

    GROUP BY ObjID)

    I don't know but may be it works. Did you try...

  • RE: Help with query

    probably yes. something like soundex(t1.fname)=soundex(t2.fname)

  • RE: Help with query

    Yes there are functions in sql which does this. i don't remember the exact name but they are like soundex and similar try soundex

  • RE: SQL TRIGGER

    why are you using trigger? where is your sql insert code. why don't you put the update code after the insert code? if possible then do this and get rid...

  • RE: Archiving tables

    one option is to archive all the rows which have been inserted till yesterday...

  • RE: Replacing Triggers

    1. If your trigger code is performing DML which can be put into stored procedure then use stored procedure. Ex: if you are inserting a row in record using inline...

  • RE: LEFT OUTER JOIN IN TEMPORARY TABLE

    Well the result is right. Just give a closure look. Look at the first row in the result 2, 1537, null. 2, 1537 is from otpresent. There is no corresponding...

  • RE: UNION and MIN and total values

    😀

Viewing 15 posts - 1 through 15 (of 16 total)