Forum Replies Created

Viewing 15 posts - 106 through 120 (of 143 total)

  • RE: Select statement with condition.

    Hi,

    I want result column name should be "Employee_Name"

    select *,case when (fname is not null) and (lname is not null) then fname+'.'+lname

    AS employee_Name

    else isnull(fname,lname)

    It is not working,

    Can u please...

  • RE: Select statement with condition.

    Thank u Subba Reddy.

    May i know Where r u from.

  • RE: How to display column_names based on condition

    My Requirement is :

    I have to check whether col_1 contains 100, if Yes then insert corresponding value (i.e Prod)

    into another table.

    like that i've to search for multiple records.

  • RE: How to display column_names based on condition

    Sorry,,,

    Small change in my requeirement...

    Table_Name : Table1

    Col_1Col_2

    ----------------------

    100Prod

    101Sales

    102Mark

    103Purc

    if exists (select 1 from Table1 where Col_1=100) then

    i want to get the corresponding column value of 100, that is "Prod" as output.

    --

    Query...

  • RE: How to display column_names based on condition

    Query Please....

  • RE: Sql Print.

    :-)Thank U anthony:-)

    🙂

  • RE: Import Text file into SQL....?

    Ooops,

    I have that file in my local machine......

    how to read the same file from local machine.

  • RE: Import Text file into SQL....?

    Yes.

    file exists in the same path / location.

  • RE: Trigger to update existing records

    Updated by below query

    UPDATE SET [col] = [col]

    but trigger is not firing on update.

    below is my trigger

    CREATE TRIGGER [dbo].[Prod]

    ON [dbo].[Table_Name] ...

  • RE: Trigger to update existing records

    Am having a table called products with 4 columns, whenever any new insert or update happens,

    column "Product_Name_Expiry" will be udpated with prouduct_Name : Product_expriry_date.

    IDProduct_NameProduct_Expiry_Date ...

  • RE: Date format

    i want to append the expiry date to a variable like below..

    DECLARE @Expiry_Date DATETIME = '2012-12-25 00:00:01.003'

    SET @Prod=@Product_name + RTRIM(@Product_name)

    +SELECT '(Expires '+RTRIM(DATENAME(MM, @Expiry_Date ) + RIGHT(CONVERT(VARCHAR(12), @Expiry_Date ,107),9))+ ')'

    but...

  • RE: Date format

    Expiry_date Format is : DATETIME

  • RE: Date format

    First QuerySET @Prod=@Product_name + RTRIM(@Product_name) + ' (Expires '

    +RTRIM(DATENAME(MM, @expriry_date ) + RIGHT(CONVERT(VARCHAR(12), @expriry_date ,107),9))+ ')' +CHAR(10)

    Result is : Product : Vehicles (Expires September 30 2012)

    Second QuerySELECT '(Expires...

  • RE: Date format

    Hi Anthony,

    Small change in my requirement, I want only one comma after the Date.

    Product : Vehicles (Expires September 30, 2012)

  • RE: Trigger to update existing records

    Yes,

    i want to update pre-existing data,

    at present trigger is firing for only newly updated or inserted records.

    i want Trigger should be fired one time for pre-existing data....

    Please help

Viewing 15 posts - 106 through 120 (of 143 total)