CREATE PROCEDURE

G

Guest

I'm attempting to write a simple CREATE PROCEDURE statement (in anticipation
of more complex ones later), eg.:
CREATE PROCEDURE proc1 AS SELECT guild_cd FROM guild;
No matter how I structure the statement, I get the error message 'Syntax
error in CREATE TABLE statement.' I get the same error when I try CREATE VIEW
as well.
Suggestions? Thanks.
 
M

[MVP] S.Clark

I assume you're doing this in the Enterprise Manager UI. If so, then just
comment out the code until you're really ready to use it.
 
G

Gary Walter

Hi David,

PMFBI

So many variables in what you
*might* be doing .... :cool:

1) You cannot do this in query designer (DAO)

http://support.microsoft.com/default.aspx?scid=kb;en-us;201493
http://support.microsoft.com/default.aspx?scid=kb;en-us;202116

As a "quick-and-dirty" one time thing,
in Immediate Window of Debug Window (CTRL + G)
you "could" define your string and execute through ADO...
(type each line and hit ENTER key)

strProc="CREATE PROCEDURE proc1 AS SELECT guild_cd FROM guild;"
CurrentProject.Connection.Execute strProc

if "guild" is a SQL Server table,
I believe you will need to add "dbo."

strProc="CREATE PROCEDURE proc1 AS SELECT guild_cd FROM dbo.guild;"
CurrentProject.Connection.Execute strProc

Apologies again for butting in,

gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top