Hello.. I am starting out as a new user with Sql Server Express 2012.
I'm using the information in the AdventureWorks2012 database and
http://msdn.microsoft.com/en-us/library/ff929109.aspx
I can run a select by location from the Person.Address table as illustrated in the documentation. I want to be able to run a 'SELECT INTO' and I'm stumped on the syntax.
-- selecting around a point the 7 most closest around a defined point. USE AdventureWorks2012 GO DECLARE @g geography = 'POINT(-121.626 47.8315)';
SELECT TOP(7) SpatialLocation.ToString(), City INTO Person.AddressTest2 FROM Person.Address ORDER BY SpatialLocation.STDistance(@g) ;
Problem is in the incorporation of the 'INTO Person.AddressTest2. I get the 'No column was specified for column1' ERROR. How do I give a default name to the (No column name)?