Forum Replies Created

Viewing 15 posts - 331 through 345 (of 363 total)

  • RE: Checking for a null date

    [font="Verdana"]

    bill.humphrey (4/7/2008)


    I get an error "incorrect syntax near keyword 'if'.

    alter procedure sp_list_orcon_cat_b_v2

    @start_date nvarchar(19),

    @end_date nvarchar(19),

    @priority nvarchar(1),

    @response integer

    AS

    if (@end_date is null) then

    begin

    set @end_date = @start_date

    end

    begin

    SELECT TOP 100 PERCENT id,...

    MH-09-AM-8694

  • RE: Convert Row Values into Column

    [font="Verdana"]Please post your DDL of the table, if possible.

    Thanks,

    Mahesh[/font]

    MH-09-AM-8694

  • RE: comparing two table structure

    [font="Verdana"]

    also refer below URL

    http://www.sqlservercentral.com/scripts/Administration/62276/

    Thanks,

    Mahesh

    [/font]

    MH-09-AM-8694

  • RE: Connectivity to SQL Server, Oracle & MySQL

    [font="Verdana"]

    Raghu (4/5/2008)


    Hi All,

    I have an application running on .Net. I have a task to identity how can this application connected to various databases like SQL Server, Oracle & MySQL. The...

    MH-09-AM-8694

  • RE: Conditional insert

    [font="Verdana"]

    Grant Fritchey (4/4/2008)


    Mahesh beat me to it.

    Once you realize that the INSERT...SELECT mechanism is just a SELECT statement, pretty much anything possible within the SELECT statement can be used with...

    MH-09-AM-8694

  • RE: Convert Row Values into Column

    [font="Verdana"]Ya Karl, ketikeyan might be missing something. Kartikeyan, let us know.

    anyways Karl, thanks 🙂

    Mahesh[/font]

    MH-09-AM-8694

  • RE: Convert Row Values into Column

    [font="Verdana"]Not sure but you have to take help of Cursor, Dynamic SQL. Within the Cursor you have to build string for creating a Table and Select statement as well. i.e.

    1....

    MH-09-AM-8694

  • RE: join problem

    [font="Verdana"]

    or

    Select * From TableA Where TableA.ID Not Exists (Select TableB.Id From TableB)

    or

    Select * From TableA Where TableA.ID Not In (Select TableB.Id From TableB)

    I would suggest use EXISTS over IN...

    MH-09-AM-8694

  • RE: What shall I do with large tables with most of rows expired?

    [font="Verdana"]Grant, whatever you said earlier, regarding indexes, I am completely agrees with you. Using Indexes in proper manner, performance increases. However as Ahmedi said, each row get expire after some...

    MH-09-AM-8694

  • RE: Conditional insert

    vaidyanathan_kalyanasundaram (4/3/2008)


    Hi Grant,

    Thanks for the reply...

    I would like to know if we can include a case statement in an insert operation.

    [font="Verdana"]Obviously.

    Insert Into {Table} {Col1, Col2}

    Select Col1, {Case When Col2 =...

    MH-09-AM-8694

  • RE: How to make or set the table or database to store the data in UPPER CASE in Sql Server 2005?

    elangovanp (4/2/2008)


    Many Thanks, yes I think trigger is the only option to make the string into UPPER CASE.

    And, some tools are available to convert the entire database string into UPPER...

    MH-09-AM-8694

  • RE: How to make or set the table or database to store the data in UPPER CASE in Sql Server 2005?

    [font="Verdana"]

    Grant Fritchey (4/2/2008)


    Text data is just strings as far as SQL Server is concerned and UPPER is not any kind of data limit, but rather a format. You can probably...

    MH-09-AM-8694

  • RE: What shall I do with large tables with most of rows expired?

    [font="Verdana"]You think right. Moving such records to History table is good approch, so that you can get active records quickly. Also go through the below URL, this might help you...

    MH-09-AM-8694

  • RE: Convert Row Values into Column

    [font="Verdana"]

    Kartikeyan, sorry to say but you must be missing something. I have tried the sample query and then posted it. My sample query is:

    declare @str varchar(7999)

    Select ...

    MH-09-AM-8694

  • RE: Convert Row Values into Column

    [font="Verdana"]

    This way also ...

    Declare @strSQL VarChar(Max)

    Select @strSQL = (Case When @strSQL Is Null Then {Date Col} Else @strSQL + ', ' + {Date Col} End)

    From {Table}

    Select @strSQL

    Thanks,

    Mahesh

    [/font]

    MH-09-AM-8694

Viewing 15 posts - 331 through 345 (of 363 total)