Forum Replies Created

Viewing 15 posts - 31 through 45 (of 51 total)

  • RE: avg row size

    You could try DBCC SHOWCONTIG(object_id)

    This will give you the number of pages occupied by the table, and the average page density. Knowing that each page is 8Kb, and given the...

  • RE: Concatenating quandary!

    I agree that dynamic SQL has its problems, and is something I would always try to avoid, but the alternative in this situation of 300 CASE clauses seems a bit...

  • RE: Concatenating quandary!

    Bill

    Your original code :

    SELECT @SwitchNo FROM AccessProfile WHERE EmpNo = 3567

    will always return the value 'S1', since this is what the @switchno variable is set to earlier. Incidentally, if you...

  • RE: Disk Performance Audit- important metrics??

    I find the Page Reads/Sec and Page Writes/Sec very useful - they're in the Buffer Manager list.

    They report at the SQL read/write level, rather than on physical disk activity, so...

  • RE: Help on the Group by ...

    Since you are looking for duplicates, you can use the HAVING clause to return only those records which appear more than once. This will save you the trouble of looking...

  • RE: Concatenating quandary!

    Bill

    Using a dynamic SQL string should solve this.

    Because you don't know the column name until you've done the lookup, you can't right a non-dynamic SQL statement. In your code,...

  • RE: Distributed Query question

    I vaguely remember seeing something like this a long time ago. I think I had to have an index on the remote table, possibly a unique one?

  • RE: Hint Syntax

    It's exactly the same. Get a DBA who knows what he's talking about!

  • RE: Select Query

    Try along these lines :

    select

    col1, col2, col3, count(*)

    from

    table1

    group by

    cols1, col2, col3

    having

    count(*) > 1

  • RE: DTS and Triggers

    I agree with Glenda. Cursor-based triggers are a relic and should be replaced wherever possible ie. in 99.99% of cases.

  • RE: Invalid text, ntext, or image pointer value

    Not sure if this is related, but I had a similar problem some time ago. It turned out to have something to do with truncating the table containing the text...

  • RE: Transforming Row into columns

    How about the following. Afraid I haven't been able to test it, but any mistakes should be easy to spot and fix.

    First create the following table and import your file...

  • RE: Basic Trigger - confirm best practice

    This will take care of single-row or multi-row updates :

    create trigger tr_test

    on prod_psz for update

    as if update(prim_stor_zone)

    begin

    update

    b

    set

    b.last_pick = 'Y'

    from

    inserted as a

    join prod_master as b on b.prod_id = a.prod_id

    join deleted as...

  • RE: Insert Into With Exists

    Or, without using exists :

    insert x

    select y.col1, y.col2

    from tabley as y

    left join tablex as x on x.col1 = y.col1 and x.col2 = y.col2

    where x.col1 is null

  • RE: XML - SQLSERVER file creation

    You could put your code into a stored procedure, then use the bcp command to execute the proc and output to a .xml file

    Regards

    Rob

Viewing 15 posts - 31 through 45 (of 51 total)