Click here to Skip to main content
       

ASP.NET

 
AnswerRe: What is the web.config for the <smtp> ? [modified] PinmemberCommDev28-Dec-12 21:38 
QuestionImage album category wise PinmemberMember 776731127-Dec-12 7:30 
AnswerRe: Image album category wise PinmvpSandeep Mewara28-Dec-12 21:24 
QuestionCapsLock detection Pinmembertpkpradeep27-Dec-12 0:04 
AnswerRe: CapsLock detection PinmemberAnalogNerd27-Dec-12 3:56 
AnswerRe: CapsLock detection [modified] PinmemberCommDev28-Dec-12 21:50 
QuestionApplication Layering PinmemberOmersayeed26-Dec-12 2:31 
QuestionSyntax error in store procedure Pinmemberanubhaw.gupta25-Dec-12 22:06 
here is my piece of code
 
alter procedure mdi_anu
(
@entry_date varchar(20),
@updated_date varchar(20),
@status varchar(20),
@cno varchar(20),
@eno varchar(20))

as

declare @SQL varchar(max)
set @SQL='SELECT * FROM anu123 where 1=1 '

if (@status='ALL')
begin
set @status='ALL'
end

if (@status='A')
begin
set @status='A'
end

if (@status='R')
begin
set @status='R'
end

if (@status='D')
begin
set @status='D'
end

if (@status='P')
begin
set @status='P'
end
 

 



if (@entry_date<>'' and @updated_date<>'')
begin

set @entry_date =CONVERT (datetime, @entry_date, 103)
set @updated_date= CONVERT(datetime, @updated_date, 103)
set @SQL=@SQL+'and entry_date>=''' +@entry_date+'''and updated_date<='''+@updated_date+''''
end

if (@cno<>'')
begin
set @cno=@cno
set @SQL=@SQL+'and cno=''' +@cno
end
 

if (@eno<>'')
begin
set @eno=@eno
set @SQL=@SQL+'and eno=''' +@eno
end
 
exec (@SQL)
End
 

Can anyone tell me,where am wrong? stuck from 2 hr. Saying incorrect syntax near the last end Hmmm | :|
AnswerRe: Syntax error in store procedure PinmemberSravanthid2825-Dec-12 22:21 
GeneralRe: Syntax error in store procedure Pinmemberanubhaw.gupta25-Dec-12 22:40 
AnswerRe: Syntax error in store procedure Pinmemberanubhaw.gupta25-Dec-12 22:45 
GeneralRe: Syntax error in store procedure Pinmembersathish s26-Dec-12 1:39 
GeneralRe: Syntax error in store procedure PinmemberZafar Sultan26-Dec-12 3:31 
Questionid or guid.. which one? PinmemberJassim Rahma25-Dec-12 7:22 
AnswerRe: id or guid.. which one? PinmvpSandeep Mewara25-Dec-12 19:14 
AnswerRe: id or guid.. which one? [modified] PinmemberCommDev25-Dec-12 19:25 
Questionwhy should I care about ExecuteScalar PinmemberJassim Rahma25-Dec-12 5:57 
AnswerRe: why should I care about ExecuteScalar PinmvpSandeep Mewara25-Dec-12 19:30 
AnswerRe: why should I care about ExecuteScalar PinmemberCommDev25-Dec-12 19:33 
AnswerRe: why should I care about ExecuteScalar PinmemberCommDev25-Dec-12 19:40 
GeneralRe: why should I care about ExecuteScalar PinmemberJassim Rahma28-Dec-12 9:40 
GeneralRe: why should I care about ExecuteScalar PinmemberNaveen Katta26-Dec-12 0:10 
Questiona control that should contain html elements [modified] PinmemberAli Al Omairi(Abu AlHassan)23-Dec-12 23:01 
QuestionRe: a control that should contain html elements Pinmemberjkirkerx24-Dec-12 13:09 
AnswerRe: a control that should contain html elements PinmemberAli Al Omairi(Abu AlHassan)25-Dec-12 19:51 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.141022.2 | Last Updated 25 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid