I have a table-valued function (TVF) in SQL Server that looks like this:
CREATE FUNCTION TVF_xyz(@AuditKey INT)
RETURNS TABLE
AS
RETURN
SELECT *
FROM xyz
WHERE AUDIT_KEY = @AuditKey
GO
Now, I added a new column to the xyz
table.
When I query using TVF_xyz
, it doesn't show me the new column (shows all other columns except newly added).
Query:
SELECT TOP 10 *
FROM TVF_xyz (1543)
I would like to know, how to refresh TVF to show new column.
PS: Select *
used in TVF to fetch all columns.