Category Archives: SQL Server

Move tables and indexes from certain schema to a different filegroup

Moving tables from a schema to a new filegroup might be tricky and it is even worse when the schema is not dbo. To easily address that I have setup a script that move the objects to schema dbo (using … Continue reading

Posted in Scripts, SQL Server | Tagged , , , , , , , , | 2 Comments

Identify MSSQL Database ID

To identify the DB ID of the current database run the command: select db_id() go To identify the DB IDs of all your databases, run the command: use master select dbid,name from sysdatabases order by dbid asc go

Posted in SQL Server | Tagged , , , , , , , , , , , | Leave a comment

SQL Server tip – Calling .SQL scripts from osql

This is quite simple and handy; You can call it with some parameters.

Posted in SQL Server | Tagged , , , , , , , , | Leave a comment