MySQLsvr .connect("sqlservername","uid","pws");
獲得數據庫信息:
rc3sqldmo.databases mydbs=MySQLsvr.databases;
rc3sqldmo.database2 mydb =new rc3sqldmo.database2class();
mydb=mydbs.item("dbname","owner"); 或mydb=MySQLsvr.databases.item("dbname","owner");
獲得表和字段的信息:
rc3sqldmo.Tables mytbls= MySQLsvr.databases.item("dbname","owner").tables;
rc3sqldmo.table2 mytbl = new rc3sqldmo.table2class();
mytbl = mytbls.item("tablename","owner");或
mytbl = MySQLsvr.databases.item("dbname","owner").tables.item("tablename","owner");
string[3] mylist = new string[3];
rc3sqldmo.column2 myfIEld = new rc3sqldmo.column2class();
foreach(object o in mytbl.columns)
{
myfIEld = (rc3sqldmo.column2) o;
mylist[0]=myfIEld.name;
mylist[1] = myfIEld.datatype;
mylist[2] =myfIEld.length.tostring();
}
獲得存儲過程的信息::
rc3sqldmo.storedprecudure2 mysp = new rc3sqldmo.storedprecudure2class();
mysp =MySQLsvr.batabase.itrm("dbname",owner).storedprecudures.item[B("spname",owner)]
用途的討論::
動態管理SQL Server
動態獲得table,storedprecudure的結構信息
還能增加,修改所有SQL Server object的內容。