Sorting of dynamical  created table

Hi,
i created a context node for a table uielement and added in wddoinit method some attributes.
The celleditor vor according columns is a DropDownByKey .
How can i sort my table by one of this dynamical attributes/columns ?

Hi ,
      I would like to explain the code in more detail
DATA: lv_slno type string value 'SLNO',  " SLNO is your column name by which you want to sort
           lo_node type ref to if_wd_context_node.
  FIELD-SYMBOLS :
    <lv_table>  TYPE STANDARD TABLE.
Get the reference of your table node into lo_node
lo_node = wd_context->get_child_node(  'ABC' ).  " Assuming ABC is the node name
Get the data of the node
lo_node->GET_STATIC_ATTRIBUTES_TABLE(
                                                    IMPORTING TABLE = <lv_table> ).
Sort the data in the table
SORT <lv_table> BY (lv_slno) DESCENDING.
Bind the sorted data again 
lo_node->bind_table( <lv_table> ).
I hope it is clear now . Let me know in case of any confusion .
Regards
Vivek

Similar Messages

  • Setting a Filter on a dynamically created Table

    Hi All,
    I am currently working on a Database to automatize some process. Quick explanation:
    The User can import a CSV (Text) File via a DialogBox, which gets imported into a Table. After this, the content has to be filtered, setting conditions on 4 different rows. The new Table gets exported into a new CSV (It has to be CSV, since it later gets imported
    into SAP)
    I am having some trouble with filters though:
    How can I set a Filter on a dynamically created Table (using VBA)?
    Best case would be to save the filter into my Import spec, but Access doesn't seem to have this option (?)
    Can somebody help?
    Thanks in advance
    Regards
    Alex

    Thanks for the fast reply! Sorry, I am not really proficient at Access. How do I do a query on a dynamically created Table? Do I have to save the Table into a Variable. Or what's the way to import it?
    Hi Alex,
    I never use the Import functionality, nor DoCmd.TransferText.
    To import data from a csv-file I made my own Import functionality. In fact it is just reading an external file, line by line, and each line field by field using the field separator. In my opinion that is far more versatile than the standard functionality.
    But you can use the standard functionality of Access to import a csv-file into a table.
    Having the data in a table, you can generate the appropriate query for the output in a VBA procedure:
            sql_string = "SELECT Field1, Field2, ... FROM MyTable WHERE Field1 = ... AND Field2 = ... ORDER BY Field3"
    and make a recordset of it:
            Set cur_set = CurrentDb(sql_string)
    The output csv-file is then filled by opening a file for Write, loop through all the records, concatenate for each record all the wanted fields using the field separator, and write the result line to the csv-file.
    Most important is to understand this process. After that it should be possible to build it. And if you have further questions, just ask.
    Imb.

  • Need help on selection of records in dynamically created table

    hi,
    Ia m able to bind the onleadSelect event to the dynamially created table .
    But i was not able to select the table records.
    default first record was only selected.
    can u help me out to find the way.
    i am pasting the code for reference.
    can u suggest me the right direction.
    i want the selected record in the table to be dispalyed in another view thru this action event.
    but only the forst record is now getting selected by default.
    here the code.
    IWDNode node =wdContext.currentContextElement().node().getChildNode(nodename,0);
    for (int l = 0; l < node.size(); l++) {
    int ele = node.getLeadSelection();
    IWDNodeElement element= node.getElementAt(ele);
    table.setOnLeadSelect(wdThis.wdGetObjectSelectedAction());

    Hi,
      <a href="/people/sap.user72/blog/2005/05/09/have-you-played-blindfold-chess's</a> how to create a dynamic table, though I think you have already done this.
      Do look at the comment that Armin Reichert has put in. Now in the source code that he has provided, the last line should be
    table.setOnLeadSelect(wdThis.wdGetLeadSelectAction());
    Have you done something similar to this?
    Have you set the initializeLeadSelect property of the datasource node to true?
    Regards,
    Satyajit.
    Message was edited by: Satyajit Chakraborty

  • Formatting value in the dynamically created table

    Hi,
    I have created table dynamically.
    In that, if the columns going to be number datatype,
    <af:convertNumber pattern="##########"/> , i want to apply this pattern,
    if the column going to be date,
    <af:convertDateTime pattern="DD/mm/yyyy" /> , i want to apply this pattern.
    Code Snippet for dynamically created UI table,
    <af:table rows="#{bindings.DynamicVO.rangeSize}"
    fetchSize="#{bindings.DynamicVO.rangeSize}"
    emptyText="#{bindings.DynamicVO.viewable ? 'No data to display.' : 'Access Denied.'}"
    var="row" rowBandingInterval="0"
    value="#{bindings.DynamicVO.collectionModel}"
    selectedRowKeys="#{bindings.DynamicVO.collectionModel.selectedRow}"
    selectionListener="#{bindings.DynamicVO.collectionModel.makeCurrent}"
    rowSelection="single" id="t1">
    <af:forEach items="#{bindings.DynamicVOIterator.attributeDefs}" var="def">
    <af:column headerText="#{def.name}" sortable="true" rendered="#{def.hints.displayHint!='Hide'}"
    sortProperty="#{def.name}" id="hisc1">
    <af:outputText value="#{row[def.name]}" id="othis1">
    </af:outputText>
    </af:column>
    </af:forEach>
    </af:table>
    How to apply the pattern for the ouput text dynammically depending on the data type.
    My Jdeveloper version is 11.1.1.3.0
    Reg,
    vini

    Any help on the above scenario?

  • How to create table field inside the dynamically created table?

    Hi, All!
    I have created dynamic internal table (using field catalog and CALL METHOD cl_alv_table_create=>create_dynamic_table )
    and put this table  into FM REUSE_ALV_GRID_DISPLAY. ALV grid work. Now I need to color rows of my ALV, therefore  I have to insert new column with name "COLORS" and type lvc_t_scol. I  see three ways to do it , but all ones are unsuccessful:
    1. Insert column into field catalog. FM REUSE_ALV_FIELDCATALOG_MERGE does not return info about "COLORS" I guess because COLORS is a table.
    2. Insert column into field catalog manually. It provides a short dump during dynamic table creating or during call of REUSE_ALV_GRID_DISPLAY.
    3. Create dyn table first, then add new field . I could not find a way how to do it :(((((((
    Can somebody help me?
    Tatiana

    Hi,
    Here is the solution for this problem, Sample code:
    *& Report  ZCHA_ALV_GRID_CELL_COLOR                                    *
    REPORT  ZCHA_ALV_GRID_CELL_COLOR                .
    TABLES:MARA.
    DATA: W_CONTAINER         TYPE SCRFNAME VALUE 'ALV_CONTAINER',
          W_GRID              TYPE REF TO CL_GUI_ALV_GRID,
          W_CUSTOM_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
         W_EVENT_RECEIVER    TYPE REF TO LCL_EVENT_RECEIVER.
    *layout
    DATA: WA_LAYOUT           TYPE LVC_S_LAYO.
    *field catalog
    DATA: IT_FIELDCAT_WRT_OFF TYPE LVC_T_FCAT,
          WA_FIELDCAT_WRT_OFF TYPE LVC_S_FCAT.
    DATA:BEGIN OF IT_MARA OCCURS 0,
         MATNR LIKE MARA-MATNR,
         MAKTX LIKE MAKT-MAKTX,
         CELLCOLORS TYPE LVC_T_SCOL,
         END OF IT_MARA.
    SELECT P~MATNR
           Q~MAKTX
           INTO CORRESPONDING FIELDS OF TABLE IT_MARA
           FROM MARA AS P INNER JOIN
                MAKT AS Q ON
                PMATNR = QMATNR.
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'STATUS'.
    SET TITLEBAR 'xxx'.
      IF NOT W_CONTAINER IS INITIAL.
        CREATE OBJECT W_CUSTOM_CONTAINER
                 EXPORTING CONTAINER_NAME = W_CONTAINER.
        CREATE OBJECT W_GRID
                 EXPORTING I_PARENT = W_CUSTOM_CONTAINER.
      ENDIF.
      CLEAR IT_FIELDCAT_WRT_OFF.
      REFRESH IT_FIELDCAT_WRT_OFF.
      WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MATNR'.
      WA_FIELDCAT_WRT_OFF-COL_POS   = '1'.
      WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '35'.
      WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material No'.
      APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.
      CLEAR WA_FIELDCAT_WRT_OFF.
      WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MAKTX'.
      WA_FIELDCAT_WRT_OFF-COL_POS   = '2'.
      WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '45'.
      WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material Desc'.
      APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.
      CLEAR WA_FIELDCAT_WRT_OFF.
      DATA LS_CELLCOLOR TYPE LVC_S_SCOL.
      READ TABLE IT_MARA INDEX 5 .
      LS_CELLCOLOR-FNAME = 'MATNR'.
      LS_CELLCOLOR-COLOR-COL = '3'.
      LS_CELLCOLOR-COLOR-INT = '1'.
      APPEND LS_CELLCOLOR TO IT_MARA-CELLCOLORS.
      MODIFY IT_MARA INDEX 5.
      WA_LAYOUT-CTAB_FNAME = 'CELLCOLORS'.
      CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT       = WA_LAYOUT
        CHANGING
          IT_FIELDCATALOG = IT_FIELDCAT_WRT_OFF
          IT_OUTTAB       = IT_MARA[].
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Try to assign appropriate points.
    Regards,
    Suman

  • Dynamically create Table partition

    Hi all,
    Anybody having script to add partition to a table using plsql.My requirment is to create partition for every month ( time_id , from time attribute table ) dynamically.
    Thanks in Advance
    Ramesh K C R

    Just build you SQL statement to create partition in a VARCHAR2 variable
    and use EXECUTE IMMEDIATE to run it.
    Take care to have been granted directly privileges to run CREATE TABLE, ALTER TABLE (not through a role) or create you code with AUTHID CURRENT_USER clause.

  • How can I sort a dynamically generated table

    I am dynamically populating the columns in a table every time my page is loaded. (see code below)
    This is all working fine, and I am also able to use the built in pagination.
    However, I run into problems as soon as I click on a column header to try sort the table.
    I assume that because the columns are not defined in the JSP (because they are added dynamically), the sort criteria is referring to non-existant columns once the page reloads.
    I get an exception as follows
    Exception Details:  org.apache.jasper.JasperException
      #{currentRow.value['categories.category_id']}Can anyone suggest a solution so that I can sort the data for my dynamically generated table?
    Cheers,
    Ian
    //NOTE: I call populateTable(tableRowGroup1,dynamicRowSetDataProvider) in my prerender code.
    //tableRowGroup1 is defined as an empty (ie no children) row group in the JSP
    private void populateTable(TableRowGroup rowGroup, DataProvider dp) {
        rowGroup.setSourceVar("currentRow");
        try {
            FieldKey[] columnNames = dp.getFieldKeys();    
            for(int i=0; i < columnNames.length; i++) {
                String columnName = columnNames.getFieldId();
    info(i+": columnName");
    rowGroup.getChildren().add(
    createStaticTextColumn(columnName, "#{currentRow.value['"+columnName+"']}")
    } catch (Exception ex) {
    log("Error Description", ex);
    info("Error Description : " + ex);
    return;
    private TableColumn createStaticTextColumn(String heading, String dataField) {
    TableColumn tableColumn = new TableColumn();
    tableColumn.setHeaderText(heading);
    tableColumn.setSort(dataField);
    TextField staticText = new TextField();
    ValueBinding vb = getApplication().createValueBinding(dataField);
    staticText.setValueBinding("text", vb);
    tableColumn.getChildren().add(staticText);
    return tableColumn;

    I'm also having this problem, and I'm sure many more are too. It seems that no one has a solution, but perhaps that makes it even more value able for a sun dev to figure it out. It's surprising that it's so difficult to make dynamically generated tables with JSC.

  • How can i edit perticular row in dynamically created table

    Hi to All,
    Here my requirement is create table dynamically from existing XML and first column with radio buttons,column data and row wise data there on XML but i'm able to create table and displaying data then whenever i click on first column radio button that row editable and remaining rows in disable mode then i edit that row and click on save button that particular row data will be inserted to XML.Please tell me how can i achieve this requirement.
    Thanks and Regards,
    surya.

    Hi surya
    - Use RadioButtonGroupByIndex for the first column.
    - Disable automatic change of table's lead selection: selectionChangeBehaviour = manual, selectionMode = none.
    - In onSelect event handler of the RadioButtonGroupByIndex set new table's lead selection from the code to the row where the button is clicked.
    - Add calculated read-only attribute isRowEditable (boolean) to the table's node. Getter shall be like this:
    return (element.index() == element.node().getLeadSelection());
    - Bind the cell editors' enabled property to isRowEditable attribute.
    BR, Siarhei
    PS: this is my message #666 - do not trust it
    Edited by: Siarhei Pisarenka on Feb 23, 2010 2:29 PM

  • To color selected cells in dynamically created table in ALV.

    Hi,
           The requirement is to display a table (whose columns are dynamic) using ALV n to color few cells of the table based on some condition.
    For creating the table dynamically i have used the method cl_alv_table_create=>create_dynamic_table.
    Now for coloring the cells i tried to use the field EMPHASIZE .
    But when I try this method the whole column is getting colored.
    So any suggestions on how to color only particular cells.

    Hi,
    Try this one...
    DATA: gs_layout TYPE slis_layout_alv, "Define layout
    gt_color TYPE lvc_t_scol WITH HEADER LINE. "Define Internal Table for Cell Colouring
    Use below Sample Code after building a Field Catalog:
    gs_layout-coltab_fieldname = 'COLINFO'.
    " 'it' is the final internal table which contain positive & negative value of Field 'MENGE'
    LOOP AT it.
    REFRESH gt_color.
    CLEAR gt_color.
    IF it-menge GE 0.
    CLEAR gt_color.
    gt_color-fname = 'MENGE'.
    gt_color-color-col = cl_gui_resources=>list_col_positive.
    gt_color-color-int = 0.
    APPEND gt_color.
    ELSEIF it-menge LE 0.
    CLEAR gt_color.
    gt_color-fname = 'MENGE'.
    gt_color-color-col = cl_gui_resources=>list_col_negative.
    gt_color-color-int = 0.
    APPEND gt_color.
    ENDIF.
    it-colinfo[] = gt_color[].
    MODIFY it.
    ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = g_repid
    is_layout = gs_layout
    it_fieldcat = ct_fieldcat
    i_save = 'A'
    TABLES
    t_outtab = it
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    Hope this solves your problem.
    Regards,
    Tarun

  • What is the best way to dynamically create table partition by year and month based on a date column?

    Hi,
    I have a huge table and it will keep growing. I have a date column in this table and thought of partition the table by year and month. Can any you suggest better approach so that partition will create automatically for new data also along with the existing
    data? Nothing but automatically/dynamically partition should create along with file group and partition files.
    Thanks in advance!
    Palash 

    Also this one
    http://weblogs.sqlteam.com/dang/archive/2008/08/30/Sliding-Window-Table-Partitioning.aspx
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Dynamically creating table and inserting rows and columns using JSP

    Hi,
    I'm using mysql and JSP to create web interface for my forms/tables. I wanna create the table dynamically depending on the data in the table and for each particualar record. and these values shud be loaded on the form after loading from the databaes as soon as the form loads.
    also i want to have a button which shud add new rows dynamically. and same one for columns.
    how do i calculate the values across the rows on the forms
    I'm new to JSP. Please point me in the right direction...any tutorials or code will be helpful.
    Any help is appreciated.
    Thanks
    Ayesha

    u write the code in sequence:
    1 write jdbs to select count(* )from table
    2 put in array e.g. String doc_no=new String[count];
    3 write jdbs to select * from table with condition
    //for no. of records just write
    for(int j=0;j<(count);j++){
    <% while(rs4.next()){
         doc_no=rs4.getString(2);
                        date1[i]=rs4.getString(3);
         doc_type[i]=rs4.getString(4);
         location[i]=rs4.getString(5);
         cheque[i]=rs4.getString(6);
         rate[i]=rs4.getInt(7);
         deb_qty[i]=rs4.getInt(8);
         cre_qty[i]=rs4.getInt(9);
         deb_amt[i]=rs4.getInt(10);
         cre_amt[i]=rs4.getInt(11);
         i++;
         //rs4.close();
                   for(int j=0;j<(count);j++){
                   System.out.println("Data count= "+j);
                   %>
    <tr>
    <td width="15%"><font size="1"><%=doc_no[j] %></font></td>
    <td width="10%"><font size="1"><%=date1[j] %></font></td>
    <td width="12%"><font size="1"><%=doc_type[j] %></font></td>
    <td width="9%"><font size="1"><%=location[j] %></font></td>
    <td width="9%">
    <div align="left"><font size="1"><%=cheque[j] %></font></div>
    </td>
    <td width="8%">
    <div align="right"><font size="1"><%=deb_qty[j] %></font></div>
    </td>
    <td width="8%">
    <div align="right"><font size="1"><%=cre_qty[j] %></font></div>
    </td>
    <td width="9%">
    <div align="right"><font size="1"><%=deb_amt[j] %></font></div>
    </td>
    <td width="10%">
    <div align="right"><font size="1"><%=cre_amt[j] %></font></div>
    </td>
    </tr>
    write if there is any specific problem
    bye,
    Samir

  • Problem accessing dynamically created table line

    Hi everyone.
    I'm unable to solve the following problem:
    In an offline scenario I have a table which contains one line at creation time. The form offers a button to add lines to the table using javascript and the instanceManager of the table.
    If the added lines are beeing filled by the user I can extract that data without a problem.
    But I cannot acces the newly generated fields with java script.
    I'm not sure, what the problem is. Here is the code, which should do the job:
    xfa.resolveNode("xfa.form.data.Inhalt.CONTACTS.DATA.NAMEV[" + position + "]").rawValue = 'Andreas';
    This works fine, for the table line, that exists right from the beginning(position = 0), but not for any added line.
    I keep getting this error: xfa.resolveNode("xfa.form.data.Inhalt.CONTACTS.DATA.NAMEV[" + position + "]") has no properties
    What am I doing wrong?
    Thanks for any hints,
    Andreas.

    Solved the problem now and it was fairly easy looking at it now.
    I don't know, why the above mentioned adressing does not work, but it works like this:
    var tab = xfa.resolveNodes("xfa.form.data.Inhalt.CONTACTS.DATA[*]");
    // get the last position
    var last = xfa.resolveNodes("xfa.form.data.Inhalt.CONTACTS.DATA[*]").length - 1;
    // fill values
    tab.item(last).NAME1.rawValue = "Andreas";
    Edited by: Andreas Heckele on May 17, 2010 11:07 AM

  • SORT DYNAMIC INTERNAL TABLE

    Hello everybody.
    How can I sort a dynamic internal table ???
    The sentence sort <gt_table> by matnr werks doesn' t work... How can I do it ??
    Thanks a lot.
    Regards

    Here is an example:
    PARAMETERS dbtab TYPE c LENGTH 30.
    SELECT-OPTIONS columns FOR dbtab NO INTERVALS.
    DATA: otab TYPE abap_sortorder_tab,
    oline TYPE abap_sortorder,
    dref TYPE REF TO data.
    FIELD-SYMBOLS: <column> LIKE LINE OF columns,
    <itab> TYPE STANDARD TABLE.
    TRY.
    CREATE DATA dref TYPE STANDARD TABLE OF (dbtab).
    ***I have assigned the value dref to internal table as follows***
    ASSIGN dref->* TO <itab>.
    CATCH cx_sy_create_data_error.
    MESSAGE 'Wrong data type!' TYPE 'I' DISPLAY LIKE 'E'.
    LEAVE PROGRAM.
    ENDTRY.
    TRY.
    SELECT *
    FROM (dbtab)
    INTO TABLE <itab>.
    CATCH cx_sy_dynamic_osql_semantics.
    MESSAGE 'Wrong database table!' TYPE 'I' DISPLAY LIKE 'E'.
    LEAVE PROGRAM.
    ENDTRY.
    LOOP AT columns ASSIGNING <column>.
    oline-name = <column>-low.
    APPEND oline TO otab.
    ENDLOOP.
    TRY.
    SORT <itab> BY (otab).
    CATCH cx_sy_dyn_table_ill_comp_val.
    MESSAGE 'Wrong column name!' TYPE 'I' DISPLAY LIKE 'E'.
    LEAVE PROGRAM.
    ENDTRY.

  • How to access a dynamic created attribute in a context node?

    <i>Hello,</i>
    <i>who could help? I can't set a value for a dynamically created attribute which is bind to a table.</i>
    <i>My context of the view looks as follow (is defined in NetWeaver):</i>
      - Context
         - Availability (Node)
             - vctxService (Attribute)
             - vctxServiceDesc (Attribute)
             - ... (further predefined attributes)
             - ... (some have to be set dynamically as follows)
    <i>Then I have added attributes dynamically in the wdDoModifyView(...) - method, as follows:</i>
    for (int i = 0; i < max; i++) {
       // some code to dynamically create table columns
       // adding attributes dynamically
       IWDAttributeInfo attrInfo =       wdContext.nodeAvailability().getNodeInfo().      addAttribute("vctxAvailability_" + i, "ddic:com.sap.dictionary.string");
       tv.bindText(attrInfo); // bind to TextView in table
    <i>In the method onPlugFrom... I tried to set the values for the attributes "vctxAvailability_ + i" as follows:</i>
    for (int i = 0; i < max; i++) {
       IAvailabilityElement newAvailNodeElement =     wdContext.createAvailabilityElement();
       // some values will be set for the
       // predefined attributes of AvailabilityNode
       // newAvailNodeElement.set...( value );
       // newAvailNodeElement.setVctxService( xy.getServ() );
       // now the values of dynamically created and added
       // attributes in AvailabilityNode will be added
       // THIS DOESN'T WORK
       newAvailNodeElement.setAttributeValue    ("vctxAvailability_" + i, "value" + i);
    <i>It would be great if someone could help me.
    Thanks in advance.
    Kind regards,
    Carsten</i>

    Carsten,
    Here is a sample code that creates context attributes dynamically and also sets values:
    //Creates a node
    IWDNodeInfo nodeInfo = wdContext.wdGetAPI().getRootNodeInfo().addChild("TestNode", null, true, true, false, true, false, true, null, null, null);
    //If you want to bind the node to a model node then the
    //second argument to the above method should be the
    //model class.
    //Creates an attribute under the node just created.
    IWDAttributeInfo testAttrib = wdContext.wdGetAPI().getRootNodeInfo().getChild("TestNode").addAttribute("testAttrib", "ddic:com.sap.dictionary.string");
    IWDNodeElement testNode = wdContext.getChildNode("TestNode", IWDNode.LEAD_SELECTION).getCurrentElement();
    IWDNode testNode2 = wdContext.getChildNode("TestNode", IWDNode.LEAD_SELECTION);
    //Now you can bind testNode with the Model Node
    //You can also set a value to the newly created attribute
    testNode.setAttributeValue("testAttrib", new String("Value"));
    Hope this helps.
    Shakeel

  • Create Create table statement dynamicallly

    I am trying to create a SP that  return a “Create table  “statement dynamically using a table called “Employee” in database. How can I create a dynamic Create Table
    statement using sys.table? The create table statement should contains all the columns from Employee table.. i am using SQL server 2008 R2

    Hi SSAS_5000,
    If you don't care about the constraints,dependency on the Table Employee and what you'd like is the table structure, you may use the below statement where the create statement generated from the SP is executed.
    SELECT TOP 1 * INTO desiredTable FROM Eemploy;
    TRUNCATE TABLE desiredTable
    If you have question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

Maybe you are looking for

  • Asant build problem

    Hi! I have problem with asant build command. I am trying to do the J2EE ejb/converter example on Windows 2000 command line and I am getting the following error: Buildfile: build.xml init: prepare: [mkdir] Created dir: G:\Sun\j2eetutorial14\examples\e

  • Don't understand the java.lang.OutOfMemoryError

    Hi there, I try to create an 'About' frame for a small programm I created and I get an java.lang.OutOfMemoryError which I don't understand. Can somebody help? Here is my code: * TabbedPaneDemo.java is a 1.4 example that requires one additional file:

  • Will not retain setting for location Bar setting to Nothing

    Using Firefox 4.0.1 When selecting Tools,Options,Location Bar, set to nothing, As long as I am in same session of Firefox it retains setting. When closing the application and then starting up again the setting reverts to default.

  • How to add 52 and 53 raduis attributes

    please, I am configuring a 10000 and I need to add "Acct-Input-Gigawords" and "Acct-Output-Gigawords" in the accounting register. How can I configure that ? Thanks in advance ! Cleber

  • Deactivate 3.6

    I cant deactivate Lightroom 3.6 There is no deactivate option under help menu.  Is there a numbeer I can call to get support help?