Wednesday, March 28, 2012

new to ms sql having trouble with very basic commands

I'm more used to mysql, which i haven't coded for a while, but how do you show tables? or show databases you have available from the osql prompt?hello?|||Use the Information Schema

-- Show Tables
SELECT * FROM INFORMATION_SCHEMA.TABLES

besides the TABLES view of the Schema, there are many others

Here is a list of the views provided by SQL Server 2000

CHECK_CONSTRAINTS
Holds information about constraints in the database

COLUMN_DOMAIN_USAGE
Identifies which columns in which tables are user-defined datatypes

COLUMN_PRIVILEGES
Has one row for each column level permission granted to or by the current user

COLUMNS
Lists one row for each column in each table or view in the database

CONSTRAINT_COLUMN_USAGE
Lists one row for each column that has a constraint defined on it

CONSTRAINT_TABLE_USAGE
Lists one row for each table that has a constraint defined on it

DOMAIN_CONSTRAINTS
Lists the user-defined datatypes that have rules bound to them

DOMAINS
Lists the user-defined datatypes

KEY_COLUMN_USAGE
Lists one row for each column that's defined as a key

PARAMETERS
Lists one row for each parameter in a stored procedure or user-defined function

REFERENTIAL_CONSTRAINTS
Lists one row for each foreign constraint

ROUTINES
Lists one row for each stored procedure or user-defined function

ROUTINE_COLUMNS
Contains one row for each column returned by any table-valued functions

SCHEMATA
Contains one row for each database

TABLE_CONSTRAINTS
Lists one row for each constraint defined in the current database

TABLE_PRIVILEGES
Has one row for each table level permission granted to or by the current user

TABLES
Lists one row for each table or view in the current database

VIEW_COLUMN_USAGE
Lists one row for each column in a view including the base table of the column where possible

VIEW_TABLE_USAGE
Lists one row for each table used in a view

VIEWS
Lists one row for each view

-------------
You probably need to get hold of the SQL books online and the SQL tools; that will help quite a bit.|||thanks, thats been most helpful,

I'm going to bookmark this page :)

which sql tools are you reffering to?

No comments:

Post a Comment