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
Showing posts with label active. Show all posts
Showing posts with label active. Show all posts
Thursday, March 29, 2012
Thursday, March 8, 2012
Cumulative Hotfix Package - Build 2153
I'm getting ready to install the Cumulative Hotfix Package - Build 2153 on a 2-node, Active/Passive cluster (MSSQL 2005 EE on Windows 2003). I've read through the docs a number of times but don't see any reference to clustering. Should I apply the hotfixes to each node or are the fixes cluster-aware?
Thanks.I also have a 2-node Active/Passive cluster (MSSQL 2005 64-bit on Windows 2003). I would like to apply the cumulative hotfix, but I too have not found any documentation specific to a clustered installation. Did you install the hotfix on your cluster? If yes, did you have any issues?
Cumulative Hotfix Package - Build 2153
I'm getting ready to install the Cumulative Hotfix Package - Build 2153 on a 2-node, Active/Passive cluster (MSSQL 2005 EE on Windows 2003). I've read through the docs a number of times but don't see any reference to clustering. Should I apply the hotfixes to each node or are the fixes cluster-aware?
Thanks.
I also have a 2-node Active/Passive cluster (MSSQL 2005 64-bit on Windows 2003). I would like to apply the cumulative hotfix, but I too have not found any documentation specific to a clustered installation. Did you install the hotfix on your cluster? If yes, did you have any issues?
Friday, February 24, 2012
Ctrl+Tab not working
Having an issue with the navigation keys. When I first installed Studio I could Hold Ctrl and tab through the active windows, then on releasing the buttons I would move to that active window. Now when I press Ctrl+Tab the list will come up, but wont jump to the screen I end on. The quick link window will stay up and the only way I can transfer windows is hitting Enter or clicking on the desired window with my mouse. Any ideas on this "seemingly simple" issue. I went through all of the Tools -> Options window with no luck.Moving to the tools group.
Subscribe to:
Posts (Atom)