• @SQLFRNDZ (12/20/2012)


    This is what I got so far and I need help with looping script to add files to number of times based on condition cpu_count.

    Here is the script I'm able to write so far

    DEclare @value1 int

    DEclare @value2 int

    DECLARE @OUTPUT Varchar(100)

    select @value1=COUNT(*)-1 from sys.sysfiles

    SELECT @value2=cpu_count FROM sys.dm_os_sys_info

    select @OUTPUT =

    Case when @value1 = @value2 THEN 'GoodToGo'

    ELSE "-- Needs a Script Here --"

    END

    SELECT @OUTPUT [TEMPDB FILES]

    GO

    Ok, from there - what would you pseudo-code to achieve your goal?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events