SQL server取得所有table資料筆數的方法

SQL server取得所有table資料筆數的方法 « oDDs.Bl@H

SQL server取得所有table資料筆數的方法

以下指令可以查詢SQL server資料庫所有table的資料筆數 (由大到小排列)。可以很快知道資料筆數大的table,並做進一步管理。

select o.name, i.rows
from sysobjects o inner join sysindexes i on o.id = i.id
where i.indid = 1
order by i.rows desc

另一個好用的store procedure是sp_spaceused,這個指令可以查詢某個table目前的資料筆數和資料所佔的硬碟空間,指令如下:

exec sp_spaceused ‘’

不錯的技術網站, 和我接觸的領域很類似

Tech on the Net

Tech on the Net is dedicated to providing helpful advice, how-to’s and FAQs. We focus on technologies such as Microsoft Access, Microsoft Excel, Microsoft Word, SQL, Oracle/PLSQL, UNIX, and Linux.

The information presented here is suitable for all programmers from beginner to expert. We hope you find this information useful and return to our site, as we expand our information base.

Forums

We’re proud to offer a new feature to our site called techonthenet.com Forums. We encourage you to visit the forums to post questions and answers relating to Oracle, Microsoft Access, and Microsoft Excel. Or just browse the forums to find answers to many of the questions that you may have.

You can access the techonthenet.com Forums by clicking on the Forums link in the Navigation bar at the top of any one of our pages. Register now and be one of the first to post!

取得sql server中的table structure

请问微软专家!!!如何用ADO.NET 枚举数据库的表、字段及类型长度等 .NET技术 / 其他 – CSDN社区 community.csdn.net

CREATE PROCEDURE sp_columns (
@table_name nvarchar(384),
@table_owner nvarchar(384) = null,
@table_qualifier sysname = null,
@column_name nvarchar(384) = null,
@ODBCVer int = 2)
AS
DECLARE @full_table_name nvarchar(769)
DECLARE @table_id int

how to change ip address in DOS

在vista, xp的dos下也可以使用這個指令來更改ip address

How to Use the NETSH Command to Change from Static IP Address to DHCP in Windows 2000

先用這個指令來看你的網卡名稱
C:\>Netsh interface ip show config
介面 “無線網路連線" 的設定
    已啟用 DHCP:                         是
    IP 位址:                           192.168.103.100
    子網路首碼:                        192.168.103.0/24 (遮罩 255.255.255.0)
    預設閘道:                             192.168.2.1
    閘道公制:                             0
    預設閘道:                             192.168.103.254
    閘道公制:                             0
    介面公制:                      25
    透過 DHCP 設定的 DNS 伺服器:  192.168.103.254
    以哪個尾碼登錄:                       僅主要尾碼
    透過 DHCP 設定的 WINS 伺服器: 無

再用下列指令來更改ip
C:\>netsh interface ip set address “無線網路連線" static 192.168.0.10 255.255.255.0 192.168.0.1 1

SQL Server FAQ

http://dba.fyicenter.com/faq/sql_server_2/EXECUTE_Executing_Stored_Procedures.html

  1. What Are Stored Procedures?
  2. How To Create a Simple Stored Procedure?
  3. How To Execute a Stored Procedure?
  4. How To List All Stored Procedures in the Current Database?
  5. How To Drop an Existing Stored Procedure?
  6. How To Create a Stored Procedure with a Statement Block?
  7. How To End a Stored Procedure Properly?
  8. How To Generate CREATE PROCEDURE Script on an Existing Stored Procedure?
  9. How To Get the Definition of a Stored Procedure Back?
  10. How To Modify an Existing Stored Procedure?
  11. How To Create Stored Procedures with Parameters?
  12. How To Provide Values to Stored Procedure Parameters?
  13. What Are the Advantages of Passing Name-Value Pairs as Parameters?
  14. Can You Pass Expressions to Stored Procedure Parameters?
  15. How To Provide Default Values to Stored Procedure Parameters?
  16. How To Define Output Parameters in Stored Procedures?
  17. How To Receive Output Values from Stored Procedures?
  18. How To Create a Local Temporary Stored Procedure?
  19. Can Another User Execute Your Local Temporary Stored Procedures?