Forum Replies Created

Viewing 15 posts - 1,126 through 1,140 (of 5,103 total)

  • RE: Help with SQL Query

    The second query is a cross-join with two Where statements. That's standard.

    I beg to differ. A comma is NOT an ANSI join, CROSS JOIN would be!

  • RE: Archive Process - Need opinion

    You could also see if your tables could benefit from table partitioning.

  • RE: Optimizing an index for select count(distinct)

    stephane3d (6/18/2008)


    Hum... I think I miss a thing here.

    If I have an indexed view, should I get rid of any indexes on the table? Is the performance cost on the...

  • RE: Help with SQL Query

    Joe Celko (6/18/2008)


    You used singular table names but they don't seem to have only one row. You used reserved words for column names or vague useless names like "organization"...

  • RE: Optimizing an index for select count(distinct)

    stephane3d (6/18/2008)


    No, I didn't consider that actually.

    Can an indexed view be faster than an index on the table itself?

    Thanks

    Stephane

    If it has "pre"-aggregated data, you bet!!!

  • RE: Help with SQL Query

    Try:

    SELECT [Year], [Month] ,[Org1],[Org2],[Org3]

    FROM

    (SELECT U.Organization, R.Users , [Year], [Month]

    FROM #Report R INNER JOIN #USERS U ON U.UserAlias = R.UserAlias) AS src

    PIVOT ( SUM (Users)...

  • RE: Comparing Image Field

    cast(a.im as varbinary(max)) = cast(b.im as varbinary(max))

    Is not that bad, right ?

  • RE: change owner or multiple jobs

    declare @jb_name nvarchar(128)

    declare c cursor fast_forward for

    select name from msdb.dbo.sysjobs

    open c

    fetch next from c into @jb_name

    while @@fetch_status = 0

    begin

    print 'changing : ' + @jb_name...

  • RE: Duplicate identification

    indraprakash (6/18/2008)


    Is there any thing like rowid in Oracle?

    How to delete duplicate records from SQL sever without using template table or create an extra column.

    Can you post DDL for...

  • RE: Allow_Page_Locks

    In addition to Gila's post you should check for missing indexes that may help reduce the number of scans.

  • RE: Optimizing an index for select count(distinct)

    stephane3d (6/17/2008)


    Good idea.

    I tried and it says ยซ Estimated Improvement 0% ยป... That's a dead end I think! ๐Ÿ˜€

    Did you try the "indexed view" idea ?

  • RE: Strange query behavior (SQL Native Client could be the culprit)....

    What version of the ODBC Driver are you using ?

  • RE: Comparing Image Field

    drodriguez (6/17/2008)


    How about using BINARY_CHECKSUM?

    FROM BOL:

    ... BINARY_CHECKSUM ignores columns of noncomparable data types in its computation. Noncomparable data types include text, ntext, image, cursor, xml, and noncomparable common language runtime...

  • RE: Comparing Image Field

    Or simply CAST to varbinary(max) and compare

    declare @a table( id int, im image )

    declare @b-2 table ( id int, im image )

    insert into @a (id, im) values (...

  • RE: Clustered Index - sys.dm_db_index_usage_stats

    Hopefully your developers are not using select *... If that is not the case you can't do much ๐Ÿ˜‰

Viewing 15 posts - 1,126 through 1,140 (of 5,103 total)