File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql server question

 
Brian Percival
Ranch Hand
Posts: 163
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am kinda new to tsql programming and trying to find a quickie from google and such for a solution.

What I want is to get a list of tables and columns that contain a certain string. I actually want to replace all such occuranaces with some other string but here is how I started:


When I try to run ths, it complains that table variable @tn is not declared. Obviously I cann't use a varchar variable in place of a table, looks like..

Can anyone point out how I should change the above? I basically want to use the @tn and @cn as table name and column name in my 'select' inside the loop. HOW???

Thanks for your time.
 
Brian Percival
Ranch Hand
Posts: 163
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this from

sqlteam.com forums

Hope this helps posterity.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting the solution Brian!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic