Emailbody using SQL: Align Table with Headers

I have a requirement, Where I need to align header and table contents , as a part EMAIL body in HTML format. I'm getting the resultset from a table.
Here is the output
Rows in these Columns have following maximum length:
Table Name :Maximum length of table name is 40.
Building: Maximum length is 15
CreatedDate: Maximum length is 25
I would appreciate it if someone can help me on this.
Thanks in advance.
ZK

Hi,
The Integration Services SendMail task only supports mail messages in plain text format. However you can easily send HTML mail messages by using the Script task and the mail capabilities of the .NET Framework.
Please refer to the following articles about this topic:
Sending an HTML Mail Message with the Script Task:
http://technet.microsoft.com/en-us/library/ms403365(v=sql.90).aspx
SSIS - Data Table displayed in Script HTML Email Body:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bc395a54-da68-4041-b142-5108a5ad250c/ssis-data-table-displayed-in-script-html-email-body?forum=sqlintegrationservices
If you have any more questions regarding SSIS, I would suggest you open a new thread in SSIS forum for better support.
If you have any feedback on our support, please click
here.
Elvis Long
TechNet Community Support

Similar Messages

  • Migrating CMP EJB mapped to SQL Server table with identity column from WL

    Hi,
        I want to migrate an application from Weblogic to SAP Netweaver 2004s (7.0). We had successfully migrated this application to an earlier version of Netweaver. I have a number of CMP EJBs which are mapped to SQL Server tables with the PK as identity columns(autogenerated by SQL Server). I am having difficulty mapping the same in persistant.xml. This scenario works perfectly well in Weblogic and worked by using ejb-pk in an earlier version of Netweaver.
       Please let me know how to proceed.
    -Sekhar

    I suspect it is the security as specified in the message. E.g .your DBA set the ID columns so no user can override values in it.
    And I suggest you 1st put the data into a staging table, then push it to the destination, this does not resolve the issue, but ensures better processing.
    Arthur
    MyBlog
    Twitter

  • Use of internal table with hearerline in ABAP OO

    Hi,
    I have a very basic question regarding the use of Internal table with headerline in ABAP OO.
    I consider the concept of Internal table with header as one of the most features of ABAP, which is not there in any of the other porgramming languages.
    I accept that OO's concept is one of the most powerful and a very good concept. We should also implement OO's concept in ABAP.
    But my concern is why in the process of moving to OO's the concept of Internal table with headerline is no more used.
    Can any one tell me the main reason for this. Is there any technical reason for this. By this i mean anything to do with memory or effeciency.
    Thanx,
    Srinivas

    Hi Srinivas,
       here is something more which i found about the same
    follow this link
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5ac31178-0701-0010-469a-b4d7fa2721ca
    and search for header line.
    it says:
    Tables with header lines not allowed
    Only tables without header lines can be declared in ABAP Objects.
    Error message in ABAP Objects if the following syntax is used:
    DATA itab TYPE LIKE TABLE OF ... WITH HEADER LINE.
    Correct syntax:
    DATA: itab TYPE LIKE TABLE OF ... ,
    wa LIKE LINE OF itab.
    Reason:
    It depends on the statement whether the body or header line of a table is accessed. The table name should identify the table uniquely. Programs are easier to read. Tables with header lines do not improve performance.
    i hope this will help you.
    regards,
    Kinshuk
    PS mark helpful answers

  • BADI cant use an internal table with header line

    hi,
         In BADI, we cant use an internal table with header line, and I am calling a function module which requires internal table as import parameter, now, the table I am passing is without a header line, So how to solve this problem ?

    You can use a type and then create an internal table of that type.
    types :
    begin of t_<example>
    *field list
    end of t_<example>
    data :
    gt_<table> type standard table of t_<example>
    pass this to the FM

  • How to numberformat when using sql:query alogn with c:forEach JSTL tags

    Is there anyway to format the numeric values returned from the database when using <sql:query> alogn with <c:forEach> tags
    Here is my jsp code
    <sql:query..../>
    <c:forEach var="row" items="${queryResults.rows}">
    <tr>
    <td><c:out value="${row.COL1}" /></td>
    <td><c:out value="${row.COL2}" /></td>
    </tr>
    </c:forEach>
    Col1 values are numeric without any formats Eg: 1000, 10000, 1000000 etc.
    how can i format them to 1,000 , 10,1000 , 100,000 etc

    It is polite to mention what your answer was. These posts are not just here for you to ask questions, but to be used as a resource for other people to find answers. Saying "I solved it" with no details helps noone.
    I presume you discovered the JSTL <fmt:formatNumber> tag?

  • What are the advantages of using an internal table with workarea

    Hi,
    can anyone tell me
    What are the advantages of using an internal table with workarea
    over an internal table with header line?
    thnks in adv
    regards
    nagi

    HI,
    Internal tables are a standard data type object which exists only during the runtime of the program. They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm
    <b>Difference between Work Area and Header Line</b>
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    e.g.
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    The header line is a field string with the same structure as a row of the body, but it can only hold a single row.
    It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table
    1) The difference between
    whih header line and with out heater line of internal table.
    ex:-
    a) Data : itab like mara occurs 0 with header line.
    b) Data: itab like mara occurs 0.
    -While adding or retrieving records to / from internal table we have to keep the record temporarily.
    -The area where this record is kept is called as work area for the internal table.
    -The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    -Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    a) Data : itab like mara occurs 0 with header line.
    table is with header line
    b) Data: itab like mara occurs 0.
    table is without header line
    2)work area / field string and internal table
    which one is prefarable for good performance any why ?
    -The header line is a field string with the same structure as a row of the body, but it can only hold a single row , whereas internal table can have more than one record.
    In short u can define a workarea of an internal table which means that area must have the same structure as that of internal table and can have one record only.
    Example code:
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    Regards,
    Padmam.

  • How to use dynamic internal table with FOR ALL ENTRIES

    Hello SDNers,
    I am having a dynamic internal table & want to use FOR ALL ENTRIES(FAE) using this dyn. table.
    This works fine for me:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE ztable
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE (lv_dynwhere). "lv_dynwhere -> dynamic where clause
          ENDIF.
    SAP documentation says:
    "The logical expression sql_cond of the WHERE condition can be comprised of several logical expressions using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one comparison with a column of the internal table itab that can be specified statically or dynamically. "
    How do we specify the column of the internal table dynamically ? Can we do something like this:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE key_field1 = (dynamic token for column1 of <lt_tmp>)
                           key_field2 = (dynamic token for column2 of <lt_tmp>)
          ENDIF.
          ENDIF.
    Let me know if i am not clear about my requirement.
    BR,
    Suhas

    Hello Thomas,
    What i meant was something like this:
    WHERE key_field1 = ('<LT_TMP-COL1>') AND
          key_field2 = ('<LT_TMP-COL2>')
    I am confused by what SAP means with "dynamic representation of internal table columns" in FAE ?
    @Rob: I was referring to SAPNW 7.0 documentation & the phrase (release 6.40 & higher) is missing. Anyways fyi i am on ECC5.0 ABAP release 6.40.
    @Subhankar: This is what Marcin had proposed in For all entries and dynamic table.
    Thanks,
    Suhas
    Edited by: Suhas Saha on Apr 6, 2010 11:53 AM

  • Using SQL Server credentials with Secure Store Target Application for Data Connection in Dashboard Designer

    [Using SharePoint 2013 Enterprise SP1]
    I would like to use SQL Server credentials in a Secure Store Target Application, and
    this page makes it look like it's possible but when I attempt to use the new Target Application ID as authentication for a Data Connection in Dashboard Designer, I get a generic "Unable to access data source" with no error logged in SQL Server
    logs.
    I am able to use a Target Application with AD credentials to access the SQL db without a problem. Suggestions?

    Hi,
    1. Make sure that the credential is set to
    Secure Store Target Application. Navigate to the Central Administration. Click on the
    Application Management. Click on the Manage Service Applications. Click on the
    Secure Store Service Application. Select the application ID and from the ECB menu click on the
    Set Credentials. Enter the Credential Owner, Windows User Name and the
    Windows Password.
    2. Make sure that in the Dashboard Designer “Use a stored account” is selected in the “Authentication” and the proper application ID is mentioned.
    Please refer to the link below for more information:
    http://www.c-sharpcorner.com/Blogs/14527/unable-to-access-data-source-the-secure-store-target-applic.aspx
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Use of selection table with 4 fields

    Hi everyone
    Can someone please explain to me what is the use of the seltab 4 fields, how they are used and provide an example, cos Im kinda struggling understanding them...
    Thanks in advance
    Adam

    Hi,
    Explicity there is a selection table for select-options that is seltab and it have sign, low, high, and option.
    Actually these values are also available in ranges.
    Just to explain you go through this info.
    What are the difference between SELECT-OPTIONS & RANGES?
    Here both SELECT-OPTIONS & RANGES works for the same purpose. They both are used for the range selection from selection screen. The main diff. between them is, while we use SELECT-OPTIONS system implicitly creates the select options internal table which contains the fields of SIGN,OPTION,LOW & HIGH. But in case of RANGES, this internal table should be defined explicitly.
    Eg. to SELECT-OPTIONS :
    REPORT YARSELECT.
    TABLES YTXLFA1.
    SELECT-OPTIONS : VENDOR FOR YTXLFA1-LIFNR.
    INITIALIZATION.
    VENDOR-LOW = 1000. " It specifies the range starting value.
    VENDOR-HIGH = 2000. " It specifies the range ending value.
    VENDOR-OPTION = 'BT'. " specifies ranges value is in between.
    VENDOR-SIGN = 'I'. "specifies both inclussive.
    APPEND VENDOR.
    SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB
    WHERE LIFNR IN VENDOR.
    Eg. to RANGES:
    REPORT YARRANGE.
    TABLES YTXLFA1.
    RANGES: VENDOR FOR YTXFLA1-LIFNR.
    SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB
    WHERE LIFNR IN VENDOR.
    Here with RANGES user has to design an internal table with fields -
    SIGN,OPTION,LOW and HIGH EXPLICITLY.
    >
    Example:
    select-options: bukrs for zstock-bukrs.
    Should the user fill in 'ABFI' in BUKRS on the selection screen, BUKRS will look like this:
    IEQABFI
    This is because BUKRS is set as a table as follows:
    begin of bukrs occurs 0,
    SIGN(1) type c,
    OPTION(2) type c,
    LOW like bukrs,
    HIGH like bukrs,
    end of bukrs.
    Now, when you create the following range, it will have the exact same fields set inside its table:
    Ranges: bukrs for zstock-bukrs.
    The difference is, because ranges doesn't show on the selection screen, you will have to fill it yourself, meaning you will have to fill bukrs-sign, bukrs-option, bukrs-low & bukrs-high all manually.
    Some tips:
    Sign is always I (for Include) or E (for Exclude)
    Option can be a whole range, which includes:
    EQ (Equal)
    BT (Between))
    CP (Contain Pattern)
    So let's say you want to have the range check for all company codes not starting with AB, you will set your code as follow:
    ranges: bukrs for zstock-bukrs.
    bukrs-sign = 'E'. "Exclude
    bukrs-option = 'CP'. "Pattern
    bukrs-low = 'AB*'. "Low Value
    bukrs-high = ''. "High Value
    append bukrs.
    Always remember to APPEND your range when you fill it, as the WHERE clause checks against the lines of the range table, not against the header line.
    Hope this explains it well enough.
    >
    What does SIGN "I" & "E" mean?
    The "I" stands for Include, and the "E" for Exclude.
    The easiest way to learn how the range selections work is, create the following dummy program:
    report dummy.
    tables: mara.
    select-options: matnr for mara-matnr.
    start-of-selection.
    loop at matnr.
    write: / matnr-sign,
    matnr-option,
    matnr-low,
    matnr-high.
    endloop.
    Run this program, and fill in a lot of junk into MATNR. Fill in some includes, some excludes, some ranges, etc., and you will soon realise how the system builds ranges (select-options). Once you know that, you can fill your own ranges quickly and efficiently.
    Hope this info helps.
    Regards,
    Kumar.

  • Moving Access table with an autonumber key to SQL Server table with an identity key

    I have an SSIS package that is moving data from an Access 2010 database to a SQL Server 2008 R2 database.  Two of the tables that I am migrating have identity keys in the SQL Server tables and I need to be able to move the autonumber keys to the SQL
    Server tables.  I am executing a SQL Script to set the IDENTITY_INSERT ON before I execute the Data Flow task moving the data and then execute a SQL Script to set the IDENTITY_INSERT OFF after executing the Data Flow task.
    It is failing with an error that says:
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80040E21  Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was
    done.".
    Error: 0xC020901C at PGAccountContractDetail, PGAccountContractDetail [208]: There was an error with input column "ID" (246) on input "OLE DB Destination Input" (221). The column status returned was: "User does not have permission to
    write to this column.".
    Error: 0xC0209029 at PGAccountContractDetail, PGAccountContractDetail [208]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "input "OLE DB Destination Input" (221)" failed because error code 0xC020907C occurred, and the
    error row disposition on "input "OLE DB Destination Input" (221)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information
    about the failure.
    Error: 0xC0047022 at PGAccountContractDetail, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "PGAccountContractDetail" (208) failed with error code 0xC0209029 while processing input "OLE DB
    Destination Input" (221). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted
    before this with more information about the failure.
    Any ideas on what is causing this error?  I am thinking it is the identity key in SQL Server that is not allowing the update.  But, I do not understand why if I set IDENTITY_INSERT ON.  
    Thanks in advance for any help/guidance provided.

    I suspect it is the security as specified in the message. E.g .your DBA set the ID columns so no user can override values in it.
    And I suggest you 1st put the data into a staging table, then push it to the destination, this does not resolve the issue, but ensures better processing.
    Arthur
    MyBlog
    Twitter

  • 11g: can connet using SQL*PLUS, not with TOAD

    Hi
    I run into a problem with TOAD. I can't connect with my 11g database using TOAD. I don't get any messages it just gives me a little waiticon for a split second and then nothing happens. I can however connect to my 10g database using TOAD. Using SQL*Plus I can connect to both.
    I use TOAD 8.6. Do I need a newer version maybe??...

    I can connect like:
    hr/pw@xe
    or
    hr/pw@O11R1
    or directly, no problem. I can connect from SQLplus to both databases any way I want

  • Migrating from Sql Server tables with column name starting with integer

    hi,
    i'm trying to migrate a database from sqlserver but there are a lot of tables with column names starting with integer ex: *8420_SubsStatusPolicy*
    i want to make an offline migration so when i create the scripts these column are created with the same name.
    can we create rules, so when a column like this is going to be migrated, to append a character in front of it?
    when i use Copy to Oracle option it renames it by default to A8420_SubsStatusPolicy
    Edited by: user8999602 on Apr 20, 2012 1:05 PM

    Hi,
    Oracle doesn't allow object names to start with an integer. I'll check to see what happens during a migration about changing names as I haven't come across this before.
    Regards,
    Mike

  • SQL: Find table with max no. of rows

    I have a table containing list of table names for each owner; as
    ## Table: db_tables
    OWNER TABLE_NAME
    a ta_1
    a ta_2
    a ta_3
    b tb_1
    b tb_2
    c tc_1
    Now, i want to know the table with max. no. of rows for each owner
    Plz....can anyone gimme a solution for the above ......

    Assuming 10g and above:
    SQL>  SELECT owner,
                 MAX(table_name) KEEP (DENSE_RANK FIRST ORDER BY XMLQUERY (t RETURNING CONTENT).getnumberval() DESC) table_name,
                 MAX(XMLQUERY (t RETURNING CONTENT).getnumberval()) cnt
        FROM (SELECT owner,table_name,    'count(ora:view("' || table_name || '"))' t
                FROM all_tables
               WHERE owner IN ('MICHAEL','SCOTT'))
               GROUP BY owner
    OWNER                          TABLE_NAME                            CNT
    MICHAEL                        SERVICE_ZIP                       1000000
    SCOTT                          EMP                                    14
    2 rows selected.

  • How to use single buffered table with FOR ALL ENTRIES KEYWORD

    Hai,
    I'm Using TJ02T Database table, It is single buffered table but at the same time I want to use FOR ALL ENTRIES KEYWORD , Please Help me.
    Regards,
    S.Janani

    Hi,
    FOR ALL ENTRIES will not depend on the buffering nature of the table. The single buffered table will only only buffer one record into memory. You can still use the statement to query the values, but it may have performance problems if the data volume is high since the records are not completely buffered into memory, the time will spent in getting data from DB.
    Thanks..
    Preetham S

  • Use sql function decode with Zend code

    Hi,
    I need to use sql function DECODE() in a query for PHP Code. This query works well in sql*plus but PHP returns
    the following error message:
    Parse error: syntax error, unexpected T_STRING in C:\Program Files\Zend\Apache2\htdocs\Compta\compta2.php on line 16
    the query is :
    $query =
    'select substr(c.NUM,1 ,2) Compte ,
    c.designation , a.Periode
    ,decode(substr(c.NUM,1 ,1), '1',1, '2',1,'3',1,-1) cp_type ,
    sum(credit) - sum(debit) Montant
    from ecritures a, clients b, compte c
    where
    b.NUM (+) =a.NUM
    and a.DATEECRITURE between to_date(:debut, \'dd/mm/yy\') and to_date(:fin, \'dd/mm/yy\')
    and substr(a.num,1,2) =c.num
    group by substr(c.NUM,1 ,1), substr(c.NUM,1,2) , c.designation ,a.periode
    order by compte ';
    Can any one help me ???
    Thanks by advance
    nb: Iuse Zend 2.0

    Hi,
    You need to escape single quote mark:
    decode(substr(c.NUM,1 ,1), \'1\',1, \'2\',1,\'3\',1,-1) cp_type ,
    the same way you did for to_date:
    to_date(:debut, \'dd/mm/yy\')
    Regards,
    Paweł

Maybe you are looking for

  • Typical problem in SCRIPTS

    Hello Experts, I am working on SAP script where i have to display the records in a page from a internal table. begin of xtab occurs 0, vbeln like vbak-vbeln, matnr like mara-matnr, maktx like makt-maktx, erdat like vbak-erdat, date_var(1),       "ind

  • Viewing Other Schema In SQL Developer

    Hi, I did a search in the Forum and none of the posts I have found has been able to solve my problem so I'm here with my hat in hand asking for some advice. I was recently given SQL Developer to replace what I had been using and, on my own, have been

  • Picture and cd art

    Hey guys, This should be a simple answer but I can seem to figure it out. I have all my music on my library and I just ordered a Ipod photo what not so I would like to put the cd art for all the albums. It seems like I can't put the art for the whole

  • How can i add my new pc at my ID apple ?

    helow

  • How to transfer an entire photo album from my phone to my computer?

    how to transfer an entire photo album from my phone to my computer?