Skip to content

Commit 845ac7e

Browse files
authored
Merge pull request #208 from LowlyDBA/sp-doc-update-sqlcmd-usage-doc
update doc around -y option usage
2 parents bf00cf7 + e4ae712 commit 845ac7e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/sp_doc.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,16 @@ EXEC dbo.sp_doc @DatabaseName = 'WideWorldImporters', @ExtendedPropertyName = 'M
7272

7373
### Output to File
7474

75-
Batch:
75+
#### Batch
7676

7777
```batchfile
7878
sqlcmd -S localhost -d master -Q "exec sp_doc @DatabaseName = 'WideWorldImporters';" -o readme.md -y 0
7979
```
8080

81-
PowerShell / DbaTools:
81+
**Note:** The `-y 0` option is [important to specify][sqlcmd] so that variable length
82+
output is not capped at the default of 256 characters by sqlcmd.
83+
84+
#### PowerShell / DbaTools
8285

8386
```powershell
8487
$Query = "EXEC sp_doc @DatabaseName = 'WideWorldImporters';"
@@ -143,4 +146,5 @@ Check out the other scripts in the [DBA MultiTool][tool].
143146
[issue]: https://github.com/LowlyDBA/dba-multitool/issues
144147
[sample]: assets/WideWorldImporters.md
145148
[so]: https://stackoverflow.com/a/37284582/4406684
149+
[sqlcmd]: https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility?view=sql-server-ver15#command-line-options
146150
[UVBug]: https://feedback.azure.com/forums/908035-sql-server/suggestions/32899324-ssms-ignores-final-r-n-crlf-carriage-return

0 commit comments

Comments
 (0)