Skip to content

Commit ed53784

Browse files
authoredApr 18, 2019
delete duplicate examples
1 parent 1f90242 commit ed53784

File tree

1 file changed

+0
-67
lines changed

1 file changed

+0
-67
lines changed
 

‎docs/azure_data_studio/README_FOR_MARKETPLACE.md

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -145,73 +145,6 @@ FOREACH {
145145
}
146146
```
147147

148-
### SQL PowerShell Examples
149-
In order to use these examples (below), you need to install the SqlServer module from the [PowerShell Gallery](https://www.powershellgallery.com/packages/SqlServer).
150-
151-
```powershell
152-
Install-Module -Name SqlServer -AllowPrerelease
153-
```
154-
155-
In this example, we use the `Get-SqlInstance` cmdlet to Get the Server SMO objects for ServerA & ServerB. The default output for this command will include the Instance name, version, Service Pack, & CU Update Level of the instances.
156-
157-
```powershell
158-
Get-SqlInstance -ServerInstance ServerA, ServerB
159-
```
160-
161-
Here is a sample of what that output will look like:
162-
163-
```
164-
Instance Name Version ProductLevel UpdateLevel
165-
------------- ------- ------------ -----------
166-
ServerA 13.0.5233 SP2 CU4
167-
ServerB 14.0.3045 RTM CU12
168-
```
169-
170-
In this example, we will do a `dir` (alias for `Get-ChildItem`) to get the list of all SQL Server instances listed in your Registered Servers file, and then use the `Get-SqlDatabase` cmdlet to get a list of Databases for each of those instances.
171-
172-
```powershell
173-
dir 'SQLSERVER:\SQLRegistration\Database Engine Server Group' -Recurse |
174-
WHERE { $_.Mode -ne 'd' } |
175-
FOREACH {
176-
Get-SqlDatabase -ServerInstance $_.Name
177-
}
178-
```
179-
180-
Here is a sample of what that output will look like:
181-
182-
```
183-
Name Status Size Space Recovery Compat. Owner
184-
Available Model Level
185-
---- ------ ---- ---------- -------- ------- -----
186-
AdventureWorks2017 Normal 336.00 MB 57.01 MB Simple 140 sa
187-
master Normal 6.00 MB 368.00 KB Simple 140 sa
188-
model Normal 16.00 MB 5.53 MB Full 140 sa
189-
msdb Normal 48.44 MB 1.70 MB Simple 140 sa
190-
PBIRS Normal 144.00 MB 55.95 MB Full 140 sa
191-
PBIRSTempDB Normal 16.00 MB 4.20 MB Simple 140 sa
192-
SSISDB Normal 325.06 MB 26.21 MB Full 140 sa
193-
tempdb Normal 72.00 MB 61.25 MB Simple 140 sa
194-
WideWorldImporters Normal 3.2 GB 2.6 GB Simple 130 sa
195-
```
196-
197-
This example uses the `Get-SqlDatabase` cmdlet to retrieve a list of all databases on the ServerB instance, then presents a grid/table (using the `Out-GridView` cmdlet) to select which databases should be backed up. Once the user clicks on the "OK" button, only the highlighted databases will be backed up.
198-
199-
```powershell
200-
Get-SqlDatabase -ServerInstance ServerB |
201-
Out-GridView -PassThru |
202-
Backup-SqlDatabase -CompressionOption On
203-
```
204-
205-
This example, again, gets list of all SQL Server instances listed in your Registered Servers file, then calls the `Get-SqlAgentJobHistory` which reports every failed SQL Agent Job since Midnight, for each SQL Server instances listed.
206-
207-
```powershell
208-
dir 'SQLSERVER:\SQLRegistration\Database Engine Server Group' -Recurse |
209-
WHERE {$_.Mode -ne 'd' } |
210-
FOREACH {
211-
Get-SqlAgentJobHistory -ServerInstance $_.Name -Since Midnight -OutcomesType Failed
212-
}
213-
```
214-
215148
## Contributing to the Code
216149

217150
Check out the [development documentation](docs/development.md) for more details

0 commit comments

Comments
 (0)
Please sign in to comment.