1

I am installed Microsoft SQL Server Management Studio 2016 of a new PC that I have. When I try to alter a view I get the following error

Syntax error in TextHeader of View 'ViewName`. Microsoft.SqlServer.Smo)

I get this error when I right click on the View > Script View As > Alter to > New Query Editor Window

enter image description here

Also, when I try to stored procedure, I get the same error listed above

I get this error when I right click on the View > Script Stored Procedure As > Alter to > New Query Editor Window

I tried to use SP_HELPTEXT 'ViewName' this will give me the content of the view. But why is the GUI is not working on this PC but working on my work PC?

How can I correct this issue?

How can I fix this issue?

Jaylen
  • 39,043
  • 40
  • 128
  • 221
  • I believe you extract the text from `SP_HELPTEXT`, analyze the text to see for any issues with your code. When you extract the text and paste it in a query window, you should be able to figure out easily the issue. It may be some multi-line comments not in proper order. Try to change the SP using modified text and then try these steps! – techspider Sep 23 '16 at 18:52
  • Generate the script as Create To, then change the "Create" to "Alter". This should get around that error. – SS_DBA Sep 23 '16 at 18:53
  • @WEI_DBA that worked but how can I fix that issue? – Jaylen Sep 23 '16 at 18:56
  • 1
    Possible duplicate of [SQL Server Management Studio Error : Script failed for UserDefinedFunction](http://stackoverflow.com/questions/8731038/sql-server-management-studio-error-script-failed-for-userdefinedfunction) – techspider Sep 23 '16 at 18:56
  • I'm assuming that you are connecting to a previous version of MSSQL. This might be known bug in SSMS 2016. Not positive. – SS_DBA Sep 23 '16 at 19:01
  • 2
    indeed it is a bug https://connect.microsoft.com/SQLServer/feedback/details/3103831/ssms-2016-16-4-fails-when-attempting-to-alter-modify-a-stored-procedure-syntax-error-in-textheader-of-storedprocedure – Jaylen Sep 23 '16 at 19:01
  • Yes... and just opened 3 days ago. – SS_DBA Sep 23 '16 at 19:08
  • Lots of ridiculous bugs being reported with the latest release of SSMS. – S3S Sep 23 '16 at 20:00
  • Possible duplicate of [SSMS stopped loading my stored procedures after update](http://stackoverflow.com/questions/39623876/ssms-stopped-loading-my-stored-procedures-after-update) – AHiggins Sep 26 '16 at 15:48

0 Answers0