Forum Discussion
Khushboo55
Mar 06, 2024Copper Contributor
To get definition of different type of object using sqlcmd utility from Microsoft SQL Server 2019
Hi, I am using ODBC based sqlcmd utility from command line with switches and passing TSQL query using sys.sql_modules catalog view to get the definition of sql object of type by passing the object-n...
Khushboo55
Mar 07, 2024Copper Contributor
olafhelper Thank you! I have tried Information schema view but that didn't work.
I am using different query for each object type.
For sql object of type : Stored Procedure, Function, Trigger and View, I am getting definition using sys.sql_modules catalog view.
For sql object of type: Default constraint, I am getting definition using sys.default_constraints catalog view.
For sql object of type: Check constraint, I am getting definition using using sys.check_constraints catalog view.
I need help to get definition of this objects:
Table, Sequence, Queue, Primary Key, Unique Key, Index. using command line query (I need exact definition I get from SSMS Generate script wizard gui to create a Transact-SQL script)
Appreciate your help!
olafhelper
Mar 07, 2024Bronze Contributor
See the link I posted, you can query all informations from system views.