Home Forums SQL Server 2005 T-SQL (SS2K5) In store procedure where i need to declare "Declare @SQL1 varchar(800)" to access within Begin statement RE: In store procedure where i need to declare "Declare @SQL1 varchar(800)" to access within Begin statement

  • Edit. I need to read better.

    A better way to debug than mess with dynamic SQL, which in this case is going to cause errors that didn't exist before, is to take the queries and run them one by one in QA/Management studio.

    Just declare the necessary variables, and run the queries alone.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass