Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 3
    From the link you provided this question and answer relate to the 2000 version of SQL Server. In later versions, the restriction on INSERT INTO @table_variable ... EXEC ... were lifted and so it doesn't apply for those later versions. Commented Mar 6, 2019 at 18:47
  • You are using a current version of sql server, so the link is irrelevant. The table variable restriction no longer applies (and has not applied for many years). Short answer - your code is fine though some would argue that you should always specify the column list in a insert statement. Laziness is not a good habit for a developer. Commented Mar 6, 2019 at 22:04