Forum Replies Created

Viewing 15 posts - 14,761 through 14,775 (of 14,953 total)

  • RE: selecting top N records by type

    One of the articles on the front page of the site today, about running totals and ranking functions, has an answer that might work for you.

    Insert into a temp table,...

    - 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: Table Variables

    I disagree with the point about the transactions.

    Dictionary definition of "valid": "well based or logical" (Compact Oxford English Dictionary, as referenced on http://www.onelook.com).

    Doing a transaction and rollback on a table...

    - 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 Tunning: Help Please....

    JMSM (1/28/2008)


    Sorry, but now i'm feeling completely donkey :crying:

    I cant understand what changes do you want to make, the code that i changed give me errors when executing query. Was...

    - 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: SSC Level List?

    Bryansky (1/29/2008)


    just curious,... why K. Brian Kelley's user level is "Keeper of the Duck"? I didn't see that one in the level list... 😛 :hehe:

    Sounds like a joke on some...

    - 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: Inserting into table with only an identity column

    You're welcome.

    - 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: A sorting issue - Can anyone come up with a better method

    I definitely think dynamic SQL is your best option here.

    If you really, really don't want to do that, and have only a limited number of sort options, then If...Else might...

    - 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 would you code this using t-sql?

    I've tested Except vs Left Outer Join, and end up with nearly the same execution plans. Only difference is the Left Outer Join had a "Filter" in it, and...

    - 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: Nested Commit while rollback transaction

    The only solution I can easily think of is write to a log file instead of a log table. Rollback won't "unwrite" the log file.

    - 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: Delete files olde than 48 hours based on filename, not date modified.

    If you're doing this in T-SQL, the only way I know of to do this is use xp_CmdShell to insert a list of the file names into a temp table,...

    - 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: A sorting issue - Can anyone come up with a better method

    Dynamic SQL is usually the easiest solution for this, unless you have a very limited set of options. Using a CASE statement in your Order By clause works, but...

    - 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: Inserting into table with only an identity column

    insert into Actor

    default values

    If you want more than one at at time:

    set nocount on

    insert into Actor

    default values

    go 100

    Will insert 100 rows. Change the 100 to whatever number you want.

    - 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: SSC Level List?

    No purpose I know of. Just a fun/ego thing.

    - 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 Tunning: Help Please....

    Instead of Not In, I recommend a left outer join.

    "AND tb4.ID NOT IN (SELECT DISTINCT tb7.ID

    FROM Tbl_Tmp_Trace tb7

    WHERE tb7.Estadoid = 3094610094

    AND tb7.Tipo = N'Chamadas')"

    Replaced with (in the From clause):

    "left outer...

    - 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: Automatically join tables

    select *

    from Table1

    inner join Table2

    on Table1.Column1 = Table2.Column2

    Put your table names and column names into this.

    - 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: Group By Issue

    I'm looking at the query, and it looks like it could be simplified. Can you provide the table structure and a couple of rows of sample data, for 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

Viewing 15 posts - 14,761 through 14,775 (of 14,953 total)