Dynamic management views and functions return server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance.
There are two types of dynamic management views and functions:
- Server-scoped dynamic management views and functions. These require VIEW SERVER STATE permission on the server.
- Database-scoped dynamic management views and functions. These require VIEW DATABASE STATE permission on the database.
To view users who currently have VIEW SERVER STATE, execute the following query:
who.name AS [Principal Name],
who.type_desc AS [Principal Type],
who.is_disabled AS [Principal Is Disabled],
what.state_desc AS [Permission State],
what.permission_name AS [Permission Name]
INNER JOIN sys.server_principals who
ON who.principal_id = what.grantee_principal_id
what.permission_name = 'View server state'
AND who.name NOT LIKE '##MS%##'
AND who.type_desc <> 'SERVER_ROLE'
To grant permission:
GRANT VIEW SERVER STATE TO [UserId]
Simply run this script in SQL Server Management Studio to obtain the script to run for the current server. Copy-paste the results in a new window and press F5.
DECLARE @SQL VARCHAR(1000)
DECLARE @DB sysname
DECLARE curDB CURSOR FORWARD_ONLY STATIC FOR
WHERE [name] NOT IN ('model', 'tempdb')
ORDER BY [name]
FETCH NEXT FROM curDB INTO @DB
WHILE @@FETCH_STATUS = 0
SELECT @SQL = 'USE [' + @DB +']' + CHAR(13) + 'EXEC sp_updatestats' + CHAR(13)
FETCH NEXT FROM curDB INTO @DB
This article explains the system configuration and coding examples to print Brother labels from the web. If you’ve ever tried to work with the Brother software SDK you definitely would have reached a point where you feel true frustration with the lack of documentation and samples from 2003 written in VBS and Visual Studio 2003 (that don’t even compile anymore).
Continue reading “b-PAC Application Examples [ Print from Web Application]”
I’ve just gotten a new email from a very suspicious looking email address claiming they were HMRC and that I’m entitled to a refund.
Email address: “Gateway HMRC” <4YFW1AHTNGVH-KRBZC2H46EQF9-vWwByutFvbxt-HilwPbUkynMNX@twyford.ealing.sch.uk>
Email Subject: DO NOT REPLY | ‘Payment receipt return’ | ‘Review your automatic payment’ | ‘Item No.31468060423885’ gukm3038 8/22/2018 Continue reading “New HMRC Phishing Scam”
The following program shows how can Export a Chart from Excel to Picture file like BMP,JPG, GIF etc. Before we create a Chart , we have to fill data in Excel sheet.
Continue reading “Excel Chart Export as Picture file VB.NET”
In the following section you can see How to find the last row data in Excel worksheet or How to find the Used area in a worksheet. For finding last row we are using WorkSheet.UsedRange . It will return the last cell . The follwoing code open an Excel file and read the entire content.
Continue reading “Read entire worksheet in an Excel workbook using VB.net”
Without using Excel Object we can insert , edit , delete , select etc. in cell content of an Excel file using OLEDB in VB.NET . Here we are using OleDbConnection , OleDbDataAdapter , DataSet for doing these operations in an Excel file. You have to import System.Data in the project for doing these operations . For read the content from Excel file using ado.net , We can use the SELECT command like in SQL Operations.
If you would like to export to excel, check out this article:
How to export from DataGridView to excel
Continue reading “Read Data from Excel using OLEDB in VB.NET”