Skip to content

Instantly share code, notes, and snippets.

View ben-thul's full-sized avatar
💭
🍱

Ben Thul ben-thul

💭
🍱
View GitHub Profile
@ben-thul
ben-thul / copy-all-views.ps1
Created December 2, 2022 19:40
Create script for all views in a database
$so = New-DbaScriptingOption;
$so.FileName = 'c:\temp\views\allviews.sql';
$so.AppendToFile = $true;
$so.IncludeDatabaseContext = $false;
$so.IncludeHeaders = $false;
$so.ToFileOnly = $true
$vv = Get-DbaDbView -SqlInstance . -Database AdventureWorks2019 -ExcludeSystemView;
Remove-Item -Path $so.FileName -Confirm;

Keybase proof

I hereby claim:

  • I am ben-thul on github.
  • I am benthul (https://keybase.io/benthul) on keybase.
  • I have a public key ASAqY0y9cgjwWY16fY2-NMz9nIgTotcsGUMj5HQrZf--pAo

To claim this, I am signing this object: