Forum Replies Created

Viewing 15 posts - 466 through 480 (of 607 total)

  • RE: Execute statement in CATCH block

    TRY CATCH is used for error handling while IF is used for conditional logic.

    IF (Some Condition)

    BEGIN

    -- run these statements if your condition is true

    END

    ELSE BEGIN

    -- run these statements if your...

  • RE: Error backup database: nonrecoverable I/O error occurred on file ...

    Beginner_2008 (1/21/2013)


    Sql Maintainance plan which takes Full backups of 6 databases is failing with the following error:

    Error Number: -1073548784

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

    Executing the query "BACKUP DATABASE [DatabaseName] TO DISK = N'\\\\BackupLocation" failed...

  • RE: BIT data type

    Nice easy question. The question is all about whether setting a bit datatype to 'TRUE' evaluates to 1 or NULL. Easy to guess as the output would either be all...

  • RE: Stored Proc and performance

    I had to investigate a similar problem and discovered the cause was a junior DBA running the following piece of code at 11PM and then going home.

    BEGIN TRAN;

    UPDATE MyTable SET...

  • RE: Delete rows from the table using cursor

    tcomponent (1/17/2013)


    Hi, Nandy

    Perhaps you should modify your cursor query into this.

    declare test_cursor cursor for

    select * from test WITH(NOLOCK)

    to be able to make alteration to the table

    :sick:

  • RE: Find out the SQL Server restart date/time with TSQL

    fdassis (12/23/2012)


    If your SQL Server is 2005 or later, you can use:

    SELECT 'Statistics since: ' + CAST(sqlserver_start_time AS VARCHAR) FROM sys.dm_os_sys_info

    It's more safe and reliable.

    Not so much a case of...

  • RE: Reindex tables and update statistics

    DVSQL (1/18/2013)


    I see that there is normal stuff such as shrinking the database

    Shrinking the database is not normal maintenance stuff.

  • RE: Declare error message before CATCH?

    SQLKnowItAll (1/18/2013)


    ..., but I don't know how to test.

    Did someone steal your login credentials?

    CREATE PROCEDURE TestErr

    AS

    DECLARE @Err NVARCHAR(255);

    BEGIN TRY

    SELECT 1 / 0

    END TRY

    BEGIN CATCH

    SET @Err = 'Errrr';

    RAISERROR(@Err, 16, -1);

    END...

  • RE: can dml triggers statements get logged

    USE [AdventureWorks];

    GO

    CREATE TABLE TestTrigger (ID INT)

    GO

    CREATE TABLE TestTriggerAudit (ID INT)

    GO

    CREATE TRIGGER trTestTrigger ON TestTrigger

    FOR INSERT

    AS

    INSERT INTO TestTriggerAudit SELECT * FROM inserted;

    GO

    INSERT INTO TestTrigger VALUES (1);

    GO

    CHECKPOINT;

    INSERT INTO TestTrigger VALUES (22);

    DBCC LOG('AdventureWorks',...

  • RE: User defened Datatypes Default values.

    Binding a default value to a data type will be removed from SQL because it is a bad idea.

    This feature will be removed in a future version of Microsoft SQL...

  • RE: A .NET Framework error in SQL server 2008 R2

    http://support.microsoft.com/kb/949080

    Workaround 1

    To work around scenario 1 in the "Symptoms" section, you must manually update the .NET Framework assemblies in SQL Server. To do this, use the ALTER ASSEMBLY statement to...

  • RE: EOMONTH - 1

    Stewart "Arturius" Campbell (1/21/2013)


    Good qurstion, Ron,

    Thanks

    Sean Pearce (1/21/2013)


    This question is better suited for http://www.GeographyCentral.com.

    How does knowing the last day of February in 2016 have anything to do with...

  • RE: EOMONTH - 1

    This question is better suited for http://www.GeographyCentral.com.

    How does knowing the last day of February in 2016 have anything to do with SQL Server? I had to check a...

  • RE: Calculations in SSRS

    Count Function (Report Builder 3.0 and SSRS)

    Returns a count of non-null values specified by the expression, evaluated in the context of the given scope.

    scope

    (String) The name of a...

  • RE: Proactive sql dba activities for Production Databases

    SQLRNNR (1/16/2013)


    Index Maintenance

    Backups

    Integrity Checks

    Deadlock monitoring

    Don't forget to restore those backups.

Viewing 15 posts - 466 through 480 (of 607 total)