Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Error executing SQL function

Author  Topic 

Snigdha030
Starting Member

13 Posts

Posted - 2007-06-18 : 09:41:13
While executing the function below I am getting the following error -
The column prefix 'dbo' does not match with a table name or alias name used in the query.

Please advice.



Here is a piece of example code:


create table tabtest(a int, b int)
insert into tabtest values(1,8)
insert into tabtest values(2,9)



Alter function fn_test()
returns int
AS
BEGIn
declare @b int

--select @b = usgaap_centrac.dbo.tbl_SuspTransactionTypes.TransID from usgaap_centrac.dbo.tbl_SuspTransactionTypes
select @b = b from tabtest where a = 1
return (@b)
END


select dbo.fn_test

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-06-18 : 09:44:26
[code]select dbo.fn_test()[/code]


KH

Go to Top of Page

Snigdha030
Starting Member

13 Posts

Posted - 2007-06-18 : 09:48:37
Thanks.
Go to Top of Page
   

- Advertisement -