Forum Replies Created

Viewing 15 posts - 11,131 through 11,145 (of 14,953 total)

  • RE: Time spent to build execution plan ?

    The stats thing will show parse and compile time vs execution time. Should give you what you need.

    Most likely, it's not the compile time, it's IO differences or computation...

    - 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: Lock table

    It sounds like you're asking about a "foreign key" constraint. Look those up in Books Online or MSDN, see if that's what you need.

    - 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: Correct way to truncate transaction log

    sayfrend (2/4/2009)


    Another way to truncate logfile without taking backup is,

    DBCC sqlperf ('logspace')

    check for the %used column for your database

    do the following,

    Step1: Change your Recovery Model from Full to Simple...

    - 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: Time spent to build execution plan ?

    If you use "set statistics time on", it will give you the parse and compile time. That's pretty much the time spent reading the query and building an execution...

    - 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: Excessive disk usage

    Oh, there's no guarantee that what I mentioned is the cause. It's just the most common one I've seen.

    It's not necessarily that it will happen a lot when the...

    - 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: SQL Function : Find ‘X’ Business Days in the Future

    jjg, I'm afraid I don't see how having a calendar table and selecting a count from it is going to be more difficult for anyone to understand than the code...

    - 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: Query from Multiple Tables

    Select the data from the primary table, and use derived tables (or CTEs) to get the count from each of the two sub-tables.

    select Cust_ID, count(*) as Sec_Count

    from Sec_Order

    group by Cust_ID

    That's...

    - 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: Mulitple Optional parameter SP

    The performance of the union version depends almost completely on what indexes you have on the table and how well the individual queries hit those. Secondarily, it can get...

    - 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: Jobs executing on specific dates

    The schedule wizard in SQL Server Agent does that kind of thing quite easily in most cases. What problem are you running into with it?

    - 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: Excessive disk usage

    Most likely, tempdb is trying to automatically resize itself because of heavy use. That can cause exactly this kind of behavior. Try setting the default size of tempdb...

    - 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: Need to convert Datetime field

    Have you looked at the DatePart function? Won't that do what you need?

    - 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: How to add all rows into one column!

    I'm not sure where your BOCLEARED column gets it's data. May be in there somewhere, but that table structure is close to unreadable.

    What you can do with a situation...

    - 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: Decreasing table/database space through archiving?

    I'd tend to go with the first one. Doesn't depend on future developers remembering/understanding that it has to insert into two tables.

    - 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: Mulitple Optional parameter SP

    There are a couple of other options for this kind of thing.

    One is to use Union statements.

    select Col1, Col2

    from dbo.MyTable

    where Col1 = @Param1

    Union

    select Col1, Col2

    from dbo.MyTable

    where Col2 = @Param2;

    Another is...

    - 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: Correct way to truncate transaction log

    The correct way to truncate the transaction log is run a log backup.

    - 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 - 11,131 through 11,145 (of 14,953 total)