This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
physical_memory_in_use_kb/1024./1024. AS sql_physical_memory_in_use_gb, | |
large_page_allocations_kb/1024./1024. AS sql_large_page_allocations_gb, | |
locked_page_allocations_kb/1024./1024. AS sql_locked_page_allocations_gb, | |
virtual_address_space_reserved_kb/1024./1024. AS sql_VAS_reserved_gb, | |
virtual_address_space_committed_kb/1024./1024. AS sql_VAS_committed_gb, | |
virtual_address_space_available_kb/1024./1024. AS sql_VAS_available_gb, | |
page_fault_count AS sql_page_fault_count, | |
memory_utilization_percentage AS sql_memory_utilization_percentage, | |
process_physical_memory_low AS sql_process_physical_memory_low, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Case 1: get waiting tasks (defaults to running, specific wait or open transactions) | |
EXEC sp_whoisactive; | |
GO | |
-- Case 2: add tasks wait details for parallel queries | |
EXEC sp_whoisactive @get_task_info = 2; | |
GO | |
-- Case 3: add execution Plans | |
EXEC sp_whoisactive @get_task_info = 2, @get_plans = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Get deadlock graphs from System Health session with files target | |
-- | |
IF OBJECT_ID('tempdb..#deadlocks') IS NOT NULL | |
DROP TABLE #deadlocks; | |
WITH XmlDataSet AS | |
( | |
SELECT CAST(xe.event_data AS xml) AS XMLDATA,* | |
FROM sys.fn_xe_file_target_read_file('system_health_*.xel',NULL,NULL,NULL) as xe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Analyze local image with Azure Cognitive Services Computer Vision API in PowerShell | |
$ComputerVisionAPILocation = "westeurope"; | |
$ComputerVisionAPIURL = "https://$ComputerVisionAPILocation.api.cognitive.microsoft.com/vision/v2.0"; | |
$ComputerVisionAPIKey = "YOUR_KEY_GOES_HERE"; | |
$ComputerVisionAPIAnalyzeTemplateURL = ($ComputerVisionAPIURL + "/analyze?visualFeatures={0}&details={1}&language={2}") | |
$visualFeatures = "Categories,Tags,Description,Faces,ImageType,Color,Adult"; | |
$details = "Celebrities,Landmarks"; | |
$language = "en"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Analyze image by URL with Azure Cognitive Services Computer Vision API in PowerShell | |
$ComputerVisionAPILocation = "westeurope"; | |
$ComputerVisionAPIURL = "https://$ComputerVisionAPILocation.api.cognitive.microsoft.com/vision/v2.0"; | |
$ComputerVisionAPIKey = "YOUR_KEY_GOES_HERE"; | |
$ComputerVisionAPIAnalyzeTemplateURL = ($ComputerVisionAPIURL + "/analyze?visualFeatures={0}&details={1}&language={2}") | |
$visualFeatures = "Categories,Tags,Description,Faces,ImageType,Color,Adult"; | |
$details = "Celebrities,Landmarks"; | |
$language = "en"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Describe local image with Azure Cognitive Services Computer Vision API in PowerShell | |
$ComputerVisionAPILocation = "westeurope"; | |
$ComputerVisionAPIURL = "https://$ComputerVisionAPILocation.api.cognitive.microsoft.com/vision/v2.0"; | |
$ComputerVisionAPIKey = "YOUR_KEY_GOES_HERE"; | |
$ComputerVisionAPIAnalyzeTemplateURL = ($ComputerVisionAPIURL + "//describe?maxCandidates={0}") | |
$maxCandidates = 10; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Analyze image by URL with Google Cloud Vision API in PowerShell | |
$CloudVisionAPIURL = "https://vision.googleapis.com/v1/images:annotate"; | |
$CloudVisionAPIKey = "YOUR_KEY_GOES_HERE"; | |
$CloudVisionAPIAnalyzeTemplateURL = ($CloudVisionAPIURL + "?key={0}") | |
# Note: the aspect ratios for crop hints are 1:1, 4:3, 3:2 and 16:9 | |
$AnnotateImageRequest = | |
@{ | |
requests = @{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Analyze image by URL with Google Cloud Vision API in PowerShell | |
$CloudVisionAPIURL = "https://vision.googleapis.com/v1/images:annotate"; | |
$CloudVisionAPIKey = "YOUR_KEY_GOES_HERE"; | |
$CloudVisionAPIAnalyzeTemplateURL = ($CloudVisionAPIURL + "?key={0}") | |
$ImageFilename = "C:\Temp\cognitive\20180805-120348-GH01C04-S00.jpg"; | |
# Note: the aspect ratios for crop hints are 1:1, 4:3, 3:2 and 16:9 | |
$AnnotateImageRequest = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Analyze image by URL with Clarifai API in PowerShell | |
$ClarifaiAPIURL = "https://api.clarifai.com/v2"; | |
$ClarifaiAPIKey = "YOUR_KEY_GOES_HERE"; | |
$ClarifaiAPIPredictTemplateURL = ($ClarifaiAPIURL + "/models/{0}/outputs") | |
$PredictInputs = | |
@{ | |
inputs = @(@{ | |
data = @{ | |
image = @{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Analyze local image by URL with Clarifai API in PowerShell | |
$ClarifaiAPIURL = "https://api.clarifai.com/v2"; | |
$ClarifaiAPIKey = "YOUR_KEY_GOES_HERE"; | |
$ClarifaiAPIPredictTemplateURL = ($ClarifaiAPIURL + "/models/{0}/outputs") | |
$ImageFilename = "C:\Temp\cognitive\20180805-143608-GH01C12-S00.jpg"; | |
$PredictInputs = | |
@{ | |
inputs = @(@{ |