Getting Started with Adobe After Effects - Part 6: Motion Blur
Ask
Ask questions, discuss or help others by answering
Related Posts · View All
SQL Server 141
TSQL 75
SSRS 70
SSIS 66
XML 54

Top Categories · View All
SQL Server 141
TSQL 75
SSRS 70
SSIS 66
XML 54

Get the FieldName and specified record Value in Comma separated

Oct 30 2010 12:00AM by Pradeep   

I will get the table name and only one  key value of the table so i need to concat field name and value and show as single row.

For  example

Table name : Employee

ID, Name,salary,createdate,modifieddate

1,xxx,123,10102010,03242010

Expected Output is:

Field1

ID,1|Name,xxx|salary,123|createdate,10102010|modifieddate,03242010

 

Please help me for the same

Submitted under: Microsoft SQL Server · TSQL · XML · XQUERY · 


Pradeep
355 · 0% · 115

4 Replies

  •  

    select

     

     

    Field1='ID,'+ID+'|Name,'+Name+'|salary,'+salary+'|createdate,'+createdate+'|modifieddate,'+

    modifieddate

    from

     

     

    Employee

    commented on Oct 30 2010 3:44PM
    Leonid Koyfman
    50 · 4% · 1183
  • Thanks for your replay..

    My requirement is if any record in any table deleted from via application then I need to cature that record in some where for future reference. I just given example one table strucure like this but idea is I Plan to create one

    new table called "deletedrecords"  with Field Name called "SerialNo","TableName","DeletedRecord","CreatedDate","CreatedBy"

    Whenever end user click the delete button then immediatly it will give "Table Name" and "Key ID" of the table as input to my SP's . Then I have to Take that record and store it into above table and then delete the record

    in the actual table.

    So I belive there are lot of query export are here defenitly any one can help me for the same.

    1. I have a Table Name and a Primary Key value of the Table

    2. Using the Table Name, I can get the Column Name from sys.syscolumns table.

    3. Using Key ID and Table name , I can get the a record from that table

    4. I don't Know how to contact fieldname and value as I mentioned above?

     

    Please any one help me for the same.

     

     

     

     

     

     

     

    commented on Oct 30 2010 6:42PM
    Pradeep
    355 · 0% · 115
  • Hi Sql Exports , I realy looking the solution from any one. Please share your thoughts.

    is it possible or not?

     

    commented on Oct 31 2010 12:20AM
    Pradeep
    355 · 0% · 115
  • I would suggest generating an XML document containing all the information on the rows being modified/deleted. This will be easy to generate and query on a later date. For example, you can use a "SELECT * FROM DELETED FOR XML AUTO"  for generating a simple XML document containing all the information in the rows being deleted.

    commented on Nov 23 2010 12:33PM
    Jacob Sebastian
    1 · 100% · 32002

Your Reply


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]