AccessSQLUser
Programmer
Can variables be declared in an Inline Table-Valued function?
What I want to do is create a function that accepts a parameter called "DatabaseName" and then it will return a set of records from a table in that database.
CREATE FUNCTION UserStoredProcedures
(@DatabaseName sqlvariant)
RETURNS table
AS
RETURN (
SELECT name
FROM @DatabaseName..sysobjects
WHERE type = 'P' and status >= 0
)
But this doesn't work obviously but I can't put the statement in a string and then execute it either?
What do you suggest?
What I want to do is create a function that accepts a parameter called "DatabaseName" and then it will return a set of records from a table in that database.
CREATE FUNCTION UserStoredProcedures
(@DatabaseName sqlvariant)
RETURNS table
AS
RETURN (
SELECT name
FROM @DatabaseName..sysobjects
WHERE type = 'P' and status >= 0
)
But this doesn't work obviously but I can't put the statement in a string and then execute it either?
What do you suggest?