Skip to content
Advertisement

Assign Data to a User-Defined Table type from Select Query?

I have a stored procedure which retrieves three columns from multiple tables. I want to get the results in a user defined multi-valued table and pass the variable to another procedure to perform operations on the variable data.

However it is not working. Any idea why it this not working?

Advertisement

Answer

The problem is here:

Should be:

There is no need to defining columns where type is defined, and INSERT require INTO clause. After that change your code works.

SqlFiddleDemo

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement