Categories
HOW TO Microsoft SQL Server

HOW TO know the SQL Server version installed

There are different methods how to know the SQL Server version installed.

My preferred, for me the easiest to remember, is run the following query:

[sourcecode lang=”sql”]Select @@version[/sourcecode]

An example of the output of this query is as follows:

Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)   Mar 29 2009 10:11:52   Copyright (c) 1988-2008 Microsoft Corporation  Express Edition (64-bit) on Windows NT 6.1  (Build 7600: )

For further info, please, use the reference link.

Reference: How to determine the version and edition of SQL Server and its components

Did my HOW TO help you? Leave a reply.

Categories
Dynamics NAV HOW TO Microsoft SQL Server

HOW TO take offline a database in SQL Server

HOW TO take offline a database in SQL Server?

Microsoft Sql Server Management Studio

Right click on the database node > Tasks > Take Offline

T-SQL Script

Execute the following query
[sourcecode lang=”sql”]
ALTER DATABASE [DatabaseName] SET OFFLINE WITH
ROLLBACK IMMEDIATE
GO
[/sourcecode]

If it seems that the command doesn’t work or the execution requires more time or to force to take offline or

if you’ll receive the following error:
ALTER DATABASE failed because a lock could not be placed on database ‘{DatabaseName}’. Try again later.

click on the following link to show the Solution:
ALTER DATABASE failed because a lock could not be placed on database

Did my HOW TO help you? Leave a reply.