Which is what I am looking for, if it doesn't exist to create it... I am
new to storedprocs. Although I know the syntax I haven't used them much
with CF yet...


> -----Original Message-----
> From: Andy Ewings [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 16 July 2001 11:14 PM
> To: CF-Talk
> Subject: RE: Stored Procedures
>
> Never tried it, you may have to put semi colons at the end of every
sql
> statement if ODBC terms them as separate SQL stements.  I would
suggest that
> you write and call an SP that creates SP's for you.
>
> -----Original Message-----
> From: Andrew Scott [mailto:[EMAIL PROTECTED]]
> Sent: 16 July 2001 14:09
> To: CF-Talk
> Subject: RE: Stored Procedures
>
>
> So you are saying I could do this then....
>
> <cfquery name="sp_Adduser" datasource="datasource">
>       IF not EXISTS (SELECT * FROM sysobjects WHERE name =
> "sp_Adduser1" AND type = "P")
>       CREATE PROCEDURE sp_AddUser
>        @username varchar(50),
>        @password varchar(12),
>        @Firstname varchar(50),
>        @Familyname varchar(50),
>        @ID varchar(50),
>        @ID_Member varchar(50) output
>       AS
>        set nocount on
>        if not exists (select ID_Member from Members where Username =
> @username)
>         begin
>          insert into
> Members(ID_Member,Username,Password,Firstname,Familyname)
>          values (@ID,@username,@password,@Firstname,@Familyname)
>          select @ID_Member = @ID
>         end
>        else
>         select @ID_Member = -1
>        return
>       END
> </cfquery>
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to