SQL Server obtains data types such as column name, column type, column type length, Scale,prec, and so on (Syscolumns,systypes,sysobjects are all views)
Select A.name as ColName, b.name as typename,a.length as length,a.scale as scale,a.prec as Prec from syscolumns a,systypes b, sysobjects C where A.xusertype=b.xusertype and a.id=c.id and c.name = ' TableName ' ORDER by c.id
Oracle obtains data types such as column name, column type, column type length, SCALE,PREC, etc.
Select Column_name,data_type, Data_length,data_precision,data_scale from User_tab_columns where Table_name= ' TableName '
SQL Server obtains all table names
Select Name from SysObjects Where xtype= ' U '
Oracle gets all table names
Select Tname from tab where tabtype= ' TABLE '
Gets the column, column type, column type length of the primary key in the table
Select A.name as ColName, b.name as typename,a.length as length,a.scale as scale,a.prec as Prec from syscolumns a,systy pes b, sysobjects C, information_schema. Constraint_column_usage d where A.xusertype=b.xusertype and a.id=c.id and c.name = ' TableName ' and b.name<> ' DATE ' an D a.name =d.column_name and d.constraint_name like ' pk_% '