Forum Replies Created

Viewing 15 posts - 3,136 through 3,150 (of 6,036 total)

  • RE: Undocumented DBCC command for cache usage

    You're probably looking for the data in table master.dbo.syscacheobjects

  • RE: Create table with number of columns in a parameter

    Read topic "Cross-Tab Reports" in BOL

  • RE: Do I need a CURSOR?

    J, your example does not require cursor either.

    Let's assume you have a table holding all your discounts:

    [Code]

    CREATE TABLE dbo.Temp_Discount (

    OrderID int NOT NULL PRIMARY KEY,

    Amount FLOAT NOT NULL

    )

    INSERT INTO dbo.Temp_Discount...

  • RE: Set-Based Solution Possible?

    And Mike, don't trust much those "Query cost" numbers in QA.

    Every time verify it with simple but 100% reliable check:

    [Code]

    DECLARE @Time datetime

    SET @Time = GETDATE()

    Set of queries No.1 here

    PRINT CONVERT(varchar(20),...

  • RE: Set-Based Solution Possible?

    Peter, my solution has 3 internal iterations: one per year.

    It does not iterate neither over staff members, nor over reviews.

    It builds 3 temp tables for each year and joins them...

  • RE: Set-Based Solution Possible?

    Mike Nuessler (1/31/2008)With the ridiculously small amount of data this is being run on either would work for my purposes.

    (for that matter so does my original While..Continue temp table...

  • RE: Set-Based Solution Possible?

    Mike Nuessler (1/31/2008)I see the table spool as well.

    Did you copy HASH JOIN?

  • RE: Set-Based Solution Possible?

    Peter Larsson (1/31/2008)


    That TABLE SPOOL looks nasty to me. And 10 clustered index scans?

    I did not have TABLE SPOOL in my test runs.

    Are you sure you copied my code as...

  • RE: How to solve this?

    [Code]...

    left join transcriptgpa as t on

    p.people_code_id=t.people_code_id

    and t.record_type='O'

    and t.academic_term='Fall'

    and t.academic_year='2007'

    where a.academic_term='Spring'

    and a.academic_year='2008'

    and a.enroll_separation ='enrl'

    and a.academic_session='main'

    and (a.program ='ft' or a.program='pt')

    [/Code]

  • RE: SQL Server Agent Job Creation Through .NET

    Start Profiler.

    Open EM.

    Go to Maintenance -> SQL Server Agent -> Jobs.

    Create a new job similarto what you wanr to create.

    Go back to Profiler and find all scripts EM used...

  • RE: Trigger causing performance issues

    I would start not from performance but from incorrect logic of the trigger.

    If 2 or more lines are inserted than ALL rows in the table with serial_fk=@serial_fk and test_fk=@Test_fk and...

  • RE: How to solve this?

    LEFT join transcriptgpa

    And move

    t.record_type='O'

    and t.academic_term='Fall'

    and t.academic_year='2007'

    from "WHERE" to "ON"

  • RE: Set-Based Solution Possible?

    You welcome.

    This UPDATE has 2 other imprescriptible parts outside of the sattement itself:

    [Code]ORDER BY StaffName, ReviewDate[/Code]

    which inserts rows in the table in specific order and

    [Code]ID INT IDENTITY(1,1) NOT NULL...

  • RE: Avoid repetitive code with ISNULL

    WHERE (col3 = @Param1 OR @Param1 IS NULL)

  • RE: Set-Based Solution Possible?

    This returns exactly what you need.

    This script uses table Tally which contains sequential integer numbers.

    You may create it yourself or search this forum for one of scripts creating it.

    [Code]

    Create Table...

Viewing 15 posts - 3,136 through 3,150 (of 6,036 total)