Forum Replies Created

Viewing 15 posts - 1 through 15 (of 23 total)

  • RE: Formatted output

    thanks!

  • RE: Formatted output

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[allowances]') AND type in (N'U'))

    DROP TABLE [dbo].[allowances]

    GO

    CREATE TABLE [dbo].[allowances](

    [allid] [int] NULL,

    [name] [nchar](10) NULL,

    [amount] [int] NULL

    ) ON [PRIMARY]

    GO

    insert into allowances values(1,'a',10)

    insert...

  • RE: Data arrangement - columns to rows in a specific way

    Thanks for all the responses..

    I get the data from 3 different tables. I used case when to get the result as needed. It works fine as expected.

    My query is :

    select...

  • RE: Data arrangement - columns to rows in a specific way

    I want the output in such a way that

    if the name has codeid for order - 1,2 and 3, i need the codeid for order-1 in the first column, the...

  • RE: Data arrangement - columns to rows in a specific way

    CodeIDTypeIDNameOrderGroupId

    9776210000061111DTaP/IPV/Hib11

    9776310000061141DTaP/IPV/Hib21

    9776410000061161DTaP/IPV/Hib31

    1540611000006110 6DTaP/IPV pre-school booster41

    9776610000061178dTaP/IPV 51

    4052810000001182PCV 12

    4053010000001172PCV ...

  • RE: get xml text from varchar column

    Thanks to all for the support.. esp to Mark Cowne.. You really helped me!

  • RE: get xml text from varchar column

    create table tblxmldata

    (id int, xmltext xml)

    insert into tblxmldata values(1,'<associatedText><value type="PO">GTT taken</value></associatedText><associatedText><value type="PO">Check sugar today please</value></associatedText>')

    insert into tblxmldata values(2,'<associatedText><value type="PO">Check BP today please</value></associatedText>')

    I want the output as

    1 ...

  • RE: get xml text from varchar column

    Thanks again

    What will be the query if I need the id too in the output

    1 GTT taken,Check sugar today please

  • RE: get xml text from varchar column

    Thank for the quick response

    One more help please

    Can I get it in a single column as comma separated as

    GTT taken,Check sugar today please

  • RE: get xml text from varchar column

    i tried this

    AssociatedText.value('(/associatedText/node())[1]', 'nvarchar(max)') as AssociatedText

    If i have more than one value, this wont work. Please help

  • RE: get xml text from varchar column

    Hi Sean Lange,

    It was a mistake. The datatype is xml. Please help

  • RE: T-SQL

    I use SQL Server 2008 R2 and it works fine..

  • RE: IF EXISTS vs @@ROWCOUNT

    Thanks all for your valuable comments.

    I will surely consider all your comments when I frame my next question.

    Sorry to all who felt that its a bad question

    and

    Thanks to...

  • RE: IF EXISTS vs @@ROWCOUNT

    Could you please reword the question and let me know where I went wrong in wording the question.

    Thanks for your time

  • RE: Update Identity column

    Excellent Question! Thanks for sharing!

    The SWITCH TO method to update identity column is new to me. Thanks for that too.

Viewing 15 posts - 1 through 15 (of 23 total)