Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sqlÓï¾äµ¼Èëµ¼³ö´óÈ«

SELECT * into newtable
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
  'Data Source="c:\aaaa.xls";User ID=Admin;Password=;Extended properties=Excel 11.0')...[Sheet1$]
/******* µ¼³öµ½excel
¡¡¡¡exec master..xp_cmdshell 'bcp settledb.dbo.shanghu out c:\temp1.xls -c -q -s"gnetdata/gnetdata" -u"sa" -p""'
¡¡¡¡/*********** µ¼Èëexcel
¡¡¡¡select * 
¡¡¡¡from opendatasource( 'microsoft.jet.oledb.4.0',
¡¡¡¡'data source="c:\test.xls";user id=admin;password=;extended properties=excel 5.0')...xactions
¡¡¡¡/*¶¯Ì¬ÎļþÃû
¡¡¡¡declare @fn varchar(20),@s varchar(1000)
¡¡¡¡set @fn = 'c:\test.xls'
¡¡¡¡set @s ='''microsoft.jet.oledb.4.0'',
¡¡¡¡''data source="'+@fn+'";user id=admin;password=;extended properties=excel 5.0'''
¡¡¡¡set @s = 'select * from opendatasource ('+@s+')...sheet1$'
¡¡¡¡exec(@s)
¡¡¡¡*/
¡¡¡¡select cast(cast(¿ÆÄ¿±àºÅ as numeric(10,2)) as nvarchar(255))+'¡¡' ת»»ºóµÄ±ðÃû
¡¡¡¡from opendatasource( 'microsoft.jet.oledb.4.0',
¡¡¡¡'data source="c:\test.xls";user id=admin;password=;extended properties=excel 5.0')...xactions
¡¡¡¡/********************** excelµ¼µ½Ô¶³Ìsql
¡¡¡¡insert opendatasource(
¡¡¡¡'sqloledb',
¡¡¡¡'data source=Ô¶³Ìip;user id=sa;password=ÃÜÂë'
¡¡¡¡).¿âÃû.dbo.±íÃû (ÁÐÃû1,ÁÐÃû2)
¡¡¡¡select ÁÐÃû1,ÁÐÃû2
¡¡¡¡from opendatasource( 'microsoft.jet.oledb.4.0',
¡¡¡¡'data source="c:\test.xls";user id=admin;password=;extended properties=excel 5.0')...xactions
¡¡¡¡/** µ¼ÈëÎı¾Îļþ
¡¡¡¡exec master..xp_cmdshell 'bcp dbname..tablename in c:\dt.txt -c -sservername -usa -ppassword'
¡¡¡¡/** µ¼³öÎı¾Îļþ
¡¡¡¡exec master..xp_cmdshell 'bcp dbname..tablename out c:\dt.txt -c -sservername -usa -ppassword'
¡¡¡¡»ò
¡¡¡¡exec master..xp_cmdshell 'bcp "select * from dbname..tablename" queryout c:\dt.txt -c -sservername -usa -ppassword'
¡¡¡¡µ¼³öµ½txtÎı¾£¬ÓöººÅ·Ö¿ª
¡¡¡¡exec master..xp_cmdshell 'bcp "¿âÃû..±íÃû" out "d:\tt.txt" -c -t ,-u sa -p password'
¡¡¡¡bulk insert ¿âÃû..±íÃû
¡¡¡¡from 'c:\test.txt'
¡¡¡¡with (
¡¡¡¡fieldterminator = ';',
¡¡¡¡


Ïà¹ØÎĵµ£º

sql 2005 ´æ´¢¹ý³Ì·ÖÒ³ java ´úÂë

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ ......

SQL¼òÊö

¡¡¡¡20ÊÀ¼Í£¸£°Äê´ú³õ£¬ANSI£¨American¡¡National¡¡Standard¡¡Institute£©¡¡Êý¾Ý¿â±ê׼ίԱ»á¿ªÊ¼Öƶ©Ïà¹Ø¹ØÏµÓïÑԵıê×¼£¬µ«Ö±µ½£±£¹£¸£¶Ä꣬Êý¾Ý¿â±ê׼ίԱ»á²ÅÍÆ³öµÚÒ»¸öSQLÓïÑÔ±ê×¼SQL-86¡£Ëæ×ÅÊý¾Ý¿â¼¼ÊõµÄ·¢Õ¹£¬SQL±ê×¼Ò²ÔÚ²»¶Ï½øÐÐÀ©Õ¹ºÍÐÞÕý£¬²¢ÇÒÊý¾Ý¿â±ê׼ίԱ»áÏȺóÓÖÍÆ³öSQL-89£¬SQL-92ÒÔ¼°SQL-99±ê×¼¡££±£¹£·£ ......

ÈçºÎÑ¡ÔñÕýÈ·µÄSQL Server Compact°²×°°ü


ÕªÒª£ºSQL Server CompactµÄ°²×°°üÓÉÈý²¿·Ö¹¦ÄÜ×é³É£¬²¢ÇÒÇø·ÖCPUƽ̨ºÍ²Ù×÷ϵͳƽ̨£¬³õѧÕßÍùÍù²»ÖªµÀÈçºÎÈ¥Çø·ÖËüÃÇ¡£±¾ÎĽ«¶ÔSQL Server CompactµÄ°²×°°ü½øÐнéÉÜ£¬ÈÃÄãÖªµÀÈçºÎÇø·ÖºÍÑ¡ÔñËüÃÇ¡£
Èç¹ûÄãÊÇʹÓÃVisual Studio 2005/2008¿ª·¢.NET Compact FrameworkÓ¦ÓóÌÐò£¬²¢ÔÚ³ÌÐòÖÐÓõ½ÁËSQL Server CompactÊý¾Ý¿â ......

OracleÊý¾Ý¿âSQL*plus³£ÓõÄÃüÁîºÍº¯Êý

 
OracleÖг£ÓõÄÃüÁîºÍº¯Êý£¬×ö¸öÕûÀí£¬ÒÔ±¸ÒÔºóÓõ½£¬·½±ã²éÔÄ¡£
 
³£ÓÃÃüÁ
 
Á¬½Ósqlplus
 
ÃüÁîÐÐÏÂÔËÐÐcmd½øÈ룬ÈçÒÔsysģʽµÇ½£¬ÃüÁîÈçÏ£º
 
(1).sqlplus "sys/zhb126 as sysdba"
 
(2).sqlplus/nolog connect sys/zhb126 as sysdba
 
(3).sqlplus scott ......

Êý¾Ý¿â·þÎñÆ÷¸ÄÃûºó±£Ö¤SQL ×÷Òµ¼°¸´ÖÆ¿ÉÓÃ

Óöµ½ÏÈ×°SQL Server£¬ºó¸Ä¼ÆËã»úÃû£¬×ö×÷ÒµµÄ×Ô¶¯Ö´ÐС¢·þÎñÆ÷¸´ÖÆÊ±Óöµ½´íÎóÒ»Ñù¡£°´ÒÔϲ½Öè²Ù×÷¿ÉÒÔÐÞ¸´£º
·½·¨Ò»¡¢
1¡¢ÏȲ鿴¼ÆËã»úÃû£º
SELECT @@SERVERNAME As [@@SERVERNAME],
CAST(SERVERPROPERTY('MACHINENAME') AS VARCHAR(128)) + COALESCE('\' + CAST(SERVERPROPERTY('INSTANCENAME') AS VARCHAR(128)), ' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ