Viewing 12 posts - 46 through 57 (of 57 total)
OK. I got it to work . Here is the final query
/****** Object: StoredProcedure [dbo].[proc_Site_All_KWH] Script Date: 12/17/2010 14:53:05 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[proc_Site_All_KWH]...
December 17, 2010 at 1:13 pm
/*Sorry I posted a lengthy query. Here is the short version..*/
Declare @strStartTime varchar(50), @strEndTime varchar(50)
select @strStartTime = '12/10/2010'
select @strEndTime = '12/16/2010'
select tB1.Date_Stamp, tB1.KWH B1_KWH, tB2.KWH B2_KWH
...
December 17, 2010 at 12:35 pm
Pops sorry!! I fixed it. I did not need to use the '+' in the query
This works..
Declare @strStartTime varchar(50)
select @strStartTime = '12/10/2010'
select * from Elect_SubB1_Daily B1
Where B1.Date_Stamp>= convert(datetime,...
December 17, 2010 at 11:04 am
You are right, the code (not mine) can be improved a lot.
Stuff I inherited. I will need to work on simplifying it. But for now
I want to make sure...
December 16, 2010 at 5:10 pm
Use WS_Energy
go
SET QUOTED_IDENTIFIER OFF
/* B1 Substation */
PRINT "/* B1 Substation */"
INSERT INTO Elect_SubB1_Daily
( Date_Stamp )
SELECT Elect_SubB1_15Min.DateTime...
December 16, 2010 at 1:31 pm
Your suggestion works, and it saves me from having to replace every " " with ' '. This code might be from the SQL 7 time. I am trying to...
December 16, 2010 at 1:22 pm
yes using "with replace " did the trick..
By the way, the speed I get answers that wrok at this forum is amazing..
Thanks everyone..
December 15, 2010 at 10:07 am
restore database mydb
from disk = 'd:\data\backup\mydb.bak' with replace
will overwite database at destination server..
December 15, 2010 at 9:28 am
Thanks for the feedback. Yes we can afford few hours of downtime
So possibly the detach/attach is the way to go. I am going to
Try.
December 13, 2010 at 8:29 pm
Thanks for the post. Your query worked.
DECLARE @Table NVARCHAR(200),@Column NVARCHAR(200),@Sql NVARCHAR(2000)
DECLARE Table_Cursor CURSOR FOR
SELECT so.Name AS 'Table',sc.Name AS 'Column'
FROM sys.sysobjects so...
December 12, 2010 at 6:37 pm
with cte
as (select row_number() over(partition by Date_Stamp order by Date_Stamp) as rn
from mytable)
delete from cte
where rn>1
This works for a single table
No I need to think about a way to scroll...
December 10, 2010 at 2:17 pm
I think "sp_MSForEachTable" is a good option. I will look into it.
December 10, 2010 at 1:51 pm
Viewing 12 posts - 46 through 57 (of 57 total)