Wednesday, March 21, 2012

loop through each table of my DB

Is there a way to loop using a cursor in SQL-server so i can see if each columns of each tables that i loop through my DB have a specific string value and change it to something else, renaming the column if the match if correct.

any threads that i can read from or website..

thanx !!Won't you get there using:SELECT * FROM INFORMATION_SCHEMA.COLUMNS-PatP|||Table name = nMontantBilletTVQ
Table name = nMontantBilletTPS

here an example of what i try to find.

i would like to search the word 'TVQ' in my string 'nMontantBilletTVQ'

is there a string functions for that ?? just cant get one working

thanx|||Use LIKE.

-PatP

No comments:

Post a Comment