Forum Replies Created

Viewing 4 posts - 1 through 5 (of 5 total)

  • RE: Cursor declaration.....

    Gary, Mike,

    Thanks for your input. Have declared the cursor as local now - adding "@" prefix as other local variables - and it does give better overview. Moreover - doing...

  • RE: Cursor declaration.....

    Found problem !

    Declare cursor as LOCAL

    DECLARE C1 CURSOR LOCAL FOR

     

     

    !!! Better to write it out rather than trust default settings I guess 🙂

  • RE: TSQL - Using variable as DBName for ALTER Command

    Found solution.........

    DECLARE @xx AS nvarChar(128)

    SET @xx = (SELECT DB_NAME()) --Pick up current dbname

    exec ('ALTER DATABASE "'+@xx+'" SET RECURSIVE_TRIGGERS ON')

    GO

     

    The databasename contains blanks - so added " to the string,

    Thanks...

  • RE: TSQL - Using variable as DBName for ALTER Command

    Tried it.....

    DECLARE @xx AS nvarChar(128)

    SET @xx = (SELECT DB_NAME()) --Pick up current dbname

    exec ('ALTER DATABASE '+@xx+'SET RECURSIVE_TRIGGERS ON')

    GO

    Gives

    Server: Msg 156, Level 15, State 1, Line 1

    Incorrect syntax near the...

Viewing 4 posts - 1 through 5 (of 5 total)