SQLÓï¾ä´´½¨£¨Êý¾Ý¿â|Êý¾Ý±í|Ë÷Òý£©
CREATE Table <±íÃû>
£¨[<ÁÐÃû1>] ÀàÐÍ (³¤¶È) [ȱʡֵ][Áм¶Ô¼Êø]
[£¬<ÁÐÃû2> Êý¾ÝÀàÐÍ[ȱʡֵ][Áм¶Ô¼Êø]]….
[£¬UNIQUE£¨ÁÐÃû[£¬ÁÐÃû]….£©]
[£¬PRIMARY KEY£¨ÁÐÃû[£¬ÁÐÃû]…£©]
[£¬FOREIGN KEY £¨ÁÐÃû[£¬ÁÐÃû]…£©
REFERENCES ±íÃû£¨ÁÐÃû[£¬ÁÐÃû]…£©]
[£¬CKECK (Ìõ¼þ)] )
¹¦ÄÜ£º
½¨Á¢Ò»¸öÒÔ<±íÃû>ΪÃûµÄ±í¡£
/*´´½¨½èÊ黹ÊéÊý¾Ý¿â*/
create database ½èÊ黹ÊéÐÅÏ¢
on
( name = N'½èÊ黹ÊéÐÅÏ¢Data',
filename = N'D:\½èÊ黹ÊéÐÅÏ¢.mdf',
size = 20Mb,
maxsize = 40Mb,
filegrowth = 10Mb
)
log on
( name = N'½èÊ黹ÊéÐÅÏ¢_Log',
filename = N'D:\½èÊ黹ÊéÐÅÏ¢_Log.ldf',
size = 20Mb,
maxsize = 35Mb,
filegrowth = 10Mb
)
collate SQL_Latin1_General_CP1_CI_AS
go
/*´´½¨Êý¾Ý±í*/
use ½èÊ黹ÊéÐÅÏ¢
go
create table dbo.ͼÊé
(
ͼÊé±àºÅ int identity(1,1) not null ,
ͼÊéÃû³Æ varchar(50),
×÷Õß varchar(20),
³ö°æÉç varchar(50),
±¸×¢ varchar(100),
primary key (ͼÊé±àºÅ)
);
create table dbo.Óû§
(
Óû§±àºÅ int identity(1,1) not null,
¿ÚÁî varchar(20),
ÐÕÃû varchar(20),
ÐÔ±ð bit,
³öÉúÄêÔÂ datetime,
ÕË»§Óà¶î money,
primary key (Óû§±àºÅ)
);
CREATE TABLE [dbo].[½èÊé¼Ç¼]
(
[¼Ç¼±àºÅ] [int] IDENTITY(1,1) NOT NULL,
[Óû§±àºÅ] [int] NOT NULL,
[ͼÊé±àºÅ] [int] NOT NULL,
[½èÊéʱ¼ä] [datetime] NULL,
[»¹Êéʱ¼ä] [datetime] NULL,
[ÊÇ·ñÇ··Ñ] [bit] NULL,
[Ç··Ñ½ð¶î] [bit] NULL,
[ÊÇ·ñ»¹Êé] [bit] NULL,
PRIMARY KEY (¼Ç¼±àºÅ),
foreign key (Óû§±àºÅ) references Óû§(Óû§±àºÅ),
foreign key (ͼÊé±àºÅ) references ͼÊé(ͼÊé±àºÅ)
);
/*´´½¨Ë÷Òý*/
/****** ¶ÔÏó: Index [Book_ID_Name_Index] ½Å±¾ÈÕÆÚ: 09/26/2009 17:18:09 ******/
CREATE NONCLUSTERED INDEX [Book_ID_Name_Index] ON [dbo].[ͼÊé]
(
[ͼÊé±àºÅ] ASC,
[ͼÊéÃû³Æ] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = O
Ïà¹ØÎĵµ£º
SQL code
SQL ServerÊý¾Ýµ¼Èëµ¼³ö¹¤¾ßBCPÏê½â
BCPÊÇSQL ServerÖиºÔðµ¼Èëµ¼³öÊý¾ÝµÄÒ»¸öÃüÁîÐй¤¾ß£¬ËüÊÇ»ùÓÚDB
-
LibraryµÄ£¬²¢ÇÒÄÜÒÔ²¢Ðеķ½Ê½¸ßЧµØµ¼Èëµ¼³ö´óÅúÁ¿µÄÊý¾Ý¡£BCP¿ÉÒÔ½«Êý¾Ý¿âµÄ±í»òÊÓͼֱ½Óµ¼³ö£¬Ò²ÄÜͨ¹ýSELECT fromÓï¾ä¶Ô±í»òÊÓͼ½øÐйýÂ˺󵼳ö¡£ÔÚµ¼Èëµ¼³öÊý¾Ýʱ£¬¿ÉÒÔʹÓÃĬÈÏÖµ»òÊÇʹÓÃÒ»¸ö¸ ......
Óŵã:×ֶνÏÉÙ£¬ÓÐÔöɾ¸Ä²é¹¦ÄÜ£¬²»¹ý²éѯ̫Áýͳ¡£
ȱµã:
1.²»ËãÊÇÔÚºÜÕýµÄÎÞÏÞ·ÖÀà,ClassPathÕâ¸ö×ֶζ¨ÒåÏÞÖÆ¡£
2.Ö÷¼üCLASSID²»ÊÇ×ÔÔöµÄ£¬Ê¹ÓÃCODESMITHÅúÁ¿Éú³É¶à²ã¼Ü¹¹´úÂëÖлᵼÖ³ö´í¡£
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ArticleClass]') and OBJECTPROPERTY(id, N'IsUse ......
ÔÚʹÓÃNHibernate¹ý³ÌÖо³£»áʹÓõ½¸´ÔÓµÄsql²éѯ£¬µ«ÊÇʹÓÃhqlÓֱȽÏÂé·³µÄÇé¿öÏ£¬ÎÒÃÇÍùÍù¶¼»áÏëµ½²ÉÓÃÔʼµÄsqlÀ´Ö´ÐС£µ«ÊÇÈçºÎÀûÓÃNHibernateÀ´Ö´ÐÐsqlÄØ£¿ÎÊÌâÀ´ÁË£¬ÔÚNHibernateÖÐÒ²ÓÐAdoTemplateµÄ·½·¨¿ÉÒÔÖ´ÐÐsqlµÄ£¬µ«ÊÇÕâÀïÒª½éÉܵÄÊÇÁíÍâÒ»ÖÖ·½·¨£ºCreateSQLQuery¡£ÒÔϲ¿·ÖÀý×ÓÔ´×ÔÓÚÍøÂç¡£
ʵÀýÒ»£¨Ô´×ÔÓÚ ......
Ò»¡¢¼òµ¥²éѯ
¡¡¡¡ ¼òµ¥µÄTransact-SQL²éѯֻ°üÀ¨Ñ¡ÔñÁÐ±í¡¢from×Ó¾äºÍWHERE×Ӿ䡣
ËüÃÇ·Ö±ð˵Ã÷Ëù²éѯÁС¢²éѯµÄ
±í»òÊÓͼ¡¢ÒÔ¼°ËÑË÷Ìõ¼þµÈ¡£
ÀýÈ磬ÏÂÃæµÄÓï¾ä²éѯtesttable±íÖÐÐÕÃûΪ“ÕÅÈý”µÄnickname×ֶκÍemail×ֶΡ£
SELECT nickname,email
from testtable WHERE name='ÕÅÈý'
(Ò»)Ñ¡ÔñÁбí
¡ ......
QZone Editor
.dump{}
//TODO ÓòÃû
if (location.hash) {
document.domain=location.hash.substr(1);
}
//parent.qZEditor.callback();
function init(){
//»ñÈ¡±à¼Æ÷Ãæ°åID
var pid = frameElement.panelID;
//»ñÈ¡±à¼Æ÷Ãæ°å¶ÔÏó
......