|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: |
IF OBJECT_ID('tempdb..#dailyCon') IS NOT NULL DROP TABLE #dailyCon
-------------------------------------------
-- create table to store values --
-------------------------------------------
create table #dailyCon
(rownum int IDENTITY (1, 1),
readingDate datetime,
RawCons int,
Cons decimal(20,6),
Scalar int,
units int,
Utility varchar (20),
accNum varchar (15),
SerialNumber int,
MTUID int)
-------------------------------------------
-- create table to store values --
-------------------------------------------
-- VARIABLE DECLARATION
declare @Proc nvarchar(200)
declare @RowCnt int
declare @MaxRows int
declare @ExecSql nvarchar(255)
declare @Day1b datetime
declare @Day1e datetime
declare @strDay1b nvarchar(50)
declare @strDay1e nvarchar(50)
-- VARIABLE DECLARATION
-- SETTING THE VARIABLES
select @RowCnt = 1
select @Proc = 'MyDB.dbo.USP_GetStuff'
select @Day1b = DATEDIFF(dd, 1, GETDATE())
select @Day1e = DATEadd(mi, 1439, @Day1b)
set @strDay1b = 'Oct 13 2009 12:00AM'
set @strDay1e = 'Oct 13 2009 11:59PM'
-- These next two rows are specific to source table or query
declare @Import1 table (rownum int IDENTITY (1, 1) Primary key NOT NULL , MTUID nvarchar(20),AccountNum nvarchar(20))
insert into @Import1 (MTUID,AccountNum) select [mtuid],AccountNum from dbo.TEST_MTUID order by MTUID
select @MaxRows=count(*) from @Import1
while @RowCnt <= @MaxRows
begin
select @ExecSql = 'insert into #dailyCon (readingDate,RawCons,Cons,Scalar,units,Utility,accNum,SerialNumber) ' + 'exec ' + @Proc + ' ' + MTUID + '' + ',1,' + '''' +@strDay1b+ '''' + ',' + '''' +@strDay1e+ '''' + ',1,2' from @Import1 where rownum = @RowCnt
--print @ExecSql
execute sp_executesql @ExecSql
Select @RowCnt = @RowCnt + 1
end
IF OBJECT_ID('tempdb..#dailyCon') IS NOT NULL DROP TABLE #dailyCon
|
Advertisement
| Hall of Fame |