I want to reorganize the indexes of all tables in my SQL Server 2008 database, named 'db'. I try the following command:
ALTER INDEX all ON db REBUILD
And I get the following error:
Cannot find the object "db" because it does not exist or you do not have permissions
What am I doing wrong?