views:

28

answers:

2

I am working on a scalar value function in MSSQL 2008. I created it and It is shown in object Explorer But when I use this function in MS Query Analyzer It gave me error

**Msg 208, Level 16, State 3, Line 1

Invalid object name 'calculatecptcodeprice'.**

For Me this type of error after creating Function is new. What went wrong. Please Help, I restarted the SQL Services, but no avail.

Thanks In Advance

Sheeraz

+2  A: 

Edit: Actually I can get this error message by using a scalar function as if it was a table valued function.

Don't use

SELECT * from [dbo].[calculatecptcodeprice] (...)

Use

SELECT  [dbo].[calculatecptcodeprice] (...)

Other things to check

  1. Permissions
  2. You are prefixing the function with the schema name when you use it.
  3. You are trying to use it from within the same database as you created it.
Martin Smith
A: 

Thanks Martin.. Really Appreciated Problem is solved

Sheeraz