Forum Replies Created

Viewing 15 posts - 48,106 through 48,120 (of 49,571 total)

  • RE: Trigger

    Rob Reid (12/7/2007)


    SELECT

    @TrigType= 'I', --for insert U=update

    @RecordID= RecordID,

    @ViewStatus = ViewStatus

    FROM

    INSERTED

    That's not a good construct in a trigger. What happens when an insert affects more than one row?

    Triggers fire once for...

  • RE: Dead lock

    Run profiler against the SQL server that AS is connecting to. The deadlock's coming from the database, not AS.

    You can alse try switching on traceflag 1204 (on SQL Server) so...

  • RE: Subqueries, Temporary tables and CTEs

    Derek Dongray (12/7/2007)


    Can anyone explain why the CTE works so differently from the temporary table and why SQL server doesn't optimise both the same way?

    A CTE is essentially a...

  • RE: Hidden RBAR: Triangular Joins

    Ramesh (12/7/2007)


    Christian Buettner (12/7/2007)


    Hi Ramesh,

    what makes you sure that the order of the rows is guaranteed in your example?

    Index

    An index on a column does not guarantee that data will be...

  • RE: T-sql code to retain a max of 15 history rows per server

    Assuming that HistoryID is the primary key....

    DELETE FROM HistoryTable

    WHERE HistoryID NOT IN

    (SELECT Top 15 HistoryID FROM HistoryTable

    ORDER BY UpdTimestamp DESC)

  • RE: Known problems with bit-columns?

    Grant Fritchey (12/7/2007)


    The main reason I've received for not using bit fields is because they don't allow null values.

    They accept nulls just fine (unless defined not null). At least...

  • RE: ***When I try to delete all the records the database table an errorbox appers stating TIMEDOUT.***

    use Query analyser to run the delete.

    Deletes can run for a long time, and the query time is probably exceeding the timeout value for the application that you're using. Query...

  • RE: data type

    Note that that's for varchar(max) or nvarchar(max) The largest number that you can use to define a varchar is 8000 (as in varchar(8000)) and 4000 for nvarchar (nvarchar(4000))

  • RE: What to do to improve a table?

    Ramesh (12/7/2007)


    Create a non-clustered index on columns server, customer and add audit_output as include column.

    audit_output is ntext, and as such can't be used as an include column.

    Even if changed...

  • RE: What to do to improve a table?

    As first suggestions... These may not be completely optimal, as I don't hav your queries, I don't know the data distribution and I can't see the exec plans

    Clustered index on...

  • RE: Waht is these _WA objects in sysindexes

    They are column statistics created by SQL when it filters or joins on a column that doesn't have an index or existing stats.

    They're there to tell the optimiser aproximatly...

  • RE: Hidden RBAR: Triangular Joins

    TheSQLGuru (12/6/2007)


    I must say that I am very happy that people can do things like the triangular join - and sad that Jeff may make less people do it. ...

  • RE: Need Help With a Deadlock Issue

    That's not a very nice trigger.

    Frank Lain (12/6/2007)


    select @key = cashlist_key from INSERTED

    What happens if more than one row is inserted in a batch?

  • RE: Free T-SQL Query Tool

    SQL Server Express Management Studio?

  • RE: Probably simple but maybe not? need help with a select statment

    Ramesh (12/6/2007)


    Jai,

    I appreciate your feedback but, dynamic SQL is not always the best choice, but the last choice if all else fails!!!!!

    Performance-wise, with this kind or requirement it sometimes...

Viewing 15 posts - 48,106 through 48,120 (of 49,571 total)