IF (this.oSql.Execute("sp_help") = -1) this.cErrormsg = this.oSql.cErrorMsg RETURN .f. ENDIF IF llViews SELECT * from TSQLQuery WHERE object_type = "view" AND owner # "sys" AND owner # "INFORMATION_SCHEMA" INTO CURSOR TTables else SELECT * from TSQLQuery WHERE object_type = "user table" INTO CURSOR TTables ENDIFTo get table comments:
*** Get Description lcSql = "SELECT * FROM ::fn_listextendedproperty('MS_Description', 'user', 'dbo','table', '" + ; lcTable + "', NULL,default)" lnResult = this.oSQL.Execute(lcSQL,"TTableComment")To get columns:
*** Retrieve the standard Column stats lnResult = THIS.oSQL.Execute("Exec sp_columns '" + lcTable + "'")To retrieve column comments:
*** Retrieve extended properties in order to retrieve column comments lcSql = "SELECT * FROM ::fn_listextendedproperty('MS_Description', 'user', 'dbo','table', '" + ; lcTable + "', 'column',default)" lnResult = this.oSQL.Execute(lcSQL,"TTableComments")Works rather well and I think for 2000-2008 but definitely for 2005 and 2008.