Forum Replies Created

Viewing 15 posts - 14,926 through 14,940 (of 14,952 total)

  • RE: help on modifying a trigger

    Actually, you probably want "isnull(I.DeptID, D.DeptID)", and the same for the other field, so that if it's an insert or update, it grabs it from Inserted, and if it's a...

  • RE: Selecting Columns Multiple Times within a stored procedure

    It seems to me that what you need is a single select statement, and put the complexity in the where statement. You'll end up with a complex execution plan,...

  • RE: Difference in execution time for the queries

    I'd have to see the actual databases involved to be sure, but most likely the reason for the slow execution is that the generic code requires the database to use...

  • RE: Query

    It looks to me like your MaterialInventory table should be a view, not a table. A union query between MaterialIn and MaterialOut might be better than a table. ...

  • RE: truncating data older than 30 days

    delete from table

    where c2 < dateadd(day, -30, getdate())

    That should do what you need. Set it up to run in Server Agent each day and you should be good to...

  • RE: What Would You Do?

    Like others, I'd make sure I had the request in writing, and that it followed standard policy. I'd also consider the person making the request. If happy with...

  • RE: Moving server to a new domain

    Make sure the server and database security settings (including login names) are updated as well. If they contain the domain name, you'll need to update them.

    The only other thing...

  • RE: Free space on the disks and database

    I don't think the amount of space available actually affects the database performance. I could be wrong, but I've never run into any data indicating that would happen, and...

  • RE: how to restrict number of rows returned in a query

    If you want the first X rows, use "select top X ..." in your select statement.

    If you want to return a range of rows, you'll need to have input parameters...

  • RE: Change Initial Size of Transaction Log

    I haven't seen the initial size of a log change before, so I'm not sure what would cause that.

    If the actual size changed, then shrinking the database (or the log...

  • RE: Return a single row per

    select achievetitle, max(periodenddate)

    Use that instead of "distinct".

  • RE: Select where not null

    As an additional note on my reply, you'll need to add a "distinct" operator to the select statements if an ID can have more than one entry per day, unless...

  • RE: Select where not null

    select id, coalesce(bbb, mob) as val

    from table

    where coalesce(bbb, mob) is not null

    and date =

    (select max(date)

    from table t2

    where id = table.id

    and coalesce(bbb, mob) is not null)

    Will get you a set of...

  • RE: Instead Of Triggers

    Instead of an "instead of" trigger, you should use a "for" or "after" trigger (they're the same thing).

    Another option is, if the inserts into the main table are handled by...

  • RE: Stop execution of SQL script

    Will simply using "return" (stops execution, doesn't raise an error) work?

Viewing 15 posts - 14,926 through 14,940 (of 14,952 total)