Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)

  • RE: MY query is procedure is not working?

    alter procedure update_use

    (

    @name varchar(20),

    @class nvarchar(30)

    )

    as

    begin

    declare @id int

    select @id=id from grts where name=@name

    if exists (select * from grts where id=@id)

    begin

    update grts set name=@name,class=@class where id=@id

    end

    else

    begin

    insert into grts (name,class) values(@name,@class)

    end

    end

  • RE: Find the error column and the row

    create table varchartest(a varchar(30),b varchar(30))

    create table varchartest_1(a varchar(30),b int)

    insert into varchartest values ('xyz','1')

    ,('abc','2')

    ,('bcd','3')

    ,('efg','4')

    ,('erer','5')

    --,('rerer','x')

    ,('rerer','7')

    alter table varchartest_1 add c int identity

    insert into varchartest_1(a,b) select a,b from varchartest

    select * from...

  • RE: help writing SUBSTRING() expression please

    With MySampleData([Business Unit],[Description 01])

    AS

    (

    SELECT 'MFMGOOGLE','ertCOST POOLert' UNION ALL

    SELECT 'MFMArnoldDeCaprio','COST ert' UNION ALL

    SELECT 'MFMBruceSchwarzenegger','ewtrCOSTwerwer POOL' UNION ALL

    SELECT 'MFMArnoldDamon','COSTerwer ' UNION ALL

    SELECT 'MFMLeonardoPitt','sdfsf' UNION ALL

    SELECT 'MFMBruceWahlberg','fffffCOST_POOL'

    )

    SELECT

    CASE WHEN [Description 01]like '%COST POOL%'...

  • RE: help writing SUBSTRING() expression please

    Hi,

    For getting the substring except MFM from the SQL Server DB itself,

    With MySampleData([Business Unit])

    AS

    (

    SELECT 'MFMGOOGLE' UNION ALL

    SELECT 'MFMArnoldDeCaprio' UNION ALL

    SELECT 'MFMBruceSchwarzenegger' UNION ALL

    SELECT 'MFMArnoldDamon' UNION ALL

    SELECT 'MFMLeonardoPitt' UNION ALL

    SELECT...

  • RE: OUTPUT & NEWID()

    In SQL Server 2005, it won't give the answer other the syntax error since we have to use

    'insert into table ' with 'union all' statement for the insertion to...

Viewing 5 posts - 1 through 5 (of 5 total)