SQL Server: creating table variable, error in primary key constraint definition

后端 未结 4 1060
遇见更好的自我
遇见更好的自我 2021-01-27 14:47

I\'m trying to create a table variable with primary key. What is the difference between these two statements? Why the first one does not work?

--This does not wo         


        
4条回答
  •  天命终不由人
    2021-01-27 14:47

    Looks like this behavior is well documented in BOL. Look at the syntax definitions for DECLARE TABLE Variable vs CREATE TABLE.

提交回复
热议问题