I have the following to modify..

```
DECLARE @tablename AS VARCHAR (1000)
DECLARE @sql AS VARCHAR (1000)

IF OBJECT_ID('tempdb.dbo.#tables') IS NOT NULL
    DROP TABLE #tables

SELECT *
INTO   #tables
FROM   sys.tables

WHILE EXISTS (SELECT *
              FROM   #tables)
    BEGIN
        SELECT @tablename = name
        FROM   #tables
        SELECT @sql = 'truncate table ' + @tablename;
        PRINT @sql
        EXECUTE (@sql)
        DELETE #tables
        WHERE  name = @tablename;
    END

```

The above code will truncate all tables in a database, which is what I need however I only want this to work on tables that are part of the "dim" schema.

As an example, I have the following tables..

dbo.sales
dim.employee
dim.office

I'd like the script to only truncate the "dim" schema tables and not the dbo.sales table.

This is assuming that I don't have any PK/FK (as I have another code handling the drop/create of PK/FK).

Any help would be appreciated.

Thanks.