MSSQL Backup History Query
To see MSSQL history Query, run this SQL query. It will show all backups between the 1 january 2021 and 1 february 2021, order by Database and then Last backup time. It will also...
Kenneth Qvistgaard Dalbjerg, IT Konsulent i århus
To see MSSQL history Query, run this SQL query. It will show all backups between the 1 january 2021 and 1 february 2021, order by Database and then Last backup time. It will also...
You can check which statements are blocked by running this
I have this problems, that if a schedule inside a Agent job, have not been started for some reason, there will be no errors about this problem. So Í have created this script, that...
The function I use fn_hadr_group_is_primary from this post is a UDF (User Defined Function) that we create in the master database. The function gets an Availability Group name as an input parameter and returns a Boolean value indicating...
This command, can be run on both the primary and secondary node.
To see witch session id, that run command against a database, you can run this:
With this query, you can see whitch database that is using most memory
Run this command to see if any database on the SQL Server is using enterprise features
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
IF OBJECT_ID('tempdb.dbo.##enterprise_features') IS NOT NULL DROP TABLE ##enterprise_features CREATE TABLE ##enterprise_features ( dbname SYSNAME, feature_name VARCHAR(100), feature_id INT ) EXEC sp_msforeachdb N' USE [?] IF (SELECT COUNT(*) FROM sys.dm_db_persisted_sku_features) >0 BEGIN INSERT INTO ##enterprise_features SELECT dbname=DB_NAME(),feature_name,feature_id FROM sys.dm_db_persisted_sku_features END ' SELECT * FROM ##enterprise_features |
WIth this command you can see witch user that have SysAdmins access.
1 2 3 4 |
SELECT name,type_desc,is_disabled FROM master.sys.server_principals WHERE IS_SRVROLEMEMBER ('sysadmin',name) = 1 ORDER BY name |
Sidste kommentar