திங்கள், 8 ஜூலை, 2013

ssrs: the variable name has already been declared -- when working with temp tables


   1: declare @Marcus table
   2:     (
   3:         resourceid nvarchar(10),
   4:         name nvarchar(255)
   5:     )
   6:  
   7: insert into @marcus
   8: select resourceid,name0 from v_r_system
   9:  
  10: select * from @marcus

when executed in sql server management studio, the query runs as expected.  it just grabs resourceid and system name, puts them into a temporary table, and draws them right back out.  however, when executed in bids (business intelligence development studio), you receive the error stating "the variable name has already been declared. variable names must be unique within a query batch or stored procedure."
 discovered that while windows is decidedly case insensitive, sometimes it changes its mind.  in visual studio (bids, etc) it appears that the case used for variables with respect to temporary tables is sensitive!
so, back to the simple query, here's the revised change.  just keep your case the same.
   1: declare @Marcus table
   2:     (
   3:         resourceid nvarchar(10),
   4:         name nvarchar(255)
   5:     )
   6:  
   7: insert into @Marcus
   8: select resourceid,name0 from v_r_system
   9:  
  10: select * from @Marcus

வியாழன், 4 ஜூலை, 2013

Zip the file using VB.net with Password

 Dim ret As Long
ret = Shell("C:\Program Files\WinRAR\rar a -ap C:\ZipFileSave\test_22.zip -psrini D:\Report")


Password :-> srini
source folder :->D:\Report
Destination folder :->C:\ZipFileSave
Filename :test_22.zip


செவ்வாய், 2 ஜூலை, 2013

Send Email from SQL server Table format


How to access linked server user defined functions in SQL Server

Select * from Openquery( Linked server name ,'select * from [TESTDB].[dbo].[tblname] where id=[TESTDB].[dbo].GETID(600)')

Trying to save Excel vb.net - Exception from HRESULT: 0x800A03EC


 .ActiveWorkbook.SaveAs(path2)
Instead of saving file like above , save like below.

 .ActiveWorkbook.Saved = True
 .ActiveWorkbook.SaveCopyAs(path2)