Forum Replies Created

Viewing 15 posts - 14,506 through 14,520 (of 14,953 total)

  • RE: Logging with XML

    Jeff:

    I've been thinking about the point of including Insert in the logging trigger.

    What would you do in a circumstance where you find out that some employee has been altering records...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Logging with XML

    Jason Selburg (3/20/2008)


    I say just do a full backup after every UPDATE or DELETE. :w00t:

    WOW!!!! I should have thought of that!!! That would be so much better!!!! :hehe:

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Logging with XML

    Thanks Jeff.

    On the use of Insert in the trigger, that gives me a date the data was first created, and by whom. I don't like having "CreatedDate" and "CreatedBy"...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing

    In Catch statements, when I want to roll back, I usually use:

    While @@trancount > 0

    rollback

    That gets rid of that error.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Calling Stored Proc Simultaneously to Update Different tables.

    Separate ones will end up with better performance, usually. This is due to stored execution plans.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: View and Table

    Without the relevant code, here are some general things to look for:

    A) Is there a "Where" clause in the view that limits the rows it returns?

    B) Are there columns in...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Are temp tables better than table variables

    GilaMonster (3/20/2008)


    GSquared (3/19/2008)


    If you're using transactions to reduce the workload on the server, then yes, short transactions are good. If you're using transactions to control data integrity, sometimes you...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Replace non numeric characters in string

    Matt Miller (3/19/2008)


    ...Knowing the pattern allows you to come up with something better.

    Yeah.

    Of course, as in my prior example, turning "235 dogs, 5 cats", into "2355", is probably not a...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Replace non numeric characters in string

    My next test has a major caveat on it: It won't work if there are two or more separate numbers in a field. For example, "123 dogs, 5 cats",...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Replace non numeric characters in string

    Yeah, the scan count on Numbers is totally insane. I saw the same thing when I originally put it together. Looks like the regex is probably best for...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Replace non numeric characters in string

    Matt Miller (3/19/2008)...but three times faster is Marginally??? The Regex function is the last one one the list.

    Sorry, didn't look far enough down on the list of results you provided....

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Replace non numeric characters in string

    Did you try the stacked CTEs script that I tested last, or just the inline functions?

    Judging by the IO numbers, I'm going to assume you used the inline function that...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: PK / FK design question

    I never would have thought of doing the TypeID in the sub-tables as a calculated column. Tried it out, and you have to persist it to use it that...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Are temp tables better than table variables

    GilaMonster (3/19/2008)


    Shorter transactions means less blocking and less chance of deadlocks. In turn means less work to do. Always a good thing. 😀

    If you're using transactions to reduce the workload...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Common Table Expressions

    A script I posted on another thread in this forum illustrates why I like the layout and readability of CTEs.

    The thread is at http://www.sqlservercentral.com/Forums/Topic470379-338-1.aspx

    The script is:

    ;with

    CTE1 (ID, Position, Val)...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 15 posts - 14,506 through 14,520 (of 14,953 total)