I am attempting to generate an update stats for all tables with scheduleday in it and having problems.... the with sample makes the query fail and the a, has to be there to get the query to be syntax correct but it doesn't do anything..... Any help would be appreciated.
SELECT 'UPDATE STATISTICS dbo.' a,table_name 'WITH SAMPLE 50 PERCENT'
FROM INFORMATION_SCHEMA.TABLES
where table_name like '%ScheduleDay%'