SQL Server commands dot net nuke Getting table structure procedure
There are manby things which are considered as basics in dot net nuke.When you are using host sql window from dnn then most definitely you will need to have ideas of basic sql statements to fetch info from db.Few of them are:-
Listing all tables from DataBase:-
SELECT * FROM information_schema.Tables
Get Stored procedure description and Structure:-
select * from information_schema.routines where routine_name = ‘Stored Procedure Name’
Querry to fetch all tables in a database:
select * from sysobjects where type=āuā
Querry to fetch all procedures in a database:
select * from sysobjects where type=āpā
Display Table Creation And Owner info
sp_help table_name
Display Table structure and columns:-
sp_columns @table_name = ‘table_name‘
this will show all fields from table table_name including data type and length information.
Return a list of objects that can be queried in the current environment
EXEC sp_tables
Return information about the syscolumns table in the Company database
EXEC sp_tables syscolumns, dbo, Company, "'SYSTEM TABLE'"
Altering/modifying cloumn Width :-
alter table table_name ALTER COLUMN column_name varchar(30)
