Forum Replies Created

Viewing 15 posts - 91 through 105 (of 254 total)

  • RE: SQL Server System Report

    My pleasure. If there's anything else just let me know. 🙂

  • RE: SQL Server System Report

    Sorry, I did a post and then an edit. Does the version you are trying have "AND SJH.run_status = 0" in it?

  • RE: SQL Server System Report

    Try this:

    ----------------------------

    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

    SET NOCOUNT ON

    IF OBJECT_ID (N'dbo.usp_FailedSQLAgentJobs_Alert', N'P') IS NULL

    BEGIN

    EXECUTE ('CREATE PROCEDURE dbo.usp_FailedSQLAgentJobs_Alert AS SELECT 1 AS shell')

    END

    GO

    -----------------------------------------------------------------------------------------------------------------------------

    -- Main Query: Create Procedure

    -----------------------------------------------------------------------------------------------------------------------------

    ALTER PROCEDURE dbo.usp_FailedSQLAgentJobs_Alert

    @Output_Mode AS CHAR...

  • RE: SQL Server System Report

    Have you tried moving the "Skip_Agent_Jobs:" to the bottom of the script, right before the final "GO"? Or even just setting up each job to notify you individually if /...

  • RE: Count all records the tables

    pperez 40143 (4/24/2014)


    How many tables are a lot? Just to know.Well I guess it also depends on the lenghts of the columns.

    A workaround would be to output the result...

  • RE: Count all records the tables

    pperez 40143 (4/24/2014)


    EXEC sp_msforeachtable 'sp_spaceused "?"'

    With this you get the rowcount per table plus the space reserved/used/unused. It works in all versions.

    Great unless you have a lot of tables. :(...

  • RE: Count all records the tables

    Pix1985 (4/24/2014)


    What are the benefits of this script over something simple like the below?

    [Code="SQL"]

    SELECT st.Name, sp.Rows

    from sys.tables st

    JOIN sys.partitions sp

    on st.object_id = sp.object_id

    Order by st.Name

    [/Code]

    I've ran them both, i'm getting...

  • RE: Count all records the tables

    This is the fastest and most accurate way that I know of doing this:

    SELECT

    SCHEMA_NAME (T.[schema_id]) AS [schema_name]

    ,T.name AS table_name

    ,sqR.total_rows

    FROM

    sys.tables T

    INNER JOIN

    (

    SELECT

    P.[object_id]

    ,SUM (P.[rows]) AS total_rows

    FROM

    sys.partitions P

    WHERE

    P.index_id IN (0, 1)

    GROUP...

  • RE: Index Breakdown

    hfreeman (4/11/2014)


    The code faulters with this error

    Lookup Error - SQL Server Database Error: Divide by zero error encountered on line 154

    the start of the select query

    -----------------------------------------------------------------------------------------------------------------------------

    --Main Query: Final Display /...

  • RE: Index Breakdown

    ScottPletcher (4/11/2014)


    Excellent! The other thing you need to include in your analysis is the "missing index" info from SQL (DMVs sys.dm_db_missing_index*).

    I agree, but I found it a bit "heavy"...

  • RE: Global Configuration Settings

    Same here. Better safe than sorry.

  • RE: Unused Input Parameters

    No harm, just cleaner code.

  • RE: Progress Bar Simulation on SQL Server

    At the very least it's just a cool concept. 🙂

  • RE: Stairway to T-SQL Part 2: Beyond T-SQL Basics: Level 1: The TOP Clause

    Well done. Great article!

  • RE: SQL Server System Report

    Great to hear. 🙂

Viewing 15 posts - 91 through 105 (of 254 total)