Dynamic sql more than 4000 chars


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. –Following IS a sample dynamic SQL string
  2.  
  3. –Break your dynamic string LIKE this
  4.  
  5. SET @q1 = ‘SELECT * ‘Â Â
  6.  
  7. SET @q2 = ‘FROM HumanResources.Department ‘
  8.  
  9. SET @q3 = ‘WHERE DepartmentId=1′
  10.  
  11. Â
  12.  
  13. –Now EXECUTE them together
  14.  
  15. EXEC (@q1 + @q2 + @q3)

URL: http://blog.namwarrizvi.com/?p=121

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.