0

私はSQLServer 2005で次の関数を書きました

以下が機能です。

create function fnBillParticulars()
return table
as
return (select * from billParticulars where Id='2425')
go

次のエラーが表示されます:

1.Msg 156, Level 15, State 1, Procedure fnBillParticulars, Line 2
  Incorrect syntax near the keyword 'return'.

2.Msg 178, Level 15, State 1, Procedure fnBillParticulars, Line 4
  A RETURN statement with a return value cannot be used in this context.

間違いは何ですか?

私を助けてください。

4

3 に答える 3

1

U written "where" Twice in the query.

query should be:

select * from billParticulars where Id='2425'

and use "returns" table

create function fnBillParticulars()
returns table
as
return (select * from billParticulars where Id='2425')
go
于 2013-05-16T09:55:01.073 に答える