Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
spsofbrandscape

spsofbrandscape

Ratings: (0)|Views: 6|Likes:
Published by biswajitd

More info:

Published by: biswajitd on Dec 02, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

06/17/2009

pdf

text

original

 
1)SET QUOTED_IDENTIFIER ONGOSET ANSI_NULLS ONGO--EXEC VENDORDETAILS_InsertOrUpdate '0','Vendorname','specialization descriptiongoes there','1','1','details added','0','1.bmp,2.jpeg'ALTER PROC VENDORDETAILS_InsertOrUpdate(@VendorIDINT,@VendorNameVARCHAR(50),@SpecializationTEXT,@CountryINT,@CityINT,@DetailsTEXT,@DeleteFlagBIT,@VendorImagesVARCHAR(50))ASBEGINDECLARE @ReturnValue INTIF EXISTS (SELECT VendorName FROM tbl_VendorDetails WHEREVendorName=@VendorName AND VendorID<>@VendorID and deleteflag=0)BEGINSET @ReturnValue=50000ENDELSEBEGINIF EXISTS (SELECT VendorID FROM tbl_VendorDetails WHEREVendorID=@VendorID and deleteflag=0)BEGINBEGIN TRANSACTION updateVendorTransactionUPDATE tbl_VendorDetailsSET VendorName =@VendorName,Specialization = @Specialization,Country =@Country,City = @City,Details = @Details,VendorImages = @VendorImagesWHERE VendorID=@VendorIDIF(@@ERROR>0)BEGINROLLBACK TRANSACTIONupdateVendorTransactionSET @ReturnValue=@@ERRORENDELSEBEGINCOMMIT TRANSACTIONupdateVendorTransactionSET @ReturnValue=50002ENDEND
 
ELSEBEGINIF EXISTS (SELECT VendorName FROMtbl_VendorDetails WHERE VendorName=@VendorName and deleteflag=0)BEGINSET @ReturnValue=50000ENDELSEBEGINBEGIN TRANSACTIONInsertVendorTransactionINSERT tbl_VendorDetails(VendorName,Specialization,Country,City,Details,DeleteFlag,VendorImages)VALUES(@VendorName,@Specialization,@Country,@City,@Details,@DeleteFlag,@VendorImages)IF (@@ERROR>0)BEGINROLLBACK TRANSACTIONInsertVendorTransactionSET@ReturnValue=@@ERRORENDELSEBEGINCOMMIT TRANSACTIONInsertVendorTransactionSET @ReturnValue=50001ENDENDENDENDSELECT @ReturnValueENDGOSET QUOTED_IDENTIFIER OFFGO
 
SET ANSI_NULLS ONGO2)
 
ALTER function xp_SplitStr(@String nvarchar (4000),@Delimiter nvarchar (10))returns @ValueTable table ([Value] nvarchar(4000))begindeclare @NextString nvarchar(4000)declare @Pos intdeclare @NextPos intdeclare @CommaCheck nvarchar(1)set @NextString = ''set @CommaCheck = right(@String,1)set @String = @String + @Delimiter set @Pos = charindex(@Delimiter,@String)set @NextPos = 1 while (@pos <> 0)beginset @NextString = substring(@String,1,@Pos - 1) insert into @ValueTable ( [Value]) Values (rtrim(ltrim(@NextString) )) set @String = substring(@String,@pos +1,len(@String)) set @NextPos = @Posset @pos = charindex(@Delimiter,@String)end returnendselect * from TBL_NEWS tn, tbl_Therapymaster th where th.Therapyname = 'InFocus' and th.TherapyId = tn.TherapyId and tn.deleteflag =0and th.Status = 1and tn.NewsID not in(SELECT top 1 tn.NewsID FROM TBL_NEWS tn,tbl_Therapymaster th WHERE th.Therapyname = 'In Focus' and th.TherapyId =tn.TherapyId and tn.deleteflag =0 and th.Status = 1 ORDER BY tn.NewsID DESC)ORDER BY tn.NewsID DESCselect * from tbl_Training where isactive=1 and trainingid not in(select top 5 trainingid from tbl_Training where isactive=1Order by TrainingId desc)Order by TrainingId desc

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->