Forum Replies Created

Viewing 15 posts - 166 through 180 (of 582 total)

  • RE: Getting old backup files from all drives

    You can use the search functionality in windows explorer. Not sure if you can script this as a Windows command batch, though.

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Join performance question

    Logically speaking, the join order per se is irrelevant to the optimiser, unless you use join hints or the force_order query hint, inwhich case the joins are performed in the...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Determine which row is causing error

    You can't do what describe since a SQL statement is a transactuion which will succeed or fail as a whole.

    Changing the UPDATE to a SELECT would tell you whether the...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Help with Split Proc

    You definitely don't need any sort of split function.

    The code you posted is fine, with the (optional) amendments I suggested above.

    Getting rid of the ISNULLs would definitely help. Locigally speaking,...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Performance on full table scans

    If you do the scan often, and if the table's not too big, you could consider using DBCC PINTABLE on startup to ensure the table stays in memory. Be warned that this could...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: events in trigger

    The events to which DML triggers can respond are: UPDATE, INSERT, DELETE.

    A DML trigger may also cause any of these 'events' to occur, too, if it performs UPDATE, INSERT or DELETE...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Flat tables

    All tables are flat. The question is whether the data in the table is itself flat. If the data isn't really flat but has been flattened to fit in a rectangular...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Help with Split Proc

    Here's how I would change the first SELECT. As mentioned above, it would help if the zip columns could be compared without wrapping them in isnull(). What exactly are the rules...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Help with Split Proc

    You only need to use split if you are forced to accept comma-divided strings by (a)circumstances beyond your control (pre-existing data, legacy system), or (b) the fact that it is impossible to...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Need help with a Conditional Insert or Update statement

    Based on what i can deduce about your requirement, and if this is for single rows only, this would do it:

    pseudocode:

         update table1

        

         if rowcount is 0, insert table1

        ...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: using a date in a where clause without hardcoding it

    If you want to report data for whole calendar months, why not use

    datediff(month, salesDate, getdate())<6

    ?

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: using a date in a where clause without hardcoding it

    Restriction to the current year means that too little data will be returned if the query is run before july.

    Use of datepart(month,...) means that dates outside the last 6-month (i.e. approx...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Table Variable in SP?

    no problem.

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: group by 1/2 hour

    declare

    @querylboundinc datetime, @queryuboundex datetime, @halfhourstart datetime

    declare @halfhour table(halfhourstart datetime)

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Table Variable in SP?

    Typo in your first INSERT statement. TBL_LINK_GROUP_OBJECT_OBJECTID has an S added to make TBL_LINK_GROUP_OBJECTS_OBJECTID.

    The error message and a look at the declarations section confirmed this was the case; a...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

Viewing 15 posts - 166 through 180 (of 582 total)