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)
 Invalid use of update within a function

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-11-07 : 08:17:39
cd writes "I have the following syntax in a function:

UPDATE dbo.autokey
SET seed = seed + 1
WHERE tbname = UPPER(@tablename)

where autokey.seed is defined as an integer, and is being used as a next record sequence.

When I try to compile this function, I get the error:


Invalid use of 'UPDATE' within a function.

But I can include the same UPDATE code in a procedure.

What am I doing wrong?"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-11-07 : 08:18:41
User defined functions may not make permanent changes to a database.
Go to Top of Page
   

- Advertisement -