rewly on Thu, 08 Apr 2010 14:47:09
When I script stored procedures to a new window, the commented header no longer appears. It used to, so I must have accidentally flipped a switch somewhere. Others who use the same servers as me aren't having this problem, so it seems to be something in my Management Studio installation. I've asked around here and searched online, but can't find any suggestions. Can anyone help me out?
David Dye on Thu, 08 Apr 2010 14:55:58
I am not exactly sure what you mean by the header, but the scripting options are configurable within SSMS.
Go to : Tools>Options>SQL Server object explorer>Scripting.
From here you can configure the options that you would like when scripting objects
Hope this helps
rewly on Thu, 08 Apr 2010 15:40:11
Thanks for getting back to me. The Scripting Options dialog was the first place I went. "include descriptive headers" is set to True, but that doesn't seem to be doing the trick. All it does is toggle the single-line header (e.g., "/****** Object: StoredProcedure [dbo].[sp_name] Script Date: 04/08/2010 11:35:17 ******/" "). We have a bunch of additional info we keep in the headers of each sp, and I can't view or edit it.
Can you think of anything else I might try?
David Dye on Thu, 08 Apr 2010 15:59:47
When you say "in the header" do you comments that are no longer showing up. For example:
/*This stored procedure update the appropriate table(s) for the employees*/ CREATE PROC updemployee AS ...
rewly on Thu, 08 Apr 2010 16:34:39
Yes, sorry I wasn't clearer on that. What I would like to be looking at when I script an sp (and what everyone else here is looking at) is something along the lines of this:
CREATE PROCEDURE upemployee
--Date Created: ...
--Written by: blah
None of the commented code gets scripted to my query window, though.
David Dye on Thu, 08 Apr 2010 17:39:43
Not sure why this wouldn't be showing. Assure that the procedure contains the comments using T-SQL:
USE AdventureWorks; GO SELECT OBJECT_DEFINITION (OBJECT_ID(N'AdventureWorks.dbo.uspLogError'));
The above will show the procedure definition including the comments. Let me know if the comments are visible.
rewly on Thu, 08 Apr 2010 20:07:44
That worked: I can see the comments. Does this help in figuring out what I did? I'm feeling pretty clumsy at this point.
In case it helps: Choosing "Modify" from the sproc context menu doesn't script the comments, either.
Naomi N on Thu, 08 Apr 2010 20:26:40
This doesn't sound possible.
Anyway, try to check scripts using techniques from
David Dye on Thu, 08 Apr 2010 21:05:47
Doesn't make sense. There is no option to leave/remove comments in the scripting options.
rewly on Fri, 09 Apr 2010 11:40:08
Well, thanks for trying, anyway.
ioanavic on Fri, 29 Apr 2016 05:16:19
I know it is an old post, but it happens that i have the exact same issue with SQL 2012 and i don't know how to fix it.
Did you find a solution for this?