A script - row number

I need a cf script that finds out the total row count of a
sql database...Any idea?
The reason I need is to compare our current db (on SQL05)
with the new one that will be attached to the SQL 05....

I have found a stored procedure that does what I need...
thank you all
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[listTableRowCounts]
AS
BEGIN
SET NOCOUNT ON
DECLARE @SQL VARCHAR(255)
SET @SQL = 'DBCC UPDATEUSAGE (' + DB_NAME() + ')'
EXEC(@SQL)
CREATE TABLE #foo
tablename VARCHAR(255),
rc INT
INSERT #foo
EXEC sp_msForEachTable
'SELECT PARSENAME(''?'', 1),
COUNT(*) FROM ?'
SELECT tablename, rc
FROM #foo
ORDER BY tablename,rc ASC
DROP TABLE #foo
END

Similar Messages

  • How to identify the Selected row number or Index in the growing Table

    Hi,
    How to find the selected Row number or Row Index of growing  Table using Javascript or Formcalc in Interactive Adobe forms
    Thanks & Regards
    Srikanth

    After using bellow script it works fine
    xfa.resolveNode("Formname.Table1.Row1["this.parent.index"].fieldname").rawValue;

  • Retrieving the row number of a specific record from the results of a MySQL query

    I want to create a MySQL query that will return a list of
    records, and then retrieve the row number of a record with a
    specific ID. How can I do this?
    *server-side script: PHP

    <?php
    $i = 0;
    do {
    $i++;
    } while (mysql_fetch_assoc($rsWhatever) &&
    $row_rsWhatever['ID'] !=57);
    echo "TADA -" . $i;
    ?>
    (assuming that ID is numeric, and that the test value
    actually exists in the
    database)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "AngryCloud" <[email protected]> wrote in
    message
    news:g4e6ck$hrb$[email protected]..
    >I will use this scenario for an example:
    >
    > I want to know how far down the list I will find the ID,
    '57'.
    >
    > So I manually look at the list of results and see it is
    the 25th record
    > down
    > on the list.
    >
    > How do I get my PHP script to get this number (25)
    automatically?
    >

  • Invalid Row Number with Gallery Widget

    Hi all,
    I'm having some trouble with selecting the correct gallery
    with the gallery widget. Instead of using the dropdown as shown in
    the demo, I want to use a query string for selecting the gallery.
    This is what I've done:
    <script type="text/javascript">
    function selectPortfolio() {
    var _wl = window.location.toString();
    var _pId = _wl.substring(_wl.lastIndexOf('=') + 1,
    _wl.length);
    dsGalleries.setCurrentRowNumber(_pId.toString());
    </script>
    </head>
    <body onload="selectPortfolio();">
    When I try to hit the following URL:
    my_website/portfolio.html?id=1, I'm trying to set the
    currentRowNumber to 1. When I debug through the the SpryData.js
    file I see the following function getting executed:
    Spry.Data.DataSet.prototype.setCurrentRowNumber =
    function(rowNumber)
    if (!this.data || rowNumber >= this.data.length)
    Spry.Debug.trace("Invalid row number: " + rowNumber + "\n");
    return;
    I can see rowNumber coming through as 1. However, this.data
    is coming back as null.
    Anyone see anything wrong with what I've done here?
    Sean

    Try to mkae it simple ;
    &Total=0;
    &RS_LEVEL0 = GetLevel0();
    &Row_LEVEL0=&RS.Getrow(1);
    &RS_LEVEL1=&Row.Getrowset(Scroll.JournalLine1);
    For &I=1 to &RS_LEVEL1.Activerowcount;
    &Row_LEVEL1=&RS_LEVEL1.Getrow(&I);
    &Record_LEVEL1=&Row_LEVEL1.GetRecord(Record.JournalLine1);
    &Field_LEVEL1=&Record_LEVEL1.GetField(Field.Amount);
    &Amount=&Field_LEVEL1.Value;
    &Total=&Total + &Amount;
    end-for;
    Your_Level_0_Record_Name.LEVEL_0_TOTAL_FIELD_NAME.value=&Total;
    Hope it will work!!!
    Don't do any declearation it will automaytically decleared.
    Thanks,
    Amit

  • Scalar function For Identity Or Row Number

    Hi
    I need to create a scalar Function that works in the same way as Row Number or a Identity column
    I've not really used functions before so what would be the best way to do this?
    Regards

    Well I'm taking over a ETL process for a OLAP cube which is using SQL scripts and views and Not SSIS, any other logic other than what is available in the design mode of the view are done in functions. If i use the built in one I lose the
    design view.
    If you are making your database design from what you see in some "design mode" you are putting the cart before the horse.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to get row number in the fetch row itself in Sql Query ?

    Hi,
    i am fetching some rows from a sql query . Is there any way to get row number as well in each row while all rows are fetched ?
    like this :
    RowNum data1 data2
    1 abc ere
    2 bnh ioi

    Hello
    Ofcourse you can get the rownum inside a query, just keep in mind that the rownum is the number of order in which the records were fetched from the table, so if you do an order by, the rownum will not be sequential, unless you query the information in a subquery first.
    SELECT rown, col1, col1
    FROM table
    Or
    SELECT rownum, col1, col2
    FROM (SELECT col_1, col_2 FROM table ORDER BY col1)
    Regards
    Johan

  • Find row number of first cell in a relative range that is less than $B$3

    Thanks for any help. I've spent hours searching, trying, and reading iWork Help
    Example:   $B$3 = 3
    Column C
    1:  9
    2:  2
    3:  9
    4:  2
    5:  3
    6:  9
    7:  9
    Find the first occurrence that is less than $B$3 (=3) in the range C3:C6. Return the row # (relative to the range, or actual row number, I don't care)
    Fill Down the formula, so the next cell looks at the range C4:C7
    In this case, I want it to return Row 4 (not 5 or 2)
    Tried this with MATCH (last argument -1 or 1) which almost works, but if it finds an exact match, it returns that row (5) instead of the first one (4)

    The single formula in D2, filled down that column, returns the row number of every row where the value in column C is less than or equal to the value in $B$3.
    The second formula, which I placed in B4, but which can go wherever it's needed, searches a limited range of column D for the minimum value in that range.
    In the example, based on your initial question, the range is three cells.  In B4, it's D2:D4; in B5 it's D3:D5, etc., with Numbers automatically adjusting the cell references as the formula is filled down the column. In each case, the formula returns the minimum value it finds in the three cell range, which is the row number on which the value in column C first meets the condition (less than or equal to $B$3) within that three cell range.
    In the second example, the formula retrieves the same value (the row number) as above, but instead of displaying it, uses it as the row-offset value in an OFFSET statement to return the Date from the row where the row number was collected.
    NOTE: Looking back at it, I see that in my rush to other duties I made an error in this formula, setting the row offset too high. Revise the formula as shown below to get the date from the correct row:
    Existing: =IF(MAX(D2:D4)=0,"",OFFSET($A$1,MIN(D2:D4),0))
    Revised: =IF(MAX(D2:D4)=0,"",OFFSET($A$1,MIN(D2:D4)-1,0))
    You wrote:
    If I'm following the logic, it would require one column (like D in this example) for every set of rows searched (in my example, B5:B15  filled down, so the next search is B6:B16 and so on).
    No. Provided the values of X and Y are constant for each set of searches, you'll need an auxiliary column for each column of values to be searched. One auxiliary column is used to mark the rows in which the value in B meets the condition ">x", the second to mark the rows where the value in C meets the condition "<y".
    The search formula (above) searches a subset of its column and returns the lowest row number where the condition for that column is met,and either displays that number or uses it to return and display a date.
    Regards,
    Barry

  • How to get row number of selected entry from OVS search result

    Hi,
    Anyone having any idea on how to get row number of the  selected entry/ how to differentiate rows in OVS search result in ON_OVS method?
    Regards,
    Jatin

    Hi,
    You can get the selected record to <ls_selection> structure in co phase 3.
    From that structure you can get what ever field you want.,
    check the below code for reference,
    << Moderator message - Cut and paste response from F4 help for ALV table field removed. Plagiarism is not allowed in SCN >>
    hope this helps u.,
    Thanks & Regards,
    Kiran
    Edited by: Rob Burbank on Jan 5, 2012 5:24 PM

  • Hyp FR Error: 5200 : Error executing query.  Exceed max row number 100000

    Hi,
    I am getting the error
    5200 : Error executing query. Exceed max row number 100000
    when I run the report on Financial Reporting. It gives the same error when run on Workspace.
    Have you guys encountered this error before? What are the best ways to tackle it? Help is much appreciated guys.
    -- Adi
    Edit 1 - I tried to simplify the parameters but I still get the same error making me suspect that the issue is not the 100000 row issue.
    Edited by: Aditya26 on Apr 11, 2012 9:02 AM

    Hi Adi,
    This is from My Oracle Support:
    How to Increase Row Limit to Avoid Error "Exceed Max Row Number 100000" [ID 866832.1]
    Modified 23-FEB-2012 Type HOWTO Status PUBLISHED
    In this Document
    Goal
    Solution
    Applies to:
    Hyperion BI+ - Version: 9.3.1.0.00 to 11.1.1.3.00 - Release: 9.3 to 11.1
    Information in this document applies to any platform.
    Goal
    How do you increase the maximum row limit to avoid the error "5200: Error executing query: Exceed max row number 100000"?
    Solution
    1.Edit \Hyperion\common\ADM\<version>\lib\ADM.properties as follows:
    From MAX_ROW_NUMBERS=100000 to MAX_ROW_NUMBERS=500000
    If you are running extremely large reports, you can increase the limit.
    2.Restart Reporting and Analysis services.
    For version 11.1.2.x
    The path of ADM.properties file in these versions should be located under:
    %Oracle_Home%\Middleware\EPMSystem11R1\commo\ADM\11.1.2.0\lib
    Cheers,
    Mehmet

  • Word Links not updating when row number changes in excel

    Hi,
    I have a huge excel file with employee name,code,dob etc as fields.I linked it to word documents using paste special and macros.Everything works fine and word also updates with changes in excel file, but problem arises when in excel , data is added in the
    middle rather than at the end of the file. This changes the row numbers of all the employees.Hence when I  open corresponding word document, some one else's details open. So now i have to edit links in word...office->prepare->edit links, Here i
    have an option called ITEM IN FILES... this is where the problem occurs...It requires mentioning the row no of the corresponding pasted link...but when i change data in excel and row no changes...this should be automatically detected by Word and row number
    should be updated there.Please help me find a way to resolve this.This is what it looks like....
     Data for VC!R1C2:R2C13
    I want R1 and R2 to change automatically if I change rows in excel file.
    Thank you

    Instead of specifying a cell range in the LINK field, name the range in Excel, then use the range name in the LINK field.
    For example, instead of:
    VC!R1C2:R2C13
    you might have:
    VC!MyRange
    in Word.
    That way, the LINK will point to the named range, regardless of how many rows and/or columns are added/deleted before it. Furthermore, if you expand or contract the range (e.g. by adding/deleting columns between the first & last column), the
    named range and, hence the linked range, will likewise expand/contract.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • How to give a checkbox the value "row number" (like [row selector])

    I like to define a checkbox with htmldb_item.checkbox and give the checkbox the value 'row number'.
    It has to be the row number as displayed. Therefore I cannot use rownum or row_number() because the htmldb sorting functionality change the sequence after the row numbers are given.
    How can I give the checkbox this value, or as alternative how can I get the current row (checkbox element) in javascript from the checkbox onclick event.

    Vikas,
    Thanks a lot.
    This works.
    I use this number also to construct javascript and I walk in problems which are also solved now.
    therefore for anyone else who also want to use '#ROWNUM#'. keep in mind that for the sql #ROWNUM# is just a string and should be treated as a string therefore use quotes around it. The #ROWNUM# string is translated after executing the query, when the page is constructed from the result of the query.
    Fred.

  • Problem obtaining row number in a TableView

    I have a TableView configured by means of a MapValueFactory as it is shown in the code below:
    private void configureColumns() {
        getColumns().clear();
        List<String> nonAnonymousVariablesNames = getNonAnonymousVariablesNames();
        if(nonAnonymousVariablesNames != null && !nonAnonymousVariablesNames.isEmpty()) {
            for(String nonAnonymousVarName : nonAnonymousVariablesNames) {
                TableColumn<Map<String, Term>, Term> dataColumn = new TableColumn<>(nonAnonymousVarName);
                dataColumn.setCellValueFactory(new MapValueFactory(nonAnonymousVarName));
                dataColumn.setMinWidth(130);
                Callback<TableColumn<Map<String, Term>, Term>, TableCell<Map<String, Term>, Term>>
                    cellFactoryForMap = new Callback<TableColumn<Map<String, Term>, Term>, TableCell<Map<String, Term>, Term>>() {
                        @Override
                        public TableCell call(TableColumn p) {
                            TextFieldTableCell tableCell = new TextFieldTableCell();
                            TableRow row = tableCell.getTableRow();
                            final int index = row.getIndex();
                            StringConverter sc = new StringConverter() {
                                @Override
                                public String toString(Object t) {
                                    //return something based on the current row and the object t
                                @Override
                                public Object fromString(String string) {
                                    return null;
                            tableCell.setConverter(sc);
                            return tableCell;
                dataColumn.setCellFactory(cellFactoryForMap);
                getColumns().add(dataColumn);
    I am trying to get the row number before printing the content of a cell. However, the call to row.getIndex(); triggers the following exception:
    SEVERE: javafx.scene.control.Control impl_processCSS The -fx-skin property has not been defined in CSS for TableRow[id=null, styleClass=cell indexed-cell table-row-cell]
    SEVERE: javafx.scene.control.Control loadSkinClass Failed to load skin 'StringProperty [bean: TableRow[id=null, styleClass=cell indexed-cell table-row-cell], name: skinClassName, value: com.sun.javafx.scene.control.skin.TableRowSkin]' for control TableRow[id=null, styleClass=cell indexed-cell table-row-cell]
    java.lang.NullPointerException
        at org.jpc.commons.prologbrowser.model.QueryResultModel$1.call(QueryResultModel.java:74)
        at org.jpc.commons.prologbrowser.model.QueryResultModel$1.call(QueryResultModel.java:1)
        at com.sun.javafx.scene.control.skin.TableRowSkin.recreateCells(TableRowSkin.java:224)
        at com.sun.javafx.scene.control.skin.TableRowSkin.<init>(TableRowSkin.java:87)
        at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at javafx.scene.control.Control.loadSkinClass(Control.java:1044)
        at javafx.scene.control.Control.access$500(Control.java:70)
        at javafx.scene.control.Control$12.invalidated(Control.java:972)
        at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:127)
        at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:161)
        at com.sun.javafx.css.StyleableStringProperty.set(StyleableStringProperty.java:71)
        at javafx.scene.control.Control$12.set(Control.java:964)
        at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:59)
        at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:31)
        at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
        at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:902)
        at javafx.scene.Node.impl_processCSS(Node.java:7415)
        at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
        at javafx.scene.control.Control.impl_processCSS(Control.java:1154)
        at com.sun.javafx.scene.control.skin.VirtualFlow.setCellIndex(VirtualFlow.java:1598)
        at com.sun.javafx.scene.control.skin.VirtualFlow.addTrailingCells(VirtualFlow.java:1114)
        at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1007)
        at javafx.scene.Parent.layout(Parent.java:1018)
        at javafx.scene.Parent.layout(Parent.java:1028)
        at javafx.scene.Parent.layout(Parent.java:1028)
        at javafx.scene.Parent.layout(Parent.java:1028)
        at javafx.scene.Parent.layout(Parent.java:1028)
        at javafx.scene.Parent.layout(Parent.java:1028)
        at javafx.scene.Scene.layoutDirtyRoots(Scene.java:516)
        at javafx.scene.Scene.doLayoutPass(Scene.java:487)
        at javafx.scene.Scene.access$3900(Scene.java:170)
        at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2203)
        at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
        at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
        at com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:329)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
    Is this a bug in JavaFX ? otherwise which is the correct way to obtain the row number in the string converter of the TextFieldTableCell ?

    To get the content of a cell you have to make  setCellSelectionEnabled(true);
    To get the selected row or selected column you can use the following: 
    {code}
            table.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
            table.getSelectionModel().setCellSelectionEnabled(true);
            table.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
                @Override
                public void changed(ObservableValue observable, Object oldvalue, Object newValue) {
                    for (TablePosition t : (ObservableList<TablePosition>) table.getSelectionModel().getSelectedCells()) {
                        System.out.println("The selected column is: " + t.getColumn());
                        System.out.println("The selected row is: " + t.getRow());
    {code}
    If you need only the selected row  (TextFieldTableCell  selected)you can use the following:
    {code}
            table.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue observable, Number oldvalue, Number newValue) {
                    System.out.println("Selected row is " + newValue);
    {code}

  • Problems with Row Number showing up in report

    I have a report question. When I have already created a report, and then I go back into the report to edit it, I want to be able to add the row number to the report. I go to tools, options, sheet, and select show row numbers. Even though the show row numbers option is selected, the report doesnt show the row numbers. Is this a bug? It'd be a major pain to go back and re-build 250 reports becasue I can't add the row number to a report after it is already built.
    Thanks in advance,
    -Mark

    Hey user519817.
    This is perplexing as it simply should work. I'm presently at a site running 4.x (hard after being at a site running 10gr2) and if I go to Tools -> Options -> Table, I can turn on or off the 'row numbers' box and it works as expected.
    If I alter it to a xtab, then the option isn't even there to choose from.
    I went into the Disco Admin as well thinking maybe there was a privilege (wierd but worth a look) that allowed you to have / have not row numbers, but nothing there.
    So it sounds like a 'feature'.
    What version / type of Disco are you running (ie: 4.x desktop, 10i Plus, etc.)?
    Russ

  • How to display the rows number of times by giving the column values?

    Hi All,
    I want to display the rows number of times as the value exists in num column in the below query
    with t AS
       ( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
         UNION ALL
         SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
         UNION ALL
         SELECT 'krishna' NAME,     'hyd' LOC, 1 NUM FROM DUAL )
      SELECT T.* FROM T
      CONNECT BY ROWNUM <= NUM
    Expected output:
             venkatesh            hyd      2
             venkatesh            hyd        2
             prasad                 hyd        3
             prasad                   hyd      3
             prasad                   hyd      3
             krishna           hyd       1Edited by: Nag Aswadhati on Nov 1, 2012 12:34 AM

    Nag Aswadhati wrote:
    Hi All,
    I want to display the rows number of times as the value exists in num column in the below query
    Expected output:
    venkatesh            hyd      2
    venkatesh            hyd        2
    prasad                 hyd        3
    prasad                   hyd      3
    prasad                   hyd      3
    krishna           hyd       1Using Connect By:-
    with t AS
       ( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
         UNION ALL
         SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
         UNION ALL
         select 'krishna' name,     'hyd' loc, 1 num from dual )
      select t.name, t.loc
      from t
      connect by level <= num
             and name = prior name
             and (prior sys_guid() is not null);
    NAME      LOC
    krishna   hyd
    prasad    hyd
    prasad    hyd
    prasad    hyd
    venkatesh hyd
    venkatesh hyd
    6 rows selected

  • Open system form and select a row number on matrix by click on button

    Hi experts,
    I have to open the purchase order form and select a specific row number from the matrix by clicking a button on sales order form.
    is it possible ?
    can anyone help me to achieve it?
    Thanks in advance.
    Best regards
    Andrea

    Andrea,
    To Do? Clicking on a Button on Sales Order -> Opens a PO form, and selects the row?
    In the eventhandler of a button click if the PO is not linked to SO by SAP B1 standard functionality
    step 1. call ActivateMenu ("2305") of Sbo_application , this opens the PO form
    step 2. Change the form to Find mode
    step 3. enter po number to the Item UID "8" which is the document number.
    step 4. Send enter key, or Clikc On button UID "1" which finds the PO
    step 5.read the value from SO form, from matrix "38" line where you selected
    step 6. use the code above to locate the line in PO (use # column for position numbers which UID is 0)
    at step 5, i think you should select a line from SO matrix which you would like to open.
    IN sales order, If you used PO chekcbox on logistics tab to create the PO, you can find a direct link between PO and SO (only in docentries are linked not positions) on sales order,  Column UID 158 field name: potrgnum.  If this connection is exists, you have an easy way:
    SO form, when a user clicks on COlumn 158 (po number), you can implement an eventhandler, which
    step 1.read the value from SO form, from matrix "38" line where you selected
    step 2. use the code above to locate the line in PO (use # column for position numbers which UID is 0)
    By processing theses steps, you can build up you solution.
    Regards
    János

Maybe you are looking for

  • External displays - browser window position when disconnected display

    I'm using a laptop, connecting one or two external displays, - one using the HDMI port, second using an USB "dock station" (Toshiba standalone). Second screen normally to the right, third screen (usb) above the laptop screen. Often when I have discon

  • Creation of multiple database

    how to creation and monitoring multiple databases in one linux box

  • Index out of bound array : calling bapi

    Hi, I am facing a problem while executing a BAPI using the SAP .net connector. The steps I performed are as follows: Created a web project in Visual Studio .net using VB.net Added the SAP Connector Proxy to the project Dragged a Bapi_Customer_Getcont

  • Upgrade of cucm

    Hi everybody, I would like to upgrade my current cucm 7.1.5 to be6k 9.1.2 on new servers. First of all is it a recommended upgrade path using jump upgrade? On is it much safer to start a new clean installation? If i choose the jump upgrade i would li

  • Computer goes to sleep when unplugged and won't charge...

    I've only had my laptop for a year and change, and all of a sudden this evening something weird started happening. It says the battery is completely dead even though I keep it on the charger. Last night I shut it down for the first time in a few week