Pankajmittal’s Blog

October 7, 2011

webservice proxy dll

Filed under: Dot Net — pankajmittal @ 10:07 am

Please run these two commands in visual studio command prompt one by one.

Wsdl /language:CS /username:sa /password:XXXXX http://192.168.1.X/serwebservice/Service.asmx /n:XXXSmsService /o:XXXSmsService.CS
After generating result run this query.

csc /t:library /out:XXXSmsService.dll XXXSmsService.CS

This will generate a class file and a dll on below path.

Go To “C:\Program Files\Microsoft Visual Studio 9.0\VC” there you will find XXXSmsService.CS and XXXSmsService.dll.

Enjoy :)

Get Comma Separated values from table without using Function

Filed under: SQL tips — pankajmittal @ 6:00 am

Hi

Many times you come across a situation where you have to convert values stored in multiple rows in a comma separated string e.g. Part consumed in a job.

Using Coalesce you can achieve the same but the drawback is that it would hit the performance significantly if you need to call this function for each row in a recordset. Actually using any function when it needs to be applied to each row will hit query performance unless the rows returned are not too many !

As an alternate to Coalesce, you can use For XML construct which will give better performance if your recordset is large.

Sample :

SELECT t1.ID ,

SUBSTRING(( SELECT ( ‘ ,’ + t2.Part )

FROM dbo.PartConsumed t2

WHERE t1.ID = t2.ID

FOR

XML PATH(”)

), 3, 500) AS PartUsed

FROM dbo.PartConsumed t1

GROUP BY t1.ID

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.