Showing posts with label assign. Show all posts
Showing posts with label assign. Show all posts

Thursday, March 29, 2012

Cursor to Array

Can you Assign a cursor to an array

For example:

Declare AuditInfo cursor
for
Select top 2 TRAKRID,MeterID,DelCount,ContactID,Type,Active,Cre atedDateTime,ModifiedBy,DateModified
from TRAKRAudit
where TRAKRID = @.ID
order by createdDatetime desc
--Print @.ID
open AuditInfo

-- Get all the newest values
fetch next From AuditInfo into Array()

Thanks
LJdeclare @.tbl table (...)
insert @.tbl Select top 2 TRAKRID,MeterID,DelCount,ContactID,Type,Active,Cre
atedDateTime,ModifiedBy,DateModified
from TRAKRAudit
where TRAKRID = @.ID
order by createdDatetime desc|||Ok this leads me to another ?

Is there any way to dynamically go through the columns in this Temp table.

The 2 records represent Old and New Values from Table1 and Table1_audit.

I am building a string:

Select @.NewStr = Coalesce(convert(varchar(25),@.MeterIDNew),'null')
Select @.NewStr = ('New MeterID = ' + @.NewStr)
Select @.OldStr = Coalesce(convert(varchar(25),@.MeterIDOld),'null')
Select @.OldStr = ('Old Meter ID = ' + @.OldStr)
Select @.StrOutput = @.StrOutput + @.NewStr + @.OldStr + Char(10)

Select @.NewStr = Coalesce(convert(varchar(25),@.MV90IDNew),'null')
Select @.NewStr = ('New MV90 ID = ' + @.NewStr)
Select @.OldStr = Coalesce(convert(varchar(25),@.MV90IDOld),'null')
Select @.OldStr = ('Old MV90 ID = ' + @.OldStr)
Select @.StrOutput = @.StrOutput + @.NewStr + @.OldStr + Char(10)
.
.
.

To put in the body of an e-mail.

Sample
-----------------------
New SCADA ID = 58 Old SCADA ID = 58
New MeterID = null Old Meter ID = null
New MV90 ID = Entergy Old Meter ID = Entergy
New Name = TestNamejon Old Name = TestNamejon
------------------------

I need to do this for 10 tables. I am looking for a way to do this programitaclly so I do not have to create a stored procedure for each of these Tables. And if the table def changes I do not have to change the SP.

Thanks for the speedy reply
LJ|||try gettin the names of the table from sysobjects (usign a cursor) and make generic code for ur process which will use the tablenames from the names in sysobject.

so u can do sumthin for as many tables as u want. with just one sp

Friday, February 17, 2012

CSS in reporting services

Hi All, I need a suggestion.
Actually I am working on a project where in we will be doing 20 - 30 SQL
Reports The Necessity is that we need to assign all the text boxes(for
captions) and the tables with a CSS so that we need not change all the
reports individually if need arises.
Can anyone please guide me in this regard, is such a thing possible.
How to assign a CSS classes for the following
. Textbox
. Tables
. Images
And where to copy the CSS File?
Thanks..On Jul 14, 4:41 am, "Vijay" <techni...@.peoplewareindia.com> wrote:
> Hi All, I need a suggestion.
> Actually I am working on a project where in we will be doing 20 - 30 SQL
> Reports The Necessity is that we need to assign all the text boxes(for
> captions) and the tables with a CSS so that we need not change all the
> reports individually if need arises.
> Can anyone please guide me in this regard, is such a thing possible.
> How to assign a CSS classes for the following
> . Textbox
> . Tables
> . Images
> And where to copy the CSS File?
> Thanks..
This link should offer your CSS customization options.
http://msdn2.microsoft.com/en-us/library/ms345247.aspx
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant