Forum Replies Created

Viewing 15 posts - 31 through 45 (of 77 total)

  • RE: How can we standardize SQL Server Data Deployments?

    GSquared (12/17/2009)


    I agree, but I add an additional check.

    if object_id(N'[ProcName]','P') is null and object_id(N'[ProcName]') is not null

    raiserror('Object name in use', 21, 1) with log;

    That aborts the...

  • RE: Try Catch problem

    Additionally it would probably be a good idea to do a check before trying the rollback. It is a good practice to ensure the transaction can be rolled back.

    Possible...

  • RE: How can we standardize SQL Server Data Deployments?

    Using a DROP/CREATE with an IF EXISTS clause instead of an ALTER statement for deploying SQL Server objects like stored procedures is one example of a standard that can be...

  • RE: Synchronize a stored procedure between two servers

    Your declared sizes are possibly going to cause truncation:

    @ProcedureName VARCHAR(50) = NULL,

    @SourceServer VARCHAR(50) = NULL,

    @SourceDatabase VARCHAR(50) = NULL,

    @TargetServer VARCHAR(50) = NULL,

    @TargetDatabase VARCHAR(50) = NULL

    maybe declare them as this:

    @ProcedureName sysname =...

  • RE: Today's Random Word!

    strategery

    (pronounced struh-TEE-jer-ee)

  • RE: How to Modify SPs automatically to include the change of tableSchema

    If you want to script out the stored procedures and other objects to 1 file or multiple files you can do so using the "Generate Scripts" menu command in SSMS...

  • RE: Creating simple dynamic sql

    I am not saying whether you should or shouldn't use dynamic SQL but since you are trying to learn it, here is a way you might write something to play...

  • RE: Lengthy procedure vs Split procedure

    Also splitting it up across multiple stored procedures will be more conducive to concurrent development within a team of developers.

  • RE: Is C# Better?

    Steve Jones - Editor (11/13/2009)


    Jeff Moden (11/12/2009)


    Heh... I have an odd personal preference... I don't like languages that require semi-colons or line continuation characters. It seems that they should...

  • RE: Problem with logging error from within CATCH block

    Paul White (11/7/2009)


    Adam Gojdas (11/7/2009)


    WHILE (XACT_STATE() <> 0) BEGIN

    ROLLBACK TRANSACTION;

    END;

    Hey Adam,

    Not trying to be 'smart' here...but ROLLBACK always rolls back completely, through any number of 'nested' transactions.

    You...

  • RE: Problem with logging error from within CATCH block

    Paul White (11/6/2009)


    SQL Guy-482125 (11/4/2009)


    Thanks, that's good solution, you moved insert ouside of transaction. This is what I needed.

    You might like to change the ROLLBACK TRANSACTION to:

    IF XACT_STATE() != 0...

  • RE: Problem with logging error from within CATCH block

    Paul White (11/6/2009)


    Adam Gojdas (11/5/2009)


    Please be aware the ERROR_MESSAGE() function returns a nvarchar(4000). So you will run the risk of truncating some of the messages using the variable declared...

  • RE: Problem with logging error from within CATCH block

    Please be aware the ERROR_MESSAGE() function returns a nvarchar(4000). So you will run the risk of truncating some of the messages using the variable declared as varchar(100).

  • RE: Store result in Variable of dynamic query

    venu_ksheerasagaram (11/1/2009)


    Hi All,

    Here i am having a doubt regarding the Dynamic Query. My requirement is How to store the Dynamic Query resultset into a TempTable? Could it possibel?

    Because...

  • RE: Store result in Variable of dynamic query

    Bhuvnesh (11/11/2008)


    hi ken,

    thanks it works:)

    but can u explain the whole scenario.

    Here this may help a little:

    DECLARE @word sysname

    EXEC sp_executesql

    N'SELECT TOP 1 @DynamicWord = [name] FROM sysobjects' --dynamic sql...

Viewing 15 posts - 31 through 45 (of 77 total)