dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 192 forks source link

Show view definition? #559

Closed art3xias23 closed 1 year ago

art3xias23 commented 1 year ago

Is there a command similar to \sf (function) which would allow to display a view's definition?

art3xias23 commented 1 year ago

This could be a feature request, but I'm happy enough to close it with the below query which I'm able to run and obtain the information.

SELECT definition FROM sys.sql_modules WHERE OBJECT_ID = OBJECT_ID('MyViewNameHere')