I have a table variable with two columns. The first column is the value that I am trying to populate while the second value is populated by executing the stored procedure.
CREATE PROCEDURE [dbo].userProfiles (@userID INT) AS BEGIN DECLARE @sampleTable TABLE (moduleName VARCHAR(20), userProfile int) INSERT INTO @sampleTable('userprofile', exec getUserProfile(@userID)) SELECT * FROM @sampleTable END
However, I keep getting this error whenever I try to execute a stored procedure:
Level 15, State 1, UserProfiles Procedure, Line 9
[Microsoft] [ODBC SQL Server Driver] [SQL Server] Invalid syntax next to "userprofile".
Any help would be well appreciated.
Thanks in advance
source share