IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » count The latest public count snipts.

showing 1-9 of 9 snipts for count
  • Count tables, views, stored procedures and functions in Database
    --- /* Count Number Of Tables In A Database */
        SELECT COUNT(*) AS TABLE_COUNT FROM INFORMATION_SCHEMA.TABLES
        WHERE TABLE_TYPE='BASE TABLE'
    
    ---    /* Count Number Of Views In A Database */
         SELECT COUNT(*) AS VIEW_COUNT FROM INFORMATION_SCHEMA.VIEWS
    
     ---   /* Count Number Of Stored Procedures In A Database */
        SELECT COUNT(*) AS PROCEDURE_COUNT FROM INFORMATION_SCHEMA.ROUTINES    WHERE ROUTINE_TYPE = 'PROCEDURE'
    
      ---  /* Count Number Of Functions In A Database */
        SELECT COUNT(*) AS FUNCTION_COUNT FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'FUNCTION'
    

    copy | embed

    0 comments - tagged in  posted by aturgarg on Jun 09, 2010 at 6:02 a.m. EDT
  • Count number of tables in a SQL Server database
    USE YOURDBNAME
    SELECT COUNT(*) from information_schema.tables
    WHERE table_type = 'base table' 
    

    copy | embed

    0 comments - tagged in  posted by aturgarg on May 19, 2010 at 2:53 a.m. EDT
  • Returns the number of results
    <?php echo $wp_query->found_posts; ?>
    

    copy | embed

    0 comments - tagged in  posted by depi on Mar 02, 2010 at 4:13 p.m. EST
  • Count Monthly/Yearly Totals in MySQL
    SELECT 
          MONTHNAME(createDt) AS month,
          YEAR(createDt) AS year,
          COUNT(*) AS total
    FROM tracking
    GROUP BY MONTH(createDt), YEAR(createDt)
    ORDER BY id
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Jan 21, 2010 at 5:01 p.m. EST
  • count how many pdf or chm files are there in endnote
    ls -R -l /Users/sixinghuang/Documents/My\ EndNote\ Library.Data | egrep "\.pdf|\.chm" | wc -l
    

    copy | embed

    0 comments - tagged in  posted by dgg32 on Jan 02, 2010 at 9:17 p.m. EST
  • Count Files and Folders
    ls -l | wc -l
    

    copy | embed

    0 comments - tagged in  posted by winker on May 15, 2009 at 2:28 a.m. EDT
  • Méthode pour compter les résultats depuis un SELECT utilisant une clause LIMIT
    SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name
    WHERE id > 100 LIMIT 10;
    SELECT FOUND_ROWS();
    

    copy | embed

    0 comments - tagged in  posted by joanfabregat on Apr 13, 2009 at 6:20 p.m. EDT
  • Table sizes
    DECLARE @TableName VARCHAR(100)    --For storing values in the cursor
    
    --Cursor to get the name of all user tables from the sysobjects listing
    DECLARE tableCursor CURSOR
    FOR 
    select [name]
    from dbo.sysobjects 
    where  OBJECTPROPERTY(id, N'IsUserTable') = 1
    FOR READ ONLY
    
    --A procedure level temp table to store the results
    CREATE TABLE #TempTable
    (
        tableName varchar(100),
        numberofRows int,
        reservedSize varchar(50),
        dataSize varchar(50),
        indexSize varchar(50),
        unusedSize varchar(50)
    )
    
    --Open the cursor
    OPEN tableCursor
    
    --Get the first table name from the cursor
    FETCH NEXT FROM tableCursor INTO @TableName
    
    --Loop until the cursor was not able to fetch
    WHILE (@@Fetch_Status >= 0)
    BEGIN
        --Dump the results of the sp_spaceused query to the temp table
        INSERT  #TempTable
            EXEC sp_spaceused @TableName
    
        --Get the next table name
        FETCH NEXT FROM tableCursor INTO @TableName
    END
    
    --Get rid of the cursor
    CLOSE tableCursor
    DEALLOCATE tableCursor
    
    --Select all records so we can use the reults
    SELECT * 
    FROM #TempTable order by numberofRows desc
    
    --Final cleanup!
    DROP TABLE #TempTable
    

    copy | embed

    0 comments - tagged in  posted by DavidV on Feb 20, 2009 at 2:50 a.m. EST
  • Table row count
    SELECT 
        [TableName] = so.name, 
        --[RowCount] = MAX(si.rows)
        *
    FROM 
        sysobjects so, 
        sysindexes si 
    WHERE 
        so.xtype = 'U' 
        AND 
        si.id = OBJECT_ID(so.name) 
    --GROUP BY 
    --    so.name 
    ORDER BY 
        2 DESC
    

    copy | embed

    0 comments - tagged in  posted by DavidV on Feb 20, 2009 at 2:50 a.m. EST
Sign up to create your own snipts, or login.