This file contains 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
IF EXISTS (select * fROM sys.dm_xe_sessions where name = 'QueriesCompleted') | |
BEGIN | |
DROP EVENT SESSION [QueriesCompleted] ON SERVER | |
END | |
GO | |
CREATE EVENT SESSION [QueriesCompleted] ON SERVER | |
ADD EVENT sqlserver.rpc_completed( | |
ACTION( | |
sqlserver.client_app_name, |
This file contains 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-ChildItem -Path C:\some-dir\* -Include *.ext -Recurse | ForEach-Object { | |
$content = Get-Content $_.FullName | |
$content | Out-File -Encoding UTF8NoBOM $_.FullName | |
#write-host "Encoding changed:" $_.FullName | |
} |
This file contains 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
git merge -Xtheirs branch-to-merge |
This file contains 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
git mv -k * ./dir-to-move-to |
This file contains 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
git rm -r '*.ext' |
This file contains 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 | |
SERVERPROPERTY('ProductVersion') AS ProductVersion, | |
SERVERPROPERTY('ProductLevel') AS ProductLevel, | |
SERVERPROPERTY('Edition') AS Edition, | |
create_date AS 'SQLServerInstallDate', | |
case | |
when CAST(SERVERPROPERTY('Edition') as nvarchar(100)) like '% evaluation %' then | |
DATEADD(day, 180, create_date) --evaluation periods for 180 days | |
else | |
'' |
This file contains 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
New-SelfSignedCertificate -FriendlyName "FTP Server" -CertStoreLocation cert:\localmachine\my -DnsName name.of.machine.com |
This file contains 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 [master] | |
select | |
db.name, | |
db.state_desc, | |
db.recovery_model_desc | |
from | |
sys.databases db | |
where | |
db.name not in ('master','tempdb','model','msdb') |
This file contains 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 | |
db.name, | |
db.state_desc, | |
db.recovery_model_desc, | |
mf.type_desc, | |
mf.physical_name, | |
(mf.size * 8)/1024 as SizeMB, | |
'USE [master]; ALTER DATABASE [' + db.name + '] SET RECOVERY SIMPLE WITH NO_WAIT; USE [' + db.name + ']; DBCC SHRINKFILE (N''' + mf.name + ''' , 0, TRUNCATEONLY);' as SQLOutput | |
from | |
sys.databases db |
This file contains 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
<PropertyGroup> | |
<UseRazorSourceGenerator>false</UseRazorSourceGenerator> | |
</PropertyGroup> |