Forum Replies Created

Viewing 15 posts - 16 through 30 (of 46 total)

  • RE: Current year and Previous year values in same report

    Some changes

    DECLARE @CYBeginDate smalldatetime, @CYEndDate smalldatetime,

    @LYBeginDate smalldatetime, @LYEndDate smalldatetime

    select @CYBeginDate = dateadd(year, datepart(year, getdate()) - 1900, '1900-04-01')

    select @CYEndDate = dateadd(day, -1, dateadd(month, 12, @CYBeginDate))

    select @LYBeginDate = dateadd(year, -1, @CYBeginDate)

    select...

  • RE: Current year and Previous year values in same report

    Hi

    Just a bit simplified version of Nakul Vachhrajani's code

    DECLARE @CYBeginDate datetime, @CYEndDate datetime, @LYBeginDate datetime, @LYEndDate datetime

    select @CYBeginDate = dateadd(year, datepart(year, getdate()) - 1900, '1900-04-01')

    select @CYEndDate = dateadd(day, -1,...

  • RE: Checking SQL Agent Status via TSQL

    If you want to check the status of SQLAgent

    then check whether this query works or not

    xp_servicecontrol querystate , SQLAGENT

  • RE: First time semi-complex query - its slow!!!

    what is the rowcount of the table?

  • RE: Strange CASE

    Hi kingston

    Thanks for the reply

    Actually the whole idea of my posting this problem was to not to use dynamic SQL.

    Thanks again

  • RE: Strange CASE

    Thank you very much for the solution.

    Sometimes there is a very easy solution for a complicated problem and we just cant think of it

    Thanks again.

  • RE: update script

    Thanks for the feedback.

    It was my pleasure to help.

    And no need to thank me as i have also got many solutions from this site so just doing my part to...

  • RE: Strange CASE

    Thanks for the reply

    But sorry i didn't gave a complete idea of the problem

    The problem is like this

    Declare @tab1 table (ID int, Name varchar(10))

    insert into @tab1 values (1, 'One')

    insert into...

  • RE: update script

    this will solve the problem. Here i have used rownumber to find the lowest priority and rowid.

    Declare @priorityupdate table

    ( aid int,

    priority int,

    rowid int,

    Transaction_V nvarchar(1))

    Insert into @priorityupdate(aid,priority,rowid) values(1234,2,2)

    Insert into @priorityupdate(aid,priority,rowid)...

  • RE: Cannot Update 3 tables with FK dependencies

    Please post some DDL data

  • RE: help in my procedure

    please provide table structure and test data

  • RE: how to transfer records to a single record

    Assuming ID column of hdr table is identity , as u havent given any details about it.

    Declare @dtl table (id Int, fk Int, dtl_note varchar(100))

    insert into @dtl

    values (1,1,'first')

    insert...

  • RE: unique clustered index on 2 columns

    thanks GilaMonster

    those are really good articles.

  • RE: T-SQL 2000

    XML can help u in this.

    Get those external files in XML if possible. As in xml u can tag the values. this will definitely solve your problem.

  • RE: How to optimize this query ?

    You are using different sets of table in each query. there is no scope in further optimization.

    Only chance remain is that if you can check the indexes and optimize it.

Viewing 15 posts - 16 through 30 (of 46 total)