Skip to main content
2 of 4
added additional case that does not work.
JJS
  • 721
  • 1
  • 5
  • 17

what allows ssms to trade an object name for a string passed to a system procedure

what causes it to be legal for one to pass an object name to the system stored procedure sp_helptext. What mechanism converts the object name to a string?

e.g.

sp_helptext myproc
sp_helptext [myproc]
sp_helptext 'myproc'
sp_helptext 'dbo.myproc'
sp_helptext [dbo.myproc]

-- does not work
sp_helptext dbo.myproc -- Msg 102, Level 15, State 1, Line 1 incorrect syntax near '.'
2016-11-21 discovered an additional case that does not work.
sp_helptext [dbo].[myproc] -- Msg 102, Level 15, State 1, Line 1 incorrect syntax
JJS
  • 721
  • 1
  • 5
  • 17