Forum Replies Created

Viewing 15 posts - 316 through 330 (of 388 total)

  • RE: Group by clause - question

    SELECTCEA.Company, CEA.dateinserted, CEA.employees

    FROM( SELECTCompany, dateinserted, employees,

    RANK() OVER ( PARTITION BY company ORDER BY employees DESC ) AS Ranking

    FROMCompanyEmployeeArchive ) window

    INNER JOIN CompanyEmployeeArchive AS CEA ON window.company = CEA.company

    WHEREwindow.employees...

  • RE: Statistics Udate question

    This will give you operational info behind the stats where there have modifications. You will have to interpret this info, cos 10000 modifications is not worth an update statistics if...

  • RE: Unique Index

    When using Filtered indexes, just be careful of Procs where Quoted_Identifier is OFF for the update inserts.

    You can find this by selecting * from sql_modules where quoted_identifier is off, to...

  • RE: Design Question to minimize blocking

    compare the 2 updates below.

    From looking at the plan of the update on the windowed result set, it looks like there is one access to the table, whereas the "before"...

  • RE: SSMS Scripting a FK

    Sorry, edited my post.

    I think it is for information because when I script a disabled constraint then the follow up alter table has NOCHECK.

    Maybe someone who coded the scripting feature...

  • RE: SSMS Scripting a FK

    The first statement will create the FK.

    Maybe they include second for information to let the reader know it is enabled?

    If you do

    ALTER TABLE [dbo].[MyTable] WITH CHECK ADD ...

  • RE: Is a non clustered index getting always scanned useful?

    Just to add my 2 pence, did you know that you can query the dmv's and retrieve all the queries where the plans include operations on the index. So you...

  • RE: Performance Tuning Questions

    Query cost is a baseline, where a SQL Server lab in Redmond was used to baseline the cost thousands of years ago.

    What I do is use the numbers in this...

  • RE: SQL SERVER index rebuild job fails periodically at update stats.

    Check to make sure that you are not rebuilding indexes and updating stats within the same time period with 2 separate jobs.

    May be that you intended to do update stats...

  • RE: Query returns 13864 on a varchar columns

    Script out your table.

    Maybe the table name exists twice, one in its own schema.

    Maybe you are querying a view of the table.

    So, script out the table with schema names, script...

  • RE: Drop Unused indexes?

    19 indexes? Epic!

    In addition to TheSqlGuru's great advice,

    before you drop indexes, take note that there are some heroes who do silly things like drop and create indexes in SSIS packages...

  • RE: Try Convert causes change in transaction state

    try using IsDate() and then return error codes if not.

  • RE: different estimated rows on same index operation?

    Take into account that table variable stats is hard coded to be 1 row where temp table has actual row count.

    This would be something to consider as Table variable might...

  • RE: trying to rewrite a "NOT EXISTS" query to use "JOIN" 's

    It would be cool if you could submit your results of set statistics io on and set statistics time on for the not exist and also the left join where...

  • RE: Generating depenedencies when using Dynamic SQL (SQL Server versions 2008 and above)

    Will this work for you?

    declare @Proc sysname = 'uspGetEmployeeManagers'

    ;WITH stored_procedures AS (

    SELECT

    o.name AS proc_name, oo.name AS table_name,

    ROW_NUMBER() OVER(partition by o.name,oo.name ORDER BY o.name,oo.name) AS row

    FROM sysdepends d

    INNER JOIN...

Viewing 15 posts - 316 through 330 (of 388 total)