Forum Replies Created

Viewing 12 posts - 16 through 28 (of 28 total)

  • RE: List table space usage and row counts

    Carolyn S. White (1/20/2014)


    Please excuse my ignorance.

    I need to change this how?

    I get the error

    Incorrect syntax near 'o'.

    I tried changing SCHEMA_NAME to the name of the schema for the...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: List table space usage and row counts

    danaanderson (1/18/2014)


    The total space used in version 2 doesn't match any of the space used values in version 1. The values in version 1 seem to be considerably higher...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: List table space usage and row counts

    mikeg13 (1/17/2014)


    As mentioned here there are indexes shown in the results. Would it make sense if I were to group by the "Name" and do a SUM(reserved_page_count * 8)...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: List table space usage and row counts

    I would use AND INDEX_ID <= 1 when index space is not needed.

    Index ID 0 is for heap tables and Index ID 1 is for tables with clustered index.

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: No More MCM

    Can anyone please confirm this new update? Is it true we have 90 days now?

    http://www.theregister.co.uk/2013/09/10/microsoft_says_axed_certs_failed_its_software_biz/

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Generation of Records

    Jeff Moden (9/3/2012)


    Be careful now... That uses a "counting Recursive CTE" and they're notorious for bad performance. Please see the following article for why you shouldn't use "counting...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Generation of Records

    Looks like an interesting design. Here is how I would do it:

    --Create sample table

    create table MonthlyData

    (

    YearMonth nchar(6),

    Value decimal(7)

    )

    insert into MonthlyData

    Values

    ('201207',5000),

    ('201208',4000)

    go

    --Query data

    ;With DaysInMonth as

    (

    select

    YearMonth,

    Value,

    DATEFROMPARTS(cast(SUBSTRING(yearmonth,1,4) as int),cast(SUBSTRING(yearmonth,5,2) as int),1)...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: shrinking the log file

    Agreed with GilaMonster, blindly shrinking a database might not be the best way of reclaiming space.

    For this particular issue. If you are in a rush to get the server...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: To know how many times our client login

    You could try something like this:

    --Create Server Audit:

    USE master;

    GO

    CREATE SERVER AUDIT Login_Audit

    TO FILE (FILEPATH = 'd:\sql_temp\Login_Audit',

    MAXSIZE = 2GB,

    MAX_ROLLOVER_FILES = 10)

    WITH (QUEUE_DELAY = 0, ON_FAILURE = SHUTDOWN);

    CREATE SERVER AUDIT SPECIFICATION Login_Logout_Audit

    FOR...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: How to find missing number ??

    A second though on second scanario: max BID of table, this query looks clean (still need aux_numbers table):

    with FullBID as

    (

    select ID,

    number

    from (select distinct ID from QA_Test) q cross join aux_numbers

    where...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: How to find missing number ??

    nikki_d (8/9/2012)


    I need the result like this..all missing number between '001' to max(bid)

    IDBID

    1232

    1253

    1256

    1283

    If we have '010', '030', Missing items will be '011','012'....'029' .

    Looks like this BID is treated as...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: How to find missing number ??

    The data type char(6) is difficult to tell what is missing in this case.

    What is the logic that determines '003' is missing from 123?

    Let's say we have...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

Viewing 12 posts - 16 through 28 (of 28 total)