Answer: Using sqlcmd utility we can create a .sql file for the StoreProcedure.
Sample Code To Create file:
Suppose the name of the procedure is: proc_GetUserList_sp
DB UserName/Password: sa/sa
Server name=MyServer
Database Name: UserDB
Command From Above data is:
sqlcmd -U sa -P sa -S MyServer -d UserDB -Q "exec sp_helptext proc_GetUserList_sp" -h-1 -k 1 >> c:\DB\proc_GetUserList_sp.sql
Thanks & Regards
Lakhan Pal Garg
Asked In: Many Interviews |
Alert Moderator