Forum Replies Created

Viewing 15 posts - 241 through 255 (of 275 total)

  • RE: Fuzzy logic matching routine problem

    I think you're going the wrong direction....i think an easier solution would be to start at the other end....test for the presence of 1 record "given all conditions applied"....and if...

  • RE: Nested Cursor

    Without delving into the problem direct....I'd seriously advise you to ditch the cursors.  The performance gains from doing SET-based operations is massive.  99% of SQL can be written without cursors. ...

  • RE: Rounding Down query

    Just remember...that consumer laws in most jurisdictions would expect any rounding to be in favour of the customer.  A discount of 15% needs in practice to mean 15% or better....not...

  • RE: a.company_name like Nabc% vs a.company_name like abc%

    other than the main one of a doubling of the storage capacity for companyname....and the consequent reduction in total capacity for storage on a row....there is v.little operational difference between the use...

  • RE: SQL Code Help...Important!

    talk about covering the bases!!!

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=35674

     

    and the main advice of "supply the real DDL, sample input and expected results".....applies as the best advice everywhere!!!

  • RE: Generating Random Numbers?

    it's nothing to do with the speed of SQL...or the seed number.

     

    RAND() is evaluated once per result-set

    NEWID() is evaulated once per row.

  • RE: I would like to know what is the relative cost means in Execution plan

    if you have 2 queries in a batch/sp....and the costs are estimated to be 66% and 34%....then you can (reasonably) infer that the 1st query will take/cost approx twice the...

  • RE: CommitCount Command

    no you just call the SP with the while loop once......

    the while construct will keep updating batches of 10000 records until there are no more batches left....

     

    and then it will...

  • RE: CommitCount Command

    I was aware my suggestion wasn't perfect....I was just trying to give a flavour of a solution!

    ...too busy (careless) to get it right....

    any way that would be too easy for...

  • RE: CommitCount Command

    the best/closest one can do is to simulate this using a WHILE Loop

     

    set rowcount 10000

    WHILE @@ROWCOUNT > 0

    begin

    update x

    set y = z

    where a = b

    end

    set rowcount 0

  • RE: Performance problems, sleeping and blocking processes

    Issuing begintrans commands outside of T-SQL/SP's is not a good idea....as you've found out....keeping it in SQL, allows the SQL engine to figure out/realise that the connection has been killed...

  • RE: Need Help with this massive report

    Also...

    "A.SO_ID NOT IN (Select distinct(H.SO_ID) from PS_HH_NARDA_HIST H

                    where (H.HH_NARDA_STATUS in ('SB', 'RJ', 'RS')) and H.HH_NARDA_NUM <> ' ' and H.DTTM_STAMP < '2004-05-03') AND"

     

    The DISTINCT portion of this is unnecessary...

  • RE: format ssn

    That'll prevent future incorrect data.....Is the questioner not asking how to clean existing data?

    select replace(replace(ssncol,'-',''),' ','') from ssntable

    once it is cleaned....then it's just a case of parsing the result above into...

  • RE: Can one use a Cursor in an UDF

    couple of things......

    1.  there's next to no difference between your UDF's (udf_SysComp, udf_TestSets, etc)...other than the hard-coded .ItemTypeUseID = xx statements....you could/should make them more generic....to minimise the amount of code...

  • RE: How to design for multiple local dbs to nightly combine into one national

    1. analysis server http://www.microsoft.com/sql/evaluation/bi/bianalysis.asp

    2.  you could use 'own-codes' instead of GUID's.... ie prefix all data with the ZIP-CODE of the relevant city...

    so you would have 90210-PRxx and 90111-PRxx and 90212-PRxx for...

Viewing 15 posts - 241 through 255 (of 275 total)