Click here to Skip to main content
15,890,717 members
Home / Discussions / C#
   

C#

 
QuestionDont know how to create a storage procedure to Pin
paddymega16-Aug-12 1:39
paddymega16-Aug-12 1:39 
AnswerRe: Dont know how to create a storage procedure to Pin
Shameel16-Aug-12 1:41
professionalShameel16-Aug-12 1:41 
GeneralRe: Dont know how to create a storage procedure to Pin
paddymega16-Aug-12 3:00
paddymega16-Aug-12 3:00 
QuestionRe: Dont know how to create a storage procedure to Pin
Eddy Vluggen16-Aug-12 3:12
professionalEddy Vluggen16-Aug-12 3:12 
AnswerRe: Dont know how to create a storage procedure to Pin
paddymega16-Aug-12 5:11
paddymega16-Aug-12 5:11 
GeneralRe: Dont know how to create a storage procedure to Pin
Eddy Vluggen16-Aug-12 5:24
professionalEddy Vluggen16-Aug-12 5:24 
GeneralRe: Dont know how to create a storage procedure to Pin
paddymega16-Aug-12 6:00
paddymega16-Aug-12 6:00 
AnswerRe: Dont know how to create a storage procedure to Pin
Eddy Vluggen16-Aug-12 6:20
professionalEddy Vluggen16-Aug-12 6:20 
paddymega wrote:
Shows error near ) , god knows what error.

If it "shows", then besides God, you could know too what it says. God would speak of a syntax-error here;

SQL
CREATE PROCEDURE EDITROW (INT naim, INT aig, INT fmno, INT doab)//these are the parameters being received by the program to the procedure

@age INT,//parameters from the database no wonwards
@name VARCHAR(30),
@familymemno INT,
@DOB int,//end of parameters from the database
 
AS

UPDATE elecdb
SET naim=@name, aig=@age, fmno=@fammemno, doab=@dob
WHERE @DOB=doab; //update query
RETURN

Are @age, @name etc. part of the parameter-list? If yes, then they should be declared before the ) mark. If not, then they should be declared in the body of the stored procedure, below the "AS" keyword. Something like this probably;

SQL
CREATE PROCEDURE EDITROW (INT @naim, INT @aig, INT @fmno, INT @doab) 
AS
BEGIN
  UPDATE elecdb             // this is not a comment, this style will create a syntax error too!
     SET name=@naim,        -- this is a comment
         age=@aig,          /* or this */ 
         fammemno = @fmno, 
         dob = @doab
   WHERE dob = @doab; 
END

The parameters in the UPDATE statement (the ones with the @-sign) need to match those at the top; the other names are the fieldnames, as defined in the elecdb-table.

I'm at home, on a Linux-laptop. I could open the archive, but there's no Sql Server to run it against.
Bastard Programmer from Hell Suspicious | :suss:
if you can't read my code, try converting it here[^]

GeneralRe: Dont know how to create a storage procedure to Pin
paddymega16-Aug-12 7:29
paddymega16-Aug-12 7:29 
AnswerRe: Dont know how to create a storage procedure to Pin
Eddy Vluggen16-Aug-12 8:30
professionalEddy Vluggen16-Aug-12 8:30 
GeneralRe: Dont know how to create a storage procedure to Pin
paddymega16-Aug-12 8:36
paddymega16-Aug-12 8:36 
GeneralRe: Dont know how to create a storage procedure to Pin
Eddy Vluggen16-Aug-12 8:37
professionalEddy Vluggen16-Aug-12 8:37 
AnswerRe: Dont know how to create a storage procedure to Pin
Eddy Vluggen16-Aug-12 1:59
professionalEddy Vluggen16-Aug-12 1:59 
Questionhow to how message from window serviece Pin
ashjassi16-Aug-12 1:27
ashjassi16-Aug-12 1:27 
AnswerRe: how to how message from window serviece Pin
Eddy Vluggen16-Aug-12 1:34
professionalEddy Vluggen16-Aug-12 1:34 
AnswerRe: how to how message from window serviece Pin
Wes Aday16-Aug-12 1:35
professionalWes Aday16-Aug-12 1:35 
AnswerRe: how to how message from window serviece Pin
Shameel16-Aug-12 1:47
professionalShameel16-Aug-12 1:47 
AnswerRe: how to how message from window serviece Pin
Vijay Selvaraj26-Aug-12 22:03
Vijay Selvaraj26-Aug-12 22:03 
Questionauto sleep/wakeup windows 7 at specified times Pin
lordrt15-Aug-12 10:04
lordrt15-Aug-12 10:04 
AnswerRe: auto sleep/wakeup windows 7 at specified times Pin
Wes Aday15-Aug-12 11:13
professionalWes Aday15-Aug-12 11:13 
NewsRe: auto sleep/wakeup windows 7 at specified times Pin
Eddy Vluggen15-Aug-12 11:41
professionalEddy Vluggen15-Aug-12 11:41 
AnswerRe: auto sleep/wakeup windows 7 at specified times Pin
OriginalGriff15-Aug-12 20:42
mveOriginalGriff15-Aug-12 20:42 
AnswerRe: auto sleep/wakeup windows 7 at specified times Pin
lordrt16-Aug-12 5:38
lordrt16-Aug-12 5:38 
QuestionHaving Problem with small Function Pin
computerpublic15-Aug-12 8:11
computerpublic15-Aug-12 8:11 
AnswerRe: Having Problem with small Function Pin
Dave Kreskowiak15-Aug-12 8:14
mveDave Kreskowiak15-Aug-12 8:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.