Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

sql: error creating a function

ALTER    FUNCTION test (
             @c1 int,
             @c2 VARCHAR(50),
           @c3 VARCHAR(10)
)
RETURNS VARCHAR(8000)AS
BEGIN

END --FUNCTION

but getting an error :

Server: Msg 208, Level 16, State 6, Procedure test, Line 24
Invalid object name 'test.

How can i fix that problem?
0
gogoshar
Asked:
gogoshar
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
Hello gogoshar,

'ALTER' is used to alter an existing function, in order to create a function use 'CREATE' instead of ALTER

CREATE Function dbo.Test (


Aneesh R
0
 
gogosharAuthor Commented:
thanks
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now