Basic SQL commands

On this page some simple but useful SQL commands are shown.

Check all sysadmins on a SQL node:

Sometimes after a restore a login is not working, to fix use the following command:

Force take database offline:

ALTER DATABASE failed because a lock could not be placed on database error. If you get this error run the upper line and kill the SPID that is connected to the database.

Check open connections to databases

Check if full search is installed on SQL server

Delen via: Facebooktwitterpinterestlinkedinmail