SELECT @@ROWCOUNT : ROWCOUNT « System « SQL Server / T-SQL

SQL Server / T-SQL
1. Aggregate Functions
2. Analytical Functions
3. Constraints
4. Cursor
5. Data Set
6. Data Type
7. Database
8. Date Timezone
9. Index
10. Insert Delete Update
11. Math Functions
12. Select Query
13. Sequence
14. Store Procedure Function
15. String Functions
16. Subquery
17. System
18. Table
19. Table Joins
20. Transact SQL
21. Transaction
22. Trigger
23. View
24. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
SQL Server / T-SQL » System » ROWCOUNT 
SELECT @@ROWCOUNT

 



3CREATE TABLE publishers(
4>    pub_id         char(4)           NOT NULL,
5>    pub_name       varchar(40)           NULL,
6>    city           varchar(20)           NULL,
7>    state          char(2)               NULL,
8>    country        varchar(30)           NULL DEFAULT('USA')
9)
10> GO
1>
2>
3insert publishers values('1''Publisher A', 'Vancouver',  'MA', 'USA')
4insert publishers values('2''Publisher B', 'Washington', 'DC', 'USA')
5insert publishers values('3''Publisher C', 'Berkeley',   'CA', 'USA')
6insert publishers values('4''Publisher D', 'New York',   'NY', 'USA')
7insert publishers values('5''Publisher E', 'Chicago',    'IL', 'USA')
8insert publishers values('6''Publisher F', 'Dallas',     'TX', 'USA')
9insert publishers values('7''Publisher G', 'Vancouver',  'BC', 'Canada')
10insert publishers values('8''Publisher H', 'Paris',      NULL, 'France')
11> GO

(rows affected)

(rows affected)

(rows affected)

(rows affected)

(rows affected)

(rows affected)

(rows affected)

(rows affected)
1>
2>
3SELECT FROM publishers
4SELECT @@ROWCOUNT
5SELECT @@ROWCOUNT
6> GO
pub_id pub_name                                 city                 state country
------ ---------------------------------------- -------------------- ----- ------------------------------
1      Publisher A                              Vancouver            MA    USA
2      Publisher B                              Washington           DC    USA
3      Publisher C                              Berkeley             CA    USA
4      Publisher D                              New York             NY    USA
5      Publisher E                              Chicago              IL    USA
6      Publisher F                              Dallas               TX    USA
7      Publisher G                              Vancouver            BC    Canada
8      Publisher H                              Paris                NULL  France

(rows affected)

-----------
          8

(rows affected)

-----------
          1

(rows affected)
1>
2> drop table publishers;
3> GO

 
Related examples in the same category
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.