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 | |
concat('select top 10 [', c.name, '] from [', schema_name(t.schema_id), '].[', t.name, '] where [', c.name, '] like ''%.%'' and [', c.name, '] not like ''%.0%''') | |
from | |
sys.tables t | |
inner join sys.columns c on | |
t.object_id = c.object_id | |
inner join sys.types ty on | |
c.user_type_id = ty.user_type_id | |
and ty.name = 'decimal' |
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
$domain = "microsoft.com" | |
$tenantId = (Invoke-WebRequest -UseBasicParsing https://login.windows.net/$domain/.well-known/openid-configuration|ConvertFrom-Json).token_endpoint.Split('/')[3] | |
Write-Host $tenantId |
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
# Specify source and destination of shortcut folders below. | |
# **************************************************************************** | |
# * Note: In the source location, create two folders named 32-Bit and 64-Bit * | |
# * to host your Start Menu shortcuts (as shortcut paths may vary). * | |
# **************************************************************************** | |
$Source = "\\ABC-SVR-01\Applications$\StartMenu" | |
$Destination="C:\ProgramData\FolderName\Windows\Start Menu" | |
# Inform user if no Source or Destination has been provided. | |
If (($Source -eq "") -or ($Destination -eq "")) |
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
$domain = 'cloudflare.com' | |
$url = 'https://cloudflare-dns.com/dns-query?name='+$domain+'&type=A'; | |
$header = @{"accept"="application/dns-json"} | |
$response = (Invoke-WebRequest -Uri $url -Headers $header -UseBasicParsing).Content | |
$r = [System.Text.Encoding]::UTF8.GetString($response) | ConvertFrom-Json | |
$r | |
foreach ($item in $r.Answer) | |
{ | |
Write-Host $item |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>PowerBI</title> | |
<script> | |
var noOfMins = 1; | |
setInterval(function() { | |
window.location.reload(); | |
}, (noOfMins * 60 * 1000)); |
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
declare | |
@dt_Start datetime = '2018-01-01' | |
,@dt_End datetime = '2018-12-31' | |
;WITH dts AS ( | |
SELECT | |
sqldatetime = @dt_Start | |
UNION ALL | |
SELECT | |
DATEADD(DAY, 1, sqldatetime) |
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
$dir = "c:\temp\" + (Get-Date).ToString("yyyy-MM-dd") | |
Write-Host $dir | |
$excelObj = New-Object -ComObject Excel.Application | |
$excelObj.Visible = $true | |
$files = Get-ChildItem -Path $dir | |
foreach ($file in $files) | |
{ | |
$filePath = $file.FullName | |
$workBook = $excelObj.Workbooks.Open($filePath) |
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
USE ssisdb | |
--thebakingdba.blogspot.com 2013/07/18 1.00 | |
--purpose - grab the connection strings from SSISDB for the package and the job runs. | |
SELECT ISNULL(project_based_values.project_name, | |
job_based_values.project_name) AS project_name, | |
ISNULL(project_based_values.package_name, | |
job_based_values.package_name) AS package_name, | |
ISNULL(project_based_values.parameter_name, | |
job_based_values.parameter_name) AS parameter_name, | |
project_based_values.Connection_String AS Project_Connection_String, |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\ms-excel] | |
@="Url:Excel Protocol" | |
"URL Protocol"="" | |
"UseOriginalUrlEncoding"=dword:00000001 | |
[HKEY_CLASSES_ROOT\ms-excel\DefaultIcon] | |
@="C:\\Program Files (x86)\\Microsoft Office\\Root\\Office16\\EXCEL.EXE,0" |
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
=str(Fields!DayNumberInCalendarMonth.Value) | |
+ SWITCH( | |
right(str(Fields!DayNumberInCalendarMonth.Value), 1) = "1", "st" | |
,left(str(Fields!DayNumberInCalendarMonth.Value), 1) = "1", "th" | |
,right(str(Fields!DayNumberInCalendarMonth.Value), 1) = "2", "nd" | |
,right(str(Fields!DayNumberInCalendarMonth.Value), 1) = "3", "rd" | |
,true, "th" | |
) |