CREATE PROCEDURE

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
Hi David,

PMFBI

So many variables in what you
*might* be doing .... 8-)

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
 
Back
Top