Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot Create Table?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00544271
Message ID:
00544616
Vues:
24
>I am using MSSQL7 and put the following code in a SP to create a table based on some columns from an already existing table.
>
>Select
>Convert(int,'0000') as cvi_company ,
>Convert(Char(9),'Unknown') as cvi_vendor ,
>Convert(Char(15),'xxxxxxxxxxxxxxx') as cvi_edi_nbr ,
>AP Invoice.Invoice Number
>From DevFWap.AP Invoice
>Into DEVFWap.apcinvoice
>
>I get an error "Incorrect Syntax near '.'"
>
>Huh? Help?

You seems to have spaces into your field/table name. You need to enclose your names between square brackets if they contains invalid characters.
Select
Convert(int,'0000') as cvi_company ,
Convert(Char(9),'Unknown') as cvi_vendor ,
Convert(Char(15),'xxxxxxxxxxxxxxx') as cvi_edi_nbr ,
AP Invoice.[Invoice Number]
From DevFWap.[AP Invoice]
Into DEVFWap.apcinvoice
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform