SEARCH:   GO
{Blog entries}

I took an old script I had and modified it to:

- Include Schema support.
- Replace the old DBCC DBREINDEX statement with ALTER INDEX ALL.
- Rebuild the indexes online if the Enterprise edition was installed.
- Generate information about the tables processed.

Read More »

Today I needed to delete all foreign key contrains in a SQL 2005 database in order to be able to sync it using the Visual Studio Data Compare Tool. I found a script doing almost what I needed but after running it I noticed that it also dropped indexes and defaults in all the schemas. I made some changes to accomplish the following:

1- Drop foreign key contrains only.

2- Filter by schema.

3- Don't execute the drop statements automatically just print them.

Read More »