Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > DotNetNuke > BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6
This is the forum to discuss the Wrox book Professional DotNetNuke ASP.NET Portals by Shaun Walker, Patrick J. Santry, Joe Brinkman, Dan Caron, Scott McCulloch, Scott Willhite, Bruce Hopkins; ISBN: 9780764595639
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 31st, 2006, 11:41 PM
Registered User
 
Join Date: Oct 2006
Location: , , USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help with Creating Procedures Script in SQL

I used this script to generate tables. The tables generated fine, now when I try to run the script for stored procedures it generates errors. Hope this is the right forum. I am running this in a script in the Dot Net Nuke CSM.

Here is the script for the tables, this runs fine and generates the table:

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}YourCompany_AUDIX]') and OBJECTPROPERTY(id, N'IsTable') = 1)

DROP TABLE {databaseOwner}[{objectQualifier}YourCompany_AUDIX]
GO
CREATE TABLE {databaseOwner}[{objectQualifier}YourCompany_AUDIX] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[ModuleID] [int] NULL ,
[Name] [nvarchar] (50) NULL ,
[Branch] [nchar] (10) NULL ,
[HomePhone] [nchar] (10) NULL ,
[CellPhone] [nchar] (10) NULL ,
[TimeEntered] [timestamp] NULL,
[DateEntered] [datetime] NULL,
[Notes] [nvarchar] (250) NULL
) ON [PRIMARY]

ALTER TABLE {databaseOwner}[YourCompany_AUDIX] ADD
CONSTRAINT [PK_{objectQualifier}YourCompany_AUDIX] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY]



Here is the script to generate the stored procedures:

CREATE PROCEDURE {databaseOwner}[{objectQualifier}YourCompany_AUDIX_Delete]
(
@ID int
)
AS
DELETE FROM {objectQualifier}YourCompany_AUDIX
WHERE (ID = @ID)
RETURN
GO

CREATE PROCEDURE {databaseOwner}[{objectQualifier}YourCompany_AUDIX_GetAll]
(
@ModuleID int
)
AS
SELECT ID, ModuleID, Name, Branch, HomePhone, CellPhone, Notes
FROM {objectQualifier}YourCompany_AUDIX
WHERE (ModuleID = @ModuleID)
order by DateEntered DESC
RETURN
GO

CREATE PROCEDURE {databaseOwner}[{objectQualifier}YourCompany_AUDIX_Insert]
(
@ModuleID int,
@Name nvarchar(50),
@Branch nchar (10),
@HomePhone nchar (10),
@CellPhone nchar (10),
@Notes nvarchar(250)
)
AS
INSERT INTO {objectQualifier}YourCompany_AUDIX
(ModuleID, Name, Branch, HomePhone, CellPhone, Notes)
VALUES (@ModuleID,@Name,@Branch,@HomePhone,CellPhone, getdate())
RETURN
GO

CREATE PROCEDURE {databaseOwner}[{objectQualifier}YourCompany_AUDIX_Update]
(
@ID int,
@Name nvarchar(50),
@Name nvarchar(50),
@Branch nchar (10),
@HomePhone nchar (10),
@CellPhone nchar (10),
@Notes nvarchar(250)
)
AS
UPDATE {objectQualifier}YourCompany_AUDIX
SET Name = @Name, Branch = @Branch, HomePhone = @HomePhone, CellPhone = @CellPhone, Notes = @Notes, DateEntered = @DateEntered, TimeEntered = @TimeEntered
WHERE (ID = @ID)
RETURN
GO

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help On Creating a Script alexrho Beginning PHP 1 December 15th, 2005 01:16 AM
the SQL stored procedures BenCh BOOK: ASP.NET Website Programming Problem-Design-Solution 0 March 11th, 2005 03:18 PM
creating tables using sql script -howto? qwjunk SQL Server 2000 0 August 24th, 2004 09:42 AM



All times are GMT -4. The time now is 05:58 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.