SQL2005ºÍ(Excel |access)Ö®¼äµÄÊý¾Ýµ¼Èëµ¼³ö
Sql´úÂë
--²ÉÓÃSQLÓï¾äʵÏÖsql2005ºÍExcel Êý¾ÝÖ®¼äµÄÊý¾Ýµ¼Èëµ¼³ö£¬ÔÚÍøÉÏÕÒÀ´Ò»--Ï£¬ÊµÏÖ·½·¨ÊÇÕâÑùµÄ£º
--Excel---->SQL2005 µ¼È룺
select * into useinfo from OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0;HDR=YES;DATABASE=d:\db.xls',sheet1$);
--ÆäÖУ¬useinfo ÊÇÊý¾Ý¿âÖеÄÒ»¸ö±í£¬d:\db.xls ΪÊý¾ÝÔ´£¬ÖµµÃÌá³öµÄÊÇ£º--sheet1$£¬¼ÇµÃ¼ÓÉÏ$¡£
---SQL2005--->Excel µ¼³ö£º
insert into OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0;HDR=YES;DATABASE=d:\test.xls',sheet1$) select * from useinfo;
--н¨Ò»¸ötest.xml Îļþ£¬ÆäÖÐtest.xmlµÄsheet1 µÄ±íÍ·±ØÐëÒªºÍuseinfoµÄÁÐ----ÃûÏàÒ»ÖÂ.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----¸½ÉÏaccessµÄ
insert into OpenRowSet('microsoft.jet.oledb.4.0',';database=d:\test.mdb','select * from useinfo')
select * from useinfo;
----------------------------------------------------------------------------
select * into hi from
OpenRowSet('microsoft.jet.oledb.4.0',';database=d:\test.mdb','select * from useinfo')
``````````````````````````````````````````
Ïà¹ØÎĵµ£º
£Ó£Ñ£Ì Óï·¨²Î¿¼ÊÖ²á(SQL)/Êý¾ÝÀàÐÍ
DB2 ÌṩÁ˹ØÁ¬Ê½×ÊÁÏ¿âµÄ²éѯÓïÑÔ £Ó£Ñ£Ì (Structured Query Language)£¬ÊÇÒ»Öַdz£¿ÚÓﻯ¡¢¼ÈÒ×ѧÓÖÒ׶®µÄÓï·¨¡£´ËÒ»ÓïÑÔ¼¸ºõÊÇÿ¸ö×ÊÁÏ¿âϵͳ¶¼±ØÐëÌṩµÄ£¬ÓÃÒÔ±íʾ¹ØÁ¬Ê½µÄ*×÷£¬°üº¬ÁË×ÊÁϵĶ¨Ò壨£Ä£Ä£Ì£©ÒÔ¼°×ÊÁϵĴ¦Àí£¨£Ä£Í£Ì£©¡£SQLÔÀ´Æ´³ÉS ......
selectÓï¾äÖÐÖ»ÄÜʹÓÃsqlº¯Êý¶Ô×ֶνøÐвÙ×÷£¨Á´½Ósql server£©£¬
select ×Ö¶Î1 from ±í1 where ×Ö¶Î1.IndexOf("ÔÆ")=1;
ÕâÌõÓï¾ä²»¶ÔµÄÔÒòÊÇindexof£¨£©º¯Êý²»ÊÇsqlº¯Êý£¬¸Ä³Ésql¶ÔÓ¦µÄº¯Êý¾Í¿ÉÒÔÁË¡£
left£¨£©ÊÇsqlº¯Êý¡£
select ×Ö¶Î1 from ±í1 where charindex£¨'ÔÆ',×Ö¶Î1£©=1;
×Ö·û´®º¯Êý¶Ô¶þ½øÖÆÊý¾Ý¡¢×Ö·û´®º ......
ÎÄÖеÄSQL¶¼ÊÇ´ÓÎÒµÄÏîÄ¿ÖÐÖ±½Ócopy¹ýÀ´£¬Òò´ËºÜ¶à±íÃûʲô¶¼ÓÐÁË
//´´½¨±í
"CREATE TABLE FEED_TABLE(FeedID TEXT, Title TEXT, Summary TEXT, Author TEXT, ImageName VARCHAR(21), ImageType TEXT, MaxIndex INT, ImageData BLOB)"
//²éѯ¼Ç¼
"select * form 'table_name'"
"select * form 'table name' where val ......
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssql
Óï¾ä£¬²»¿ÉÒÔÔÚaccess
ÖÐʹÓá£
SQL
·ÖÀࣺ
DDL—
Êý¾Ý¶¨ÒåÓïÑÔ(CREATE
£¬ALTER
£¬DROP
£¬DECLARE)
DML—
Êý¾Ý²Ù×ÝÓïÑÔ(SELECT
£¬DELETE
£¬UPDATE
£¬INSERT)
DCL—
Êý¾Ý¿ØÖÆÓïÑÔ(GRANT
£¬REVOKE
£¬COMMIT
£¬ROLLBACK)
Ê×ÏÈ,
¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1
¡¢ËµÃ÷£º ......