aspose file tools*
The moose likes JDBC and the fly likes sql server question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "sql server question" Watch "sql server question" New topic
Author

sql server question

Brian Percival
Ranch Hand

Joined: Jun 23, 2004
Posts: 163
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

Joined: Jun 23, 2004
Posts: 163
I got this from

sqlteam.com forums

Hope this helps posterity.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

Thanks for posting the solution Brian!


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sql server question