MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old June 17th, 2004, 06:11 AM
Technicweb Technicweb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 47 Technicweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 48 sec
Reputation Power: 5
>> Calling an SP that inserts doesn't work??

HI,

I have written a stored proc that inserts into a mssql db, however when i try and call it I get an error. In query analyser i get

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '997'.

Does anyone know what im doing wrong?

sp:

ALTER Procedure dbo.Admin_InsertWebPage
(
@AgentID int,
@WPtitle nvarchar(150),
@WPBody text,
@WPMetaDesc varchar(255),
@WPMetaKeywords varchar(255),
@WPCreation smalldatetime,
@WPLastedited smalldatetime,
@WPsubject varchar(150),
@WPmodule int
)
As

/* THIS INSERTS NEW WebPages into the db*/

INSERT INTO tblWebPages
(
AgentId,Wptitle,WpBody,WPMetaDesc,WPMetaKeywords,WPCreation,WPLastedited,WPsubject,WPmodule
)

VALUES
(
@AgentID,@WPtitle,@WPBody,@WPMetaDesc,@WPMetaKeywords,@WPCreation,@WPLastedited,@WPsubject,@WPmodule
)


Calling code:

Admin_InsertWebPage (997,'test','test','test','test',getdate(),getdate(),'test',2)

Best regards

Technicweb

Reply With Quote
  #2  
Old June 17th, 2004, 06:45 AM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 1,762 swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 4 h 29 m 45 sec
Reputation Power: 37
Code:
Admin_InsertWebPage 997,'test','test','test','test',getdate(),getdate(),'test',2

Reply With Quote
  #3  
Old June 17th, 2004, 06:56 AM
Technicweb Technicweb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 47 Technicweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 48 sec
Reputation Power: 5
thanks but,

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ')'.

I get this now, im guessing its somethign to do with the getdate() functions.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > >> Calling an SP that inserts doesn't work??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway