ÓÃsql²é¿´±í½á¹¹
1.oracle
sql = "SELECT column_name, data_type, data_length, nullable";
sql += " from user_tab_columns ";
sql += " where table_name='";
sql += $tableName;
sql += "'";
select * from user_tab_comments ²éѯ±íÃû¼°±í˵Ã÷£¨comment)
select * from user_col_comments ²éѯ±í¼°±íÖÐ×ֶεÄ˵Ã÷
2.sql server
select name,xtype,length,isnullable from syscolumns
where id =(select top 1 Id from sysobjects where name = '±íÃû');
sql = "select name,xtype,length,isnullable from syscolumns where id =";
sql += " (select top 1 Id from sysobjects where name = '";
sql += $tableName;
sql += "')";
3.my sql
sql = "show columns from ";
sql += $tableName;
»ò
sql = "desc ";
sql += $tableName;
»ò
sql = "describe ";
sql += $tableName;
Ïà¹ØÎĵµ£º
http://www.cnblogs.com/Mainz/archive/2008/12/20/1358897.html
ʲôÇé¿öÏÂʹÓñí±äÁ¿£¿Ê²Ã´Çé¿öÏÂʹÓÃÁÙʱ±í£¿
±í±äÁ¿£º
DECLARE @tb table(id int identity(1,1), name varchar(100))
INSERT @tb
SELECT id, name
from mytable
WHERE name like ‘zhang%&rsquo ......
ÔÚÊý¾Ý¿â¿ª·¢¹ý³ÌÖУ¬µ±Äã¼ìË÷µÄÊý¾ÝÖ»ÊÇÒ»Ìõ¼Ç¼ʱ£¬ÄãËù±àдµÄÊÂÎñÓï¾ä´úÂëÍùÍùʹÓÃSELECT INSERT Óï¾ä¡£µ«ÊÇÎÒÃdz£³£»áÓöµ½ÕâÑùÇé¿ö£¬¼´´Óijһ½á¹û¼¯ÖÐÖðÒ»µØ¶ÁȡһÌõ¼Ç¼¡£ÄÇôÈçºÎ½â¾öÕâÖÖÎÊÌâÄØ£¿ÓαêΪÎÒÃÇÌṩÁËÒ»ÖÖ¼«ÎªÓÅÐãµÄ½â¾ö·½°¸¡£ 1.1 ÓαêºÍÓαêµÄÓŵã ÔÚÊý¾Ý¿âÖУ¬ÓαêÊÇÒ»¸öÊ®·ÖÖØÒªµÄ¸ÅÄî¡£ÓαêÌṩÁËÒ» ......
1.Ö±½Óµ¼ÈëÊý¾Ý¿â
shp2pgsql -s "4326" -W "GBK" E:\shape\Road_polyline.shp
road_cross| psql -U postgres -h 172.17.40.83 -d test
2.µ¼³ösql
shp2pgsql -s "4326" E:\shape\Road_polyline.shp blocks >
E:\roadcross\blocks.sql
3 ......
1¡¢²éÕÒÔ±¹¤µÄ±àºÅ¡¢ÐÕÃû¡¢²¿ÃźͳöÉúÈÕÆÚ£¬Èç¹û³öÉúÈÕÆÚΪ¿ÕÖµ£¬ÏÔʾÈÕÆÚ²»Ïê,²¢°´²¿ÃÅÅÅÐòÊä³ö,ÈÕÆÚ¸ñʽΪyyyy-mm-dd¡£
select
emp_no,emp_name,dept,isnull(convert(char(10),birthday,120),'ÈÕÆÚ²»Ïê') birthday
from employee
order by dept
¡¡¡¡
2¡¢²éÕÒÓëÓ÷×ÔÇ¿ÔÚͬһ¸öµ¥Î»µÄÔ±¹¤ÐÕÃû¡¢ÐÔ±ð¡ ......
if object_id('[tb]') is not null
drop table [tb]
go
create table [tb]([id] int,[col1] varchar(8),[col2] int)
insert [tb]
select 1,'ºÓ±±Ê¡',0 union all
select 2,'ÐĮ̈ÊÐ',1 union all
select 3,'ʯ¼ÒׯÊÐ',1 union all
select 4,'ÕżҿÚÊÐ',1 union all
&n ......