I have a view that I'd like to create a table from in a query. I'd also like to add a primary key to the table, I was thinking something like the following:
SELECT *
, PK INT IDENTITY(1,1) PRIMARY KEY
INSERT INTO TESTTABLE
FROM my_view
SELECT * FROM TESTTABLE
DROP TESTTABLE
The above does not work, so...
a) is it possible and b) if so, how?
Thank you,
viewitself and call it when needed?