|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Error message received for any Create Function
Have we missed a setting somewhere?
We are having trouble getting even the simplist FUNCTION to pass the syntax check in either the Enterprise Manager or the SQL Query analyser. The examples we are using come from the online library and other tutorial sites. I'm logged in as sa. The errors arealways the same : Code: CREATE FUNCTION CubicVolume -- Input dimensions in centimeters (@CubeLength decimal(4,1), @CubeWidth decimal(4,1), @CubeHeight decimal(4,1) ) RETURNS decimal(12,3) -- Cubic Centimeters. AS BEGIN RETURN ( @CubeLength * @CubeWidth * @CubeHeight ) END Result : Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'FUNCTION'. Server: Msg 137, Level 15, State 1, Line 8 Must declare the variable '@CubeLength'. |
|
#2
|
|||
|
|||
|
Check the version and the compatibilty level. Functions are supported in SQL server 2000 only.
http://msdn.microsoft.com/library/d..._da-di_5c8c.asp |
|
#3
|
|||
|
|||
|
Excellent answer
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Error message received for any Create Function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|