So we have been having replication/build failures due to views with SELECT *.
The exercise below should be a trivial regex string..How should I code this search?
The example below handles one case - how might I code for any combination of spaces and tabs between SELECT and *?
SELECT OBJECT_NAME( SO.OBJECT_ID ) AS Name
FROM sys.syscomments AS SC
INNER JOIN sys.objects AS SO ON SC.ID = SO.OBJECT_ID
WHERE SO.Is_MS_Shipped = 0 AND SO.[Type_Desc] = 'VIEW' AND SC.Text LIKE N'%SELECT *%' ESCAPE '\'
It could even be SELECT<whitespace><cr or lf or both><whitespace>*
Thanks ahead of time,
Doug