SQL²Ù×÷È«¼¯
using System;
using System.Threading;
namespace ConsoleApplication1
{
/// <summary>
/// Class1 µÄժҪ˵Ã÷¡£
/// </summary>
class Class1
{
/// <summary>
/// Ó¦ÓóÌÐòµÄÖ÷Èë¿Úµã¡£
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó´úÂëÒÔÆô¶¯Ó¦ÓóÌÐò
//
Thread thread1 = new Thread(new ThreadStart(Method1));
Thread thread2 = new Thread(new ThreadStart(Method2));
thread1.Start();
thread2.Start();
}
public static void Method1()
{
while(true)
{
Console.WriteLine("this is thread : 1");
Thread.Sleep(1000);
}
}
public static void Method2()
{
while (true)
{
Console.WriteLine("this is thread : 2");
Thread.Sleep(2000);
}
}
}
}/
////////////////////////////////////////////////////////////////////////////////////////////////////////////
SQL²Ù×÷È«¼¯
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢ËµÃ÷£º´´½¨Ð±í
create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)
¸ù¾ÝÒÑÓÐµÄ±í´´½¨ÐÂ±í£º
A£ºcreate table tab_new like tab_old (ʹÓÃ¾É±í´´½¨Ð±í)
B£ºcreate table
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
sqlÓïÑÔÖÐÓÐûÓÐÀàËÆCÓïÑÔÖеÄswitch caseµÄÓï¾ä£¿£¿
ûÓÐ,ÓÃcase when À´´úÌæ¾ÍÐÐÁË.
ÀýÈç,ÏÂÃæµÄÓï¾äÏÔʾÖÐÎÄÄêÔÂ
select getdate() as ÈÕÆÚ,case month(get ......
Á¬½Ósql serverÊý¾Ý¿âÓõ½µÄÃüÃû¿Õ¼äÊÇusing System.Data.SqlClient;
Êý¾Ý¿âÁ¬½Ó´úÂë:¿ÉÒÔÔÚ´óÀàÖ®ÏÂÉùÃ÷ public SqlConnection myConnection; //sqlÁ¬½Ó¶ÔÏó
&nbs ......
insert into mysql.user
SELECT '%', 'admin', PASSWORD('admin'), Select_priv, Insert_priv, Update_priv,
Delete_priv, Create_priv, Drop_priv, Reload_priv,
Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv,
Index_priv, Alter_priv, Show_db_priv, Super_priv, ......
×î½üÔÚºÍÒ»¸ö¹«Ë¾ºÏ×÷ÏîÄ¿£¬Óв¿·ÖÁ´½ÓÊÇÓÉËûÃǹ«Ë¾ÌṩµÄ£¬ÓÉÓÚµ±Ê±»¹Ã»ÓÐÉêÇëÓòÃû£¬Ö±½ÓÌṩ¸øÎÒÃǵÄÊÇipµØÖ·£¬ÏÖÔÚÕýʽÉÏÏߺó£¬ÐèÒªÎÒÃǽ«ÔÀ´µÄipµØÖ·Ì滻ΪÓòÃû£¬Èç¹ûÒ»¸ö¸öÌæ»»ÆðÀ´ÌرðÂé·³£¬¶øÇÒ¿ÉÄܳöÏÖÎÊÌ⣬Òò´ËÕÒÁËÏÂoracleÖÐsqlÅúÁ¿Ìæ»»µÄ¹¦ÄÜ£¬Ê¹ÓÃÆðÀ´Ì«·½±ãÁË£¬ÔÚÕâÀï¼Ç¼Ï£¬±ãÓÚÒÔºó²éÕÒ¡£¾ßÌåʹÓÃ˵Ã÷ÈçÏ ......