Forum Replies Created

Viewing 12 posts - 136 through 147 (of 147 total)

  • RE: How to improve insert performance

    Check for an insert trigger.

    I've seen ridiculously inefficient triggers resulting in high CPU and IO.

  • RE: Delete File Without xp_cmdshell

    There is a sneaky way of doing this described here:

    xp_cmdshell alternative

  • RE: Table to Lock Data

    The common approach in a client/server, or web based application is to use optimistic locking.

    This article explains it well:

    http://www.mssqltips.com/tip.asp?tip=1501

  • RE: how to improve the following query

    To simplify the request, with this data:

    create table a (id int identity(1, 10) primary key clustered, dummy_col uniqueidentifier)

    create table b (id int identity(1, 1) primary key clustered, dummy_col uniqueidentifier)

    insert a...

  • RE: query to find the tables in a db and their row count

    rbarryyoung beat me to it, but I'll post this anyway. It does what you want, although not as useful as his view.

    set nocount on

    create table #temp(namet varchar(255),countf varchar(255))

    exec sp_MSforeachtable...

  • RE: Auto update table with correlated subquery

    I said it might be more efficient.

    You can never tell for sure without testing. Comparative performance depends on data volumes, statistics, indexes, etc.

  • RE: Why so many reads?

    What percentage of these rows actually need to be rtrimmed?

    I'm just wondering if adding

    WHERE MRN <> RTRIM(MRN)

    would make any difference.

    It will still perform the initial scan, but if the index...

  • RE: Auto update table with correlated subquery

    How about using a derived table

    Update s

    Set s.load_end_dts = GetDate()

    From dbo.s_table as s

    Join (Select UserId, Min(Load_Dts) as MinDts From dbo.s_table Group By UserId) as z

    On s.UserId = z.UserId And s.Load_Dts...

  • RE: Avoid Dynamic Query

    charshman (8/20/2008)


    One way to handle this type of situation is in a stored procedure, have a parameter for each column that could have a filter on it, with a default...

  • RE: Avoid Dynamic Query

    What you are suggesting is very dangerous.

    Who will populate your search table? What checks will you have in place to prevent something inefficient from being generated?

    If you end up with

    WHERE...

  • RE: Cross Tabs and Pivots, Part 1 – Converting Rows to Columns

    In response to sunjiulu's query, you don't need a cross-tab.

    A bit of magic with XML is all that's required:

    SELECT d1.tablename,

    (SELECT STUFF(sep, LEN(sep), 1, '')

    FROM (

    SELECT columnname + ',' AS [data()]

    FROM...

  • RE: schema binding

    I presume you are reading about functions.

    The WITH SCHEMABINDING clause prevents the object(s) referenced by the function from being altered or dropped.

    This can also be used with the CREATE VIEW...

Viewing 12 posts - 136 through 147 (of 147 total)