|
From: Roy Harvey (SQL Server MVP) on 15 Jul 2008 12:22 The first issue you have to correct is that the qualified name requires single quotes around it. This could fail, but I don't see how it could fail with the "Incorrect syntax near '.'." error. EXEC sp_help 'dbo.myFunction' The [square brackets] are optional if the names follow the standard naming conventions, but the single quotes are mandatory when there is any prefix qualifier such as dbo. Perhaps the problem is that it simply does not find the function, yet this does: EXEC sp_help myFunction One explanation for that would be that myFunction is not owned by dbo, but instead by the user executing the sp_who. Roy Harvey Beacon Falls, CT On Tue, 15 Jul 2008 07:08:24 -0700 (PDT), Author <gnewsgroup(a)gmail.com> wrote: >use [mydb] >go >sp_help dbo.myFunction > >Msg 170, Level 15, State 1, Line 1 >Line 1: Incorrect syntax near '.'. > >but the following executes with no problem. > >use [mydb] >go >sp_help myFunction > >I've noticed this problem for a long time with system stored >procedures, there must be a reason. Please give me a hint. > >Thanks a lot.
From: Roy Harvey (SQL Server MVP) on 15 Jul 2008 14:16 On Tue, 15 Jul 2008 10:41:10 -0700 (PDT), Author <gnewsgroup(a)gmail.com> wrote: >On my system, the following versions work: > >sp_help '[dbo].[myFunction]' >sp_help 'dbo.myFunction' >sp_help myFunction >sp_help 'myFunction' > >Versions below don't work: > >sp_help [dbo].[myFunction] >sp_help dbo.myFunction And the explanation is that when there is a period qualifier the entire string must be inside single quotes. The two examples that don't work have the period, but not the quotes. Roy Harvey Beacon Falls, CT
|
Pages: 1 Prev: T-SQL Query Help Next: Lookup table structure preferences |