I have a function where I return a table and I get the error "Operand type clash: uniqueidentifier is incompatible with int." when I try to create the function. For example
Create function myFunction(
@parameterInt int
)
Returns @retTable
TABLE(
invoiceNumber int,
other varchar(32)
)
AS
BEGIN
INSERT INTO @retTable
SELECT invoiceNumber, other
from invoices where id = @parameterInt
RETURN
END
go
What is causing this error? Thanks in advance.
Create function myFunction(
@parameterInt int
)
Returns @retTable
TABLE(
invoiceNumber int,
other varchar(32)
)
AS
BEGIN
INSERT INTO @retTable
SELECT invoiceNumber, other
from invoices where id = @parameterInt
RETURN
END
go
What is causing this error? Thanks in advance.