Refactor Select Into Statement as Create and Insert
I would like an efficient way to refactor this kind of statement...
SELECT ID, Name, Job INTO #Employee FROM Employees
into something like this-
CREATE TABLE #Employee (ID int, Name varchar(max), Job varchar(max))
INSERT INTO #Employee
SELECT ID, Name, Job
FROM Employees
The PE003 rule keeps triggering on these statements but it takes an annoyingly long time to write out the column definitions by hand for longer tables.
2
votes
Anonymous
shared this idea