Viewing 15 posts - 286 through 300 (of 1,114 total)
I also test the below query.
SELECT CONVERT(CHAR(8),DATE_TIME)
FROM TBL
Test1:
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server parse and compile...
March 10, 2009 at 12:45 am
[font="Verdana"]
Jeff,
I did a small R&D to know which method is good performance wise.
CREATE TABLE TBL
(
N INT,
DATE_TIME VARCHAR(30)
)
insert into TBL
Select n,'200702071630+1100'as DATE_TIME
from tally
I have executed the above script for 11 times....
March 10, 2009 at 12:40 am
As sergiy told, create clustered index on DATE column. It may help and reduce the execution time.
if you post the table structure with some sample data, you will get some...
March 10, 2009 at 12:15 am
is there any option to set the datefirst server level instead of sesssion level?
March 10, 2009 at 12:02 am
You can use BREAK statement. But as Gail told, it should be useful to you, if you post the code.
But i did some test to come out from the cursor....
March 9, 2009 at 5:51 am
create table test
(
col1 varchar(10),
col2 varchar(10)
)
go
insert into test
select 'aa','ram'
union all
select 'bb','ram'
union all
select 'cc','ravi'
union all
select 'dd','rahi'
go
select max(col1)as col1,col2
from test
group by col2
output:
col1 col2
ddrahi
bbram
ccravi
March 9, 2009 at 5:39 am
Can you post the table structure with sample data?
March 9, 2009 at 4:34 am
set datefirst 5 will do that.
But it is session based. If you open another session, you can see 7.
March 9, 2009 at 12:57 am
Chris Morris (3/6/2009)
karthikeyan (3/6/2009)
I just wanted to know what about my solution? won't it be a god solution? I think 'YES'. Becuase i have used UPPER...
March 6, 2009 at 4:57 am
Thanks a lot to all.
I just wanted to know what about my solution? won't it be a god solution? I think 'YES'. Becuase i have used UPPER function. Right? UPPER...
March 6, 2009 at 3:48 am
Chris!
It is perfect! Thanks!
I still need some help.
employee's daily working hrs will be captured in Dlywork table
create table Dlywork
(
eno int,
dt datetime,
dlyhr decimal(4,2)
)
insert into Dlywork
select 10,'02/mar/2009',8
union
select 10,'03/mar/2009',8
union
select 10,'04/mar/2009',8
union
select 10,'05/mar/2009',8
union
select 10,'06/mar/2009',8
union
select 10,'27/feb/2009',9
union
select...
March 6, 2009 at 3:36 am
Oh...i think I forgot to mention...the user may choose more than one dept or age or eno.
March 5, 2009 at 8:57 am
I got the below output
10Acct40
20Corp40
100Corp35
400Corp25
March 5, 2009 at 5:28 am
Michael Valentine Jones (3/3/2009)
Chris Morris (3/3/2009)
DROP TABLE #Dates
CREATE TABLE #Dates (aDate DATETIME)
INSERT INTO #Dates
SELECT TOP 100 DATEADD(dd,DATEDIFF(dd, 0, getdate()),50-number)
FROM Numbers...
March 4, 2009 at 2:00 am
Viewing 15 posts - 286 through 300 (of 1,114 total)