SSMS query editing: possible to remove a field and have the matching value removed?

0

I work with large queries in SSMS. It would be fantastic if I could easily match up the comma-separated values with the comma-separated field names. I often delete a field, and then have to hunt for the matching value before the query is valid again.

Surely there is a way to find the matching value.

TimH

Posted 2014-02-25T19:12:08.843

Reputation: 103

Answers

0

Have you tried something like this:

SELECT ColumnName
FROM TableName
WHERE ','+ColumnName+',' LIKE '%,searchword,%'

Or:

SELECT ColumnName
FROM TableName
WHERE
ColumnName LIKE '%,' + @searchword + ',%' 
OR ColumnName LIKE @searchword + ',%' 
OR ColumnName LIKE '%,' + @searchword 
OR ColumnName =  @searchword

Hope this helps

Milica Medic

Posted 2014-02-25T19:12:08.843

Reputation: 403

Thanks for the suggestion. Unfortunately, manually reformatting the query to help make it easier to spot the field I want to remove, isn't feasible since I have to do this with hundreds of queries. – TimH – 2014-03-03T20:19:02.790