Tables size in mssql
To check size used by data and indexes You can use following script
List of columns in the primary key
If anyone is interested in how to list columns in the main key on the mssql server then I present a quick script.
SELECT
Col.Column_Name
,Col.Table_Name
,OBJECT_ID(Col.Table_Name) AS [object_id]
FROM
INFORMATION_SCHEMA.TABLE_CONSTRAINTS Tab
,INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE Col
WHERE
Col.Constraint_Name = Tab.Constraint_Name
AND Col.Table_Name = Tab.Table_Name
AND Constraint_Type = 'PRIMARY KEY'
AND [Col].Table_name='<TABLENAME>'
Index at MySQL database
The following example shows how to easily create an index in the MySQL database
ALTER TABLE `TableName` ADD INDEX `IndexName` (`ColumnName`):
How to kill connections to the MSSQL database
The following script allows you to disconnect active connections to the selected ms sql database.