I’m trying to create a new table from a select but it isn’t working.
Here is my syntax
select *
into newtable
from oldtable
where oldtable.number=2
Then, when I try to use it
select * from newtable
it tells me that newtable is an invalid object.
Are you in the right database, and not in the master?
Try this:
If newtable has a red underline, you can still select from it. The underline just means that the table name is not cached. You can rebuild IntelliSense by pressing CTRL+SHIFT+R and the underline will disappear.
Hope this helps.