Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL \G equivalent in SQL Server

How does one format wide listings vertically like in MySQL using the sqlcmd client? Or should I be using osql instead?

And must I write "GO" each time to execute my query? Is there a shorthand?

like image 587
Alex Budovski Avatar asked Oct 26 '25 06:10

Alex Budovski


2 Answers

You can use -y or -Y to limit the width of wide columns in SQLCMD, but I'm not sure there's a way to wrap the contents of the column within that width, which is what I believe you're asking.

Also, you can use -c to specify a custom command terminator instead of GO, which is the default.

like image 124
Bob Pusateri Avatar answered Oct 28 '25 19:10

Bob Pusateri


You can use -y or -Y to limit the width of wide columns in SQLCMD, but I'm not sure there's a way to wrap the contents of the column within that width, which is what I believe you're asking.

Also, you can use -c to specify a custom command terminator instead of GO, which is the default.

like image 24
Bob Pusateri Avatar answered Oct 28 '25 19:10

Bob Pusateri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!