¡¾×ª¡¿mysqlÏÂÈçºÎÖ´ÐÐsql½Å±¾
Ê×Òª²½Öè(Ò»°ã¿ÉÊ¡ÂÔ):
¿ªÆômysql·þÎñ(ĬÈÏÊÇ¿ª»úʱ¾Í×Ô¶¯ÔËÐÐÁË):
¿ØÖÆÃæ°å
-->¹ÜÀí¹¤¾ß-->·þÎñ,ÔÚÀïÃæÕÒµ½Ãû³ÆÎªmysqlµÄÏî,Ë«»÷¾Í¿É¿´ËüµÄ·þÎñ״̬ÊÇÆô¶¯»¹ÊÇÍ£Ö¹,°ÑËüÉèΪÆô¶¯
Á¬½Ómysql:
ÔÚÃüÁîÐÐÏÂÊäÈë mysql -h
localhost -u root -p»Ø³µ,È»ºóÊäÈëÃÜÂë¼´¿É;»òÖ±½ÓÔËÐÐmysql×Ô´øµÄÁ¬½Ó¹¤¾ß,È»ºóÊäÈëÃÜÂë¼´¿É.
1.±àдsql½Å±¾,¼ÙÉèÄÚÈÝÈçÏÂ:
create database dearabao;
use dearabao;
create table niuzi (name varchar(20));
±£´æ½Å±¾Îļþ,¼ÙÉèÎÒ°ÑËü±£´æÔÚFÅ̵Ähello
worldĿ¼ÏÂ,ÓÚÊǸÃÎļþµÄ·¾¶Îª:F:\hello world\niuzi.sql
2.Ö´ÐÐsql½Å±¾,¿ÉÒÔÓÐ2ÖÖ·½·¨:
µÚÒ»ÖÖ·½·¨:
ÔÚÃüÁîÐÐÏÂ(δÁ¬½ÓÊý¾Ý¿â),ÊäÈë mysql -h localhost -u root -p123456 <
F:\hello world\niuzi.sql (×¢Òâ·¾¶²»ÓüÓÒýºÅµÄ!!) »Ø³µ¼´¿É.
µÚ¶þÖÖ·½·¨:
ÔÚÃüÁîÐÐÏÂ(ÒÑÁ¬½ÓÊý
¾Ý¿â,´ËʱµÄÌáʾ·ûΪ mysql> ),ÊäÈë source F:\hello world\niuzi.sql (×¢Òâ·¾¶²»ÓüÓÒýºÅµÄ)
»òÕß \. F:\hello world\niuzi.sql (×¢Òâ·¾¶²»ÓüÓÒýºÅµÄ) »Ø³µ¼´¿É
ÔÎĵØÖ·£ºhttp://www.cppblog.com/true/archive/2007/07/17/28174.html
Ïà¹ØÎĵµ£º
ÓÐһЩûÓÐʹÓÃÊý¾Ý¿âÖмä¼þµÄÈí¼þ¿ÉÄÜ»áÅöµ½ÔÚ²»Í¬µÄÓ¦Óó¡¾°ÐèÒªÓò»Í¬µÄÊý¾Ý¿â£¬ÕâÑù¿ÉÄܾÍÐèÒª½«Êý¾Ý¿â´úÂë×öÒÆÖ²£¬ÎÒÕâÀïÕûÀíÁËһЩ´Óoracleµ½mysqlµÄÒÆÖ²¹ý³ÌÖеÄ×¢ÒâÊÂÏ
1¡£sequenceÉú³É
¿ÉÒÔÓÃÀàËÆµÄ¶«Î÷À´×ö,ÈçÏ£º
create table myseq ( &nb ......
ͨÓñí±í´ïʽ Common Table Expressions
ͨÓñí±í´ïʽ£¨CTE£©ÊÇÒ»¸ö¿ÉÒÔÓɶ¨ÒåÓï¾äÒýÓõÄÁÙʱ±íÃüÃûµÄ½á¹û¼¯¡£ÔÚËûÃǵļòµ¥ÐÎʽÖУ¬Äú¿ÉÒÔ½«CTEÊÓΪÀàËÆÓÚÊÓͼºÍÅÉÉú±í»ìºÏ¹¦ÄܵĸĽø°æ±¾¡£ÔÚ²éѯµÄfrom×Ó¾äÖÐÒýÓÃCTEµÄ·½Ê½ÀàËÆÓÚÒýÓÃÅÉÉú±íºÍÊÓͼµÄ·½Ê½¡£Ö»Ð붨ÒåCTEÒ»´Î£¬¼´¿ÉÔÚ²éѯÖжà´ÎÒýÓÃËü¡£ÔÚCTEµÄ¶¨ÒåÖУ¬¿ÉÒÔÒ ......
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CR ......
CLR Óû§¶¨Ò庯ÊýÖ»ÊÇÔÚ .NET ³ÌÐò¼¯Öж¨ÒåµÄ¾²Ì¬·½·¨¡£CREATE FUNCTION Óï¾äÒÑÀ©Õ¹ÎªÖ§³Ö´´½¨ CLR
Óû§¶¨Ò庯Êý¡£
1¡¢´´½¨Êý¾Ý¿âÏîÄ¿
¡¡¡¡
2¡¢Ìí¼ÓÓû§¶¨Ò庯Êý
¡¡¡¡
ÒÔÏÂÊÇÑÝʾ´úÂ룺
Code
using
System;
using
System.Data;
using
System.Data.SqlClient;
using
System.Data.Sql ......
To generate a deployment script using generate scripts
Open
Management Studio and connect to the SQL Server instance where the
managed assembly or database object to be deployed is registered.
In the Object Explorer
, expand the <server name>
and Databases
trees. Right-click ......