Forum Replies Created

Viewing 15 posts - 12,991 through 13,005 (of 14,953 total)

  • RE: SQL Best Practices - Universal Checklist

    Simon Facer (7/2/2008)


    GSquared (7/2/2008)


    Don't use table variables unless you absolutely have to. Even then, check your options with someone else.

    Why do you say that? I'm not necessarily an advocate...

    - 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: Moving Files

    Steve Jones - Editor (7/2/2008)


    It's hard to QA the questions sometimes. It requires a huge amount of knowledge of SQL Server and you'd have to spend an inordinate amount of...

    - 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: An MVP From Way Down South

    Congrats. Well deserved. 🙂

    - 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: Bulk Insert and Index Considerations

    John Rowan (7/2/2008)


    I think Jeff is reffering to ALTER TABLE SWITCH ... for partitioned tables

    Yes, this is what I thought also, but the OP had not mentioned using SQL...

    - 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: loosing unicode specification in where clause

    Odd. I don't get that in mine. The plan just gets rid of the other two columns, but is otherwise identical.

    - 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: Non sargable mightmare

    Jeff Moden (7/2/2008)


    Wow...

    I'm with Gus, but let me go one step further. With 5000 procedures (I assume that's like saying "a bazillion"), and all those ugly WHERE clauses, etc,...

    - 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: Dynamic USE clause

    I have to admit, these days, I generally use the GUI to build maintenance plans and schedule them. Easier than writing my own cursors and all 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: Dynamic USE clause

    declare DatabasesCur cursor local fast_forward

    for

    select name

    from sys.databases

    ... set up the cursor, open it, assign the name to a variable

    While @@Fetch_Status = 0

    Begin

    select @sql = 'Use ' + @DBName...

    - 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: (Riga) WAITFOR DELAY. Can I keep querying until data is found?

    I'm talking about something like this:

    eclare @CurrentDt smalldatetime

    declare @CurrentDtStr varchar(8)

    set @CurrentDt = getdate()

    set @CurrentDtStr = CONVERT(VARCHAR,@CurrentDt,112)

    WHILE NOT EXISTS

    (SELECT *

    FROM DB2_PROD_DCDB.DCDB.APP.NIAD_ETL_STATUS

    WHERE CONVERT(VARCHAR,etl_dt,112) = @CurrentDtStr)

    AND datepart(hour, getdate()) < 23

    BEGIN

    WAITFOR DELAY...

    - 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: Dynamic USE clause

    Generally, for that kind of thing, I use a cursor to step through the databases and run a dynamic SQL command on each one. It's the only place I...

    - 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: Bulk Insert and Index Considerations

    Inserting it into a staging table means you don't have to mess around with making the clustered index match the order in the import file. You can use 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: Statement does not reference any tables

    You have a proc/script in your trace that doesn't select/update/insert/delete anything in any 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: loosing unicode specification in where clause

    I think that's just a display issue in the plan. I get the same thing with both versions of your query.

    - 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: Non sargable mightmare

    You have my sympathy. As expected, a procedural programmer with no clue how relational databases work.

    It can be done as a series of joins, which will be faster, 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: Updated Can't figure out how to write the query!!

    Good that it works.

    I was only looking for table definition data if the query didn't work.

    - 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 - 12,991 through 13,005 (of 14,953 total)