How to (re-)set identity column value in SQL Server?

When you use identity columns in SQL server you may have recognized that when deleting all table data your identity value stays at its latest position. Sometimes this is useful, sometimes it is not. Then you need to set this value to your preferred starting point....

SCCM failes to login at SQL database

Sometimes it happened to me, that our Microsoft System Center Configuration Manager 2007 R2 (sccmsrv01) failed to login at our dedicated MS SQL 2005 2 nodes cluster (cluster: sqlclu, node 1: sqlclu01 and node 2: sqlclu02). Everything you could find in the sql logs...

How to connect to / read from / write to SQL Server from Powershell?

First create the connection object, set the connection string and open the connection: $objSqlConnection = New-Object System.Data.SqlClient.SqlConnection $objSqlConnection.ConnectionString = “Server=YourSqlServer; Database=YourDataBase; User Id=YourUsername;...