Viewing 15 posts - 31 through 45 (of 73 total)
I Missed two more joins (part of PK) in my earlier post. am updating the Kingstons final query to get the correct result.
;with cte1 as(select ROW_NUMBER() OVER(ORDER BY Index_code)...
June 25, 2010 at 2:00 am
can you tell the exact business requirement for this, i think the result you stated now differs from the original post. we can help if you post the requirement
anyway ,try...
June 25, 2010 at 12:11 am
Try posting sample DDL and DML everytime for quick answers..check if below helps..
IF OBJECT_ID('TempDB..#Ixtable','U') IS NOT NULL
DROP TABLE #Ixtable
CREATE TABLE #Ixtable
(Index_code varchar(20),Code1 int,Code2 Int,Startdate Datetime,EndDate Datetime)
Insert into #Ixtable
...
June 24, 2010 at 1:25 am
Post DDL, DML statements in readily consumable format for faster response...
June 24, 2010 at 12:25 am
am afraid with the subject tag "SQL Doubt -1". OP may have series of interview questions..." SQL doubt -2" etc...;-)
June 23, 2010 at 11:05 pm
Thanks Grant..Powershell scripts seems to be better option...
June 17, 2010 at 1:01 am
check if below code works for you..
declare @test-2 table(Col1 int,Col2 decimal(5,2),Col3 varchar(100))
insert into @test-2 select 11111,-1,'AAAAA'
union all
select 11112,-2.4567,'BBBBBB'
union all
select 11113,-3.17,'CCCCC'
union all
select 11114,-1,'DDDDD'
union all
select 11115,-0.2,'EEEEEE'
select Col1,left(col2,charindex('.',Col2)-1),col3 from...
June 3, 2010 at 10:48 pm
check if below code works..it definitely NOT faster as it uses cursor approach, but it should give the result you expected..
Declare @vchrFileName varchar(255)
Declare @vchrSQLStr varchar(2000)
set ansi_warnings off
create table #IndexScan1 (ObjName...
June 2, 2010 at 12:53 am
Check out this..
create table #CDS(CDID int,CDName varchar(50))
insert into #CDS select 1,'cd-a'
union all
select 2,'cd-b'
union all
select 3,'cd-c'
union all
select 4,'cd-d'
create table #CDOrders(CDOrdereddate datetime,CDid int)
insert into...
May 26, 2010 at 1:06 am
you need to have tally table in your database before running below query ...check the last link in chris morris signature for Tally table..
DECLARE @startDate datetime
DECLARE @endDate datetime
...
May 21, 2010 at 4:05 am
Thanks...its works..your help always ontime for me..
May 18, 2010 at 12:28 am
Thanking all who responded...i got very useful info...
May 10, 2010 at 12:17 am
Kingston..yours code works like a champion...thanks a lot..
May 7, 2010 at 6:13 am
Viewing 15 posts - 31 through 45 (of 73 total)