Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Incorrect Syntax?
Message
From
31/07/2013 14:39:09
 
 
To
31/07/2013 14:36:37
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 6.5 and older
Application:
Web
Miscellaneous
Thread ID:
01579562
Message ID:
01579564
Views:
48
>What is wrong with this statment?
>
>
>
>declare @temp table (Zip varchar(5), xYear varchar(4), xQuarter varchar(1));
>
>insert into @temp (zip,xyear,xquarter) values Select substring(PropertyZip,1,5), SUBSTRING(xYear,1,4), SUBSTRING(xQuarter,1,1)
> from [Foreclosure Notices];
>
>
>I am getting a Incorrect Syntax near SELECT keyword. All look correct to me.

You can't have VALUES and SELECT at the same time.
insert into @temp (zip,xyear,xquarter)
Select substring(PropertyZip,1,5), SUBSTRING(xYear,1,4), SUBSTRING(xQuarter,1,1) from [Foreclosure Notices];
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform