Forum Replies Created

Viewing 15 posts - 46 through 60 (of 68 total)

  • RE: Update Date Field

    Use DateADD

    Like:

    declare @cur_date datetime

    select @cur_date = GetDate()

    print @cur_date

    set @cur_date = dateadd(yyyy, 1, @cur_date)

    print @cur_date

  • RE: T-SQL 2005 String Pattern??

    Part of my point here is to turn the OP to the direction of tally tables also.

    I purposely have asked him to look at them.

    Here is a simple way to...

  • RE: T-SQL 2005 String Pattern??

    declare @str varchar(20)

    set @str = 'HELLO WORLD'

    select SUBSTRING(@str, 1,n)

    from Tally t

    where N<=LEN(@str)

    The 'Tally' table is simple table of numbers.... pls look for articles on Tally table...

  • RE: WHILE loop issue

    Your location variable does not change in the SP??

    execute mysp_GetCurrentValue location, @nextid = @ilocationID output

    can you execute this sp in a loop and print out the value of the out...

  • RE: UNION ALL/TOP x Issue

    Since I am obviously not able to see/recreate the problem, could the original poster confirm if using CTE

    solves the problem. Like:

    with myCTE(

    somedata)

    as(SELECT TOP 5 somedata FROM Table2 order by TransDate...

  • RE: UNION ALL/TOP x Issue

    Is this 2005 sql ??

    when i tried your query:

    SELECT somedata FROM Table1

    UNION ALL

    SELECT TOP 5 * FROM

    (SELECT somedata FROM Table2 ORDER BY TransDate DESC)

    I got an error but I...

  • RE: Is there a bug in the site?

    ok... makes sense...

    Having ellipsis before the last page (if there are over ridden pages) would probably make it easier to understand.

  • RE: problem in query

    I am surprised that this is working.

    This line looks strange...

    select @range = 'Cells(' + cast(@currentRow as varchar(20)) + ',' + cast(@test1_col as varchar(20)) + ').Value'

    Normally you get ranges by specifying...

  • RE: monthly report generation

    Ranjit,

    When we ask for sample scripts, we don't mean a copy paste of the first few lines of table.

    This is what was required of you ...... (or something similar)

    create table...

  • RE: Retrieving Bulk of Records using Select Keyword

    1 Lakh = 100,000

    1 Crore = 100 Lakh

    In India, units change at hundreds and not at 1000s.

    1 Million = 10 Lakh = 10,00,000

  • RE: Design pitfall?? Having primary key composed of foriegn keys?

    I am glad I asked this question ... I had not thought of creating the unique constraint too... :w00t:

  • RE: Design pitfall?? Having primary key composed of foriegn keys?

    Good point .... I had not thought of that

  • RE: Design pitfall?? Having primary key composed of foriegn keys?

    Jack Corbett (12/23/2008)


    It is common to have tables that have multiple columns that create the uniqueness of row. Some SQL Server DBA's like to use these as composite primary...

  • RE: Design pitfall?? Having primary key composed of foriegn keys?

    You are VERY close to what I am doing. I have a situation where one partner can be part of many partnerships.

    And one partnership can have any number of partners...

    So...

  • RE: converting int to char and concatenating

    You need to alias your table in the from clause...

    or you will get an error like

    Msg 4104, Level 16, State 1, Line 1

    The multi-part identifier "#voodo.column1" could not be bound.

Viewing 15 posts - 46 through 60 (of 68 total)