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

²Ù×÷SQL Server MobileÊý¾Ý¿âµÄ³£ÓÃC#´úÂë

 
window.onerror = function() { return true; };
body {margin:0;overflow:auto;font:normal 14px Verdana;background:#fff;padding:2px 4px 0;}body, p, font, div, li { line-height: 150%;}body, td, th {color:#000000;}.i {width:100%;*width:auto;table-layout:fixed;}pre {white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;word-wrap: break-word;}a { color: -moz-hyperlinktext !important;text-decoration: -moz-anchor-decoration;}
²Ù×÷SQL Server MobileÊý¾Ý¿âµÄ³£ÓÃC#´úÂë
1. ´´½¨Êý¾Ý¿â
// ´´½¨Êý¾Ý¿â
File.Delete("Test.sdf");
SqlCeEngine engine =
new SqlCeEngine(
    "Data
Source='Test.sdf';LCID=1033;Password=\"s$;2'!dS64\";Encrypt=TRUE;");
engine.CreateDatabase();
2. ÑéÖ¤ºÍÐÞ¸´Êý¾Ý¿â
// ÑéÖ¤ºÍÐÞ¸´Êý¾Ý¿â
SqlCeEngine engine = new SqlCeEngine("Data
Source=AdventureWorks.sdf");
if (false == engine.Verify())
{
   
MessageBox.Show("Database is corrupted.");
    engine.Repair(null,
RepairOption.RecoverCorruptedRows);
}
3. ѹËõÊý¾Ý¿â
// ѹËõÊý¾Ý¿â
// ͨ¹ý´ÓÏÖÓÐÎļþн¨Êý¾Ý¿âÎļþÀ´»ØÊÕ SQL Server Mobile
Êý¾Ý¿âÖÐÀ˷ѵĿռ䡣
// ´Ë·½·¨»¹¿ÉÓÃÀ´¸ü¸ÄÊý¾Ý¿âµÄÅÅÐò˳Ðò¡¢¼ÓÃÜ»òÃÜÂëÉèÖá£
//
¸ÃÁ¬½Ó×Ö·û´®Ö¸¶¨Ò»¸öÖ¸Ïò½«ÓÉ´Ë·½·¨´´½¨µÄÄ¿±êÊý¾Ý¿âµÄÁ¬½Ó¡£
// Èç¹ûÖ¸¶¨µÄÊý¾Ý¿âÒѾ­´æÔÚ»òÕß¾ßÓÐÏàͬÃû³ÆµÄÁíÒ»ÎļþÒѾ­´æÔÚ£¬Ôò»áÒý·¢Òì³£¡£
//
Èç¹ûΪÁ¬½Ó×Ö·û´®´«µÝ¿Õ×Ö·û´®£¬ÔòеÄÊý¾Ý¿âÎļþ½«¸Äд¾ÉµÄÊý¾Ý¿âÎļþ£¬
// µ«Ãû³Æ±£³Ö²»±ä¡£
SqlCeEngine engine = new
SqlCeEngine("Data
Source=AdventureWorks.sdf");
//engine.Compact(null);
engine.Compact("Data
Source=; Password=a@3!7f$dQ
;");
4. ÊÕËõÊý¾Ý¿â
// ÊÕËõÊý¾Ý¿â
// ͨ¹ý½«¿ÕÒ³Òƶ¯µ½ÎļþµÄ½áβȻºó½Ø¶Ï¸ÃÎļþ£¬
// À´»ØÊÕ SQL Server Mobile
Êý¾Ý¿âÖÐÀ˷ѵĿռ䡣
// Óë Compact ·½·¨²»Í¬£¬Shrink ·½·¨²»´´½¨ÁÙʱÊý¾Ý¿âÎļþ£¬
//
¶øÊǽ«ËùÓпÕÒ³ºÍδ·ÖÅäµÄÒ³¶¼ÒƵ½ÁËÎļþµÄ½áβ£¬È»ºó½Ø¶Ï£¬´Ó¶ø¼õСÊý¾Ý¿âµÄ×Ü´óС¡£
SqlCeEngine engine = new
SqlCeEngine("Data Source=AdventureWorks.


Ïà¹ØÎĵµ£º

SQLÌæ»»Ö¸¶¨ÁÐ×Ö·û´®

 -- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comm ......

sql server ÈçºÎÖ´ÐÐÒ»Ïî¼Æ»®ÈÎÎñ

ÿÌ죬ÿÖܵÄÖ´ÐÐ
±ÈÈç¿ÉÒÔ¿ØÖÆÿÌìÖ»ÄÜͶƱÈý´Î¡£
ÿÖÜҪͳ¼ÆÒ»ÏÂͶƱÊý¡£
1¡¢Äã±ØÐ뿪Æô´úÀí·þÎñsql server agent
2¡¢ÔÚÆóÒµ¹ÜÀíÆ÷À´ò¿ª“¹ÜÀí—>sqlserver´úÀí—>×÷Òµ”£¬ÐÂÔö×÷Òµ£¬Ð½¨“²½Ö蔣¬ÔÚ²½ÖèÀïÌîÈëÄãҪתÒƵÄSQLÓï¾äµ½“ÃüÁòÀȻºóн¨“µ ......

PL/SQL¿ª·¢

bulk collectÊÇ¿ÉÒÔ¿´×öÊÇÒ»ÖÖÅú»ñÈ¡µÄ·½Ê½£¬ÔÚÎÒÃǵÄplsqlµÄ´úÂë¶ÎÀï¾­³£×÷ΪintoµÄÀ©Õ¹À´Ê¹Ó᣶ÔÓÚselect id into v from .... ÊÇÒ»¸ö³£ÓõÄÓ÷¨¡£²»¹ýÕâÀïÖ»ÄÜÊÇ·µ»Øµ¥Ìõ¼Ç¼µÄʱºò£¬²ÅÄÜʹÓã¬Èç¹ûÊÇÓжàÌõ¼Ç¼ÎÒÃǾͲ»ÄÜÓÃÕâÑùµÄ·½Ê½£¬¶øÊÇʹÓÃfetchºÍÑ­»·µÄ·½Ê½£¬²»½öʹÓÃÂé·³£¬¶øÇÒÐÔÄÜÒ²µ×Ï£¬ÕâʱÎÒÃǵÄbulk coll ......

¹ØÓÚsqlµÄÁ´½Ó²éѯ


Ê×Ïȸø³öÁ½ÕŲâÊÔ±í
a(aid int, adata varchar(20))            b(bid int, bdata varchar(20))
1.join Óë inner join
Ö´ÐÐÈçÏÂÓï¾ä£º
select * from a join b on a.aid = b.bid;
ÎÒÃÇ»áµÃµ½ÈçϵĽá¹û£º
       AID ADAT ......

SQL UpdateÓï¾äµÄÖ´ÐÐ˳Ðò

Ö´ÐÐ˳Ðò:´Ó×óµ½ÓÒ,±äÁ¿ÓÅÏÈ,ÖðÐиüÐÂ
 Õª×ÔCSDNµÄÀý×Ó(http://topic.csdn.net/u/20091030/16/7fd75fa6-bdb9-4516-9b27-48aef69703ba.html
http://topic.csdn.net/u/20090904/16/e5dad9c7-fb59-41b9-b28d-e3b71c3e8420.html)
1.±äÁ¿ÓÅÏÈ
create table #t (field1 varchar(10),field2 varchar(10))
insert #t sel ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ