Skip to content

Commit e88feff

Browse files
authored
Merge pull request #128 from LowlyDBA/development
Development
2 parents 2f048d9 + 369618c commit e88feff

13 files changed

+824
-562
lines changed

appveyor/appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.2.{build}
1+
version: 1.3.{build}
22

33
pull_requests:
44
do_not_increment_build_number: false

appveyor/sqlcover/Coverage.opencoverxml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
<SequencePoint vc="5" uspid="14" ordinal="14" offset="2510" sl="80" sc="1" el="80" ec="51" />
2626
<SequencePoint vc="5" uspid="15" ordinal="15" offset="2618" sl="83" sc="1" el="86" ec="28" />
2727
<SequencePoint vc="5" uspid="16" ordinal="16" offset="2843" sl="91" sc="1" el="107" ec="29" />
28-
<SequencePoint vc="5" uspid="17" ordinal="17" offset="3469" sl="113" sc="1" el="304" ec="6" />
29-
<SequencePoint vc="5" uspid="18" ordinal="18" offset="11188" sl="310" sc="1" el="422" ec="6" />
30-
<SequencePoint vc="5" uspid="19" ordinal="19" offset="15945" sl="428" sc="1" el="535" ec="6" />
31-
<SequencePoint vc="5" uspid="20" ordinal="20" offset="20493" sl="541" sc="1" el="651" ec="6" />
32-
<SequencePoint vc="5" uspid="21" ordinal="21" offset="25124" sl="657" sc="1" el="764" ec="6" />
33-
<SequencePoint vc="5" uspid="22" ordinal="22" offset="29760" sl="770" sc="1" el="843" ec="52" />
34-
<SequencePoint vc="5" uspid="23" ordinal="23" offset="32750" sl="846" sc="1" el="849" ec="20" />
35-
<SequencePoint vc="5" uspid="24" ordinal="24" offset="32832" sl="851" sc="1" el="851" ec="78" />
36-
<SequencePoint vc="5" uspid="25" ordinal="25" offset="32913" sl="852" sc="1" el="855" ec="16" />
28+
<SequencePoint vc="5" uspid="17" ordinal="17" offset="3487" sl="113" sc="1" el="323" ec="6" />
29+
<SequencePoint vc="5" uspid="18" ordinal="18" offset="11942" sl="329" sc="1" el="450" ec="6" />
30+
<SequencePoint vc="5" uspid="19" ordinal="19" offset="16853" sl="456" sc="1" el="576" ec="6" />
31+
<SequencePoint vc="5" uspid="20" ordinal="20" offset="21871" sl="582" sc="1" el="705" ec="6" />
32+
<SequencePoint vc="5" uspid="21" ordinal="21" offset="26972" sl="711" sc="1" el="830" ec="6" />
33+
<SequencePoint vc="5" uspid="22" ordinal="22" offset="32008" sl="836" sc="1" el="910" ec="52" />
34+
<SequencePoint vc="5" uspid="23" ordinal="23" offset="35043" sl="913" sc="1" el="916" ec="20" />
35+
<SequencePoint vc="5" uspid="24" ordinal="24" offset="35125" sl="918" sc="1" el="918" ec="78" />
36+
<SequencePoint vc="5" uspid="25" ordinal="25" offset="35206" sl="919" sc="1" el="922" ec="16" />
3737
</SequencePoints>
3838
</Method>
3939
</Methods>

appveyor/sqlcover/[dbo].[sp_doc]

Lines changed: 181 additions & 114 deletions
Large diffs are not rendered by default.

appveyor/sqlcover/[dbo].[sp_helpme]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ BEGIN
5555
,@SQLString NVARCHAR(MAX) = N''
5656
,@Msg NVARCHAR(MAX) = N''
5757
,@ParmDefinition NVARCHAR(500)
58-
,@LastUpdated NVARCHAR(20) = '2020-06-29';
58+
,@LastUpdated NVARCHAR(20) = '2020-09-18';
5959

6060
/* Find Version */
6161
IF (@SqlMajorVersion = 0)

appveyor/sqlcover/[dbo].[sp_sizeoptimiser]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ BEGIN
5959
,@HasPersistedSamplePercent BIT = 0
6060
,@CheckNumber TINYINT = 0
6161
,@EngineEdition TINYINT
62-
,@LastUpdated NVARCHAR(20) = '2020-08-04'
62+
,@LastUpdated NVARCHAR(20) = '2020-09-18'
6363
,@CheckSQL NVARCHAR(MAX) = N''
6464
,@Msg NVARCHAR(MAX) = N''
6565
,@DbName SYSNAME = N''

docs/WideWorldImporters.md

Lines changed: 252 additions & 252 deletions
Large diffs are not rendered by default.

docs/sp_doc.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,37 +50,36 @@ and plays nice with:
5050

5151
## Arguments
5252

53-
* `@DatabaseName SYSNAME`
54-
55-
Target database to generate documentation for.
56-
If not supplied, the current database is used.
57-
58-
* `@ExtendedPropertyName VARCHAR(100)`
59-
60-
Name of the extended property containing descriptive text for objects.
61-
The default value is "Description".
53+
| Parameter | Type | Output | Description |
54+
| --- | --- | --- | --- |
55+
| @DatabaseName | SYSNAME(256) | no | Target database to document. Default is the stored procedure's database. |
56+
| @ExtendedPropertyName | SYSNAME(256) | no | Key for extended properties on objects. Default is 'Description'. |
57+
| @SqlMajorVersion | TINYINT | no | Used for unit testing purposes only. |
58+
| @SqlMinorVersion | SMALLINT | no | Used for unit testing purposes only. |
6259

6360
## Usage
6461

65-
The primary parameter for this procedure is a database name, since the
66-
primary scenario for this is to be included in a utility or system database:
62+
### Basic Use
6763

6864
```tsql
69-
EXEC dbo.sp_doc @DatabaseName = 'WideWorldImporters'
65+
EXEC dbo.sp_doc @DatabaseName = 'WideWorldImporters'
7066
```
7167

72-
An alternative key for extended property values can also be specified to
73-
override the default of `Description`:
74-
7568
```tsql
76-
EXEC dbo.sp_doc @DatabaseName = 'WideWorldImporters', @ExtendedPropertyName = 'MS_Description';
69+
EXEC dbo.sp_doc @DatabaseName = 'WideWorldImporters', @ExtendedPropertyName = 'MS_Description';
7770
```
7871

79-
To prevent data truncation, unwanted headers, etc. it should be called
80-
via sqlcmd, outputting directly to a readme.md file:
72+
### Advanced Use
73+
74+
Add extended properties to programmable objects, using parameter names as keys,
75+
to include their descriptions in the documentation:
8176

82-
```batchfile
83-
sqlcmd -S localhost -d master -Q "exec sp_doc @DatabaseName = 'WideWorldImporters';" -o readme.md -y 0
77+
```tsql
78+
EXEC sys.sp_addextendedproperty @name=N'@ExtendedPropertyName',
79+
@value=N'Key for extended properties on objects. Default is ''Description''.' ,
80+
@level0type=N'SCHEMA',@level0name=N'dbo',
81+
@level1type=N'PROCEDURE',
82+
@level1name=N'sp_doc'
8483
```
8584

8685
## Sample
@@ -91,7 +90,7 @@ Output for the [WideWorldImporters database][sample].
9190

9291
## Contributing
9392

94-
Missing a feature? Found a bug? Open an [issue][issue] to get some :heart:.
93+
Missing a feature? Found a bug? Open an [issue][issue] to get some :heart:
9594

9695
## More
9796

docs/sp_helpme.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,12 @@ Changes from the original include:
2727

2828
## Arguments
2929

30-
* `@ObjectName SYSNAME`
31-
32-
Target non-database object to show information for.
33-
If not supplied, information on all objects in the database is returned.
34-
35-
* `@ExtendedPropertyName SYSNAME`
36-
37-
Name of the extended property containing descriptive text for objects.
38-
The default value is "Description".
30+
| Parameter | Type | Output | Description |
31+
| --- | --- | --- | --- |
32+
| @ObjectName | SYSNAME(256) | no | Target object. Default is all objects. |
33+
| @ExtendedPropertyName | SYSNAME(256) | no | Key for extended properties on objects. Default is 'Description'. |
34+
| @SqlMajorVersion | TINYINT | no | Used for unit testing purposes only. |
35+
| @SqlMinorVersion | SMALLINT | no | Used for unit testing purposes only. |
3936

4037
## Usage
4138

@@ -47,7 +44,7 @@ EXEC sp_helpme 'dbo.Sales';
4744

4845
## Contributing
4946

50-
Missing a feature? Found a bug? Open an [issue][issue] to get some :heart:.
47+
Missing a feature? Found a bug? Open an [issue][issue] to get some :heart:
5148

5249
## More
5350

docs/sp_sizeoptimiser.md

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,17 @@ Storage is cheap, but smaller is faster!
2626

2727
## Arguments
2828

29-
* `@IndexNumThreshold SMALLINT`
30-
31-
Number of indexes to classify a table as having too many indexes on it.
32-
Default value is 10.
33-
34-
* `@IncludeDatabases [dbo].[SizeOptimiserTableType]`
35-
36-
Which databases to run the script on in the form of a user defined table type.
37-
If not supplied, all accessible user databases are targeted.
38-
Cannot be used in conjunction with `@ExcludeDatabases`.
39-
40-
* `@ExcludeDatabases [dbo].[SizeOptimiserTableType]`
41-
42-
Which databases to exclude in the form of a user defined table type.
43-
Cannot be used in conjunction with `@IncludeDatabases`.
44-
45-
* `@IncludeSysDatabases BIT`
46-
47-
Whether or not to include system databases in the script's analysis.
48-
Default is 0.
49-
50-
* `@IncludeSSRSDatabases BIT`
51-
52-
Whether or not to include SQL Server Reporting Services databases in
53-
the script's analysis.
54-
Default is 0.
55-
56-
* `@Verbose BIT`
57-
58-
Whether or not to print additional information during the script run,
59-
including which checks may be skipped and variable values.
60-
Default is 0.
29+
| Parameter | Type | Output | Description |
30+
| --- | --- | --- | --- |
31+
| @IndexNumThreshold | SMALLINT | no | Number of indexes to classify a table as having too many indexes on it. Default value is 10. |
32+
| @IncludeDatabases | SIZEOPTIMISERTABLETYPE | no | Which databases to run the script on in the form of a user defined table type. If not supplied, all accessible user databases are targeted. Cannot be used in conjunction with @ExcludeDatabases. |
33+
| @ExcludeDatabases | SIZEOPTIMISERTABLETYPE | no | Which databases to exclude in the form of a user defined table type. Cannot be used in conjunction with @IncludeDatabases. |
34+
| @IncludeSysDatabases | BIT | no | Whether or not to include system databases in the script's analysis. Default is 0. |
35+
| @IncludeSSRSDatabases | BIT | no | Whether or not to include SQL Server Reporting Services databases in the script's analysis. Default is 0. |
36+
| @Verbose | BIT | no | Whether or not to print additional information during the script run. Default is 0. |
37+
| @IsExpress | BIT | no | Used for unit testing purposes only. |
38+
| @SqlMajorVersion | TINYINT | no | Used for unit testing purposes only. |
39+
| @SqlMinorVersion | SMALLINT | no | Used for unit testing purposes only. |
6140

6241
## Usage
6342

@@ -69,7 +48,7 @@ DECLARE @includeDatabases SizeOptimiserTableType;
6948
INSERT INTO @includeDatabases ([database_name])
7049
VALUES (N'WideWorldImporters');
7150
72-
EXEC [dbo].[sp_sizeoptimiser] @IncludeDatabases = @includeDatabases
51+
EXEC [dbo].[sp_sizeoptimiser] @IncludeDatabases = @includeDatabases;
7352
GO
7453
```
7554

@@ -241,7 +220,7 @@ a clustered index, unless they are used for staging data or temporary in nature.
241220

242221
## Contributing
243222

244-
Missing a feature? Found a bug? Open an [issue][issue] to get some :heart:.
223+
Missing a feature? Found a bug? Open an [issue][issue] to get some :heart:
245224

246225
## More
247226

install_expsql.sql

23.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)