Forum Replies Created

Viewing 15 posts - 31 through 45 (of 73 total)

  • RE: Query Help

    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)...

  • RE: Query Help

    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...

  • RE: Query Help

    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

    ...

  • RE: SQL JOINS

    Post DDL, DML statements in readily consumable format for faster response...

  • RE: Sql Doubt - 1

    am afraid with the subject tag "SQL Doubt -1". OP may have series of interview questions..." SQL doubt -2" etc...;-)

  • RE: Centralized monitoring...

    Thanks Grant..Powershell scripts seems to be better option...

  • RE: How to restrict decimal numbers using select clause?

    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...

  • RE: Index list in Server Management studio

    Glad my script helped you...

  • RE: Index list in Server Management studio

    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...

  • RE: Need some help with SQL (group by and Select)

    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...

  • RE: Getting the dates between a range

    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

    ...

  • RE: incorrect syntax near 'if'

    Thanks...its works..your help always ontime for me..

  • RE: Overlapping indexes

    Thanks Gail...its answered my problem....

  • RE: rarely used procedures in db

    Thanking all who responded...i got very useful info...

  • RE: update table with tally doesnot work

    Kingston..yours code works like a champion...thanks a lot..

Viewing 15 posts - 31 through 45 (of 73 total)