SQL query table, all field names of the table
2011-07-29 10:21:43| Category: SQL Server | Tags: table sql fields | Report | Font size Subscription
SQL query table, all field names of the table
SQL SERVER
View all table names:
Select name from sysobjects where type= ' U '
All field names for the query table:
Select name from syscolumns Where id=object_id (' table name ')
SELECT * FROM Information_schema.tables
SELECT * FROM Information_schema.views
SELECT * FROM Information_schema.columns
ACCESS
View all table names:
Select name from Msysobjects where type=1 and flags=0
Msysobjects is a system object, which is hidden by default. It can be displayed by tools, options, views, displays, system objects, and so on.
Reference:http://hi.baidu.com/yongfa365/blog/item/b35dc8ead20584d3d439c9d1.html
--Add a default database before logging in
EXEC sp_addlogin ' login name ', ' Password ', ' database '
--Delete a login
EXEC sp_droplogin ' login name '
--Give this login access to the database
EXEC sp_adduser ' login name ', ' username ', ' db_owner '
--Backing up the database
Backup database jobcorps_com_cn to disk= ' D:\123.bak '
http://www.wonima.com funniest jokes Pictures, satin sites
SQL query table, all field names of the table, SQL query table, all field names of the table