ÈçºÎÁ´½Óµ½Sql Server 2005
SQL Server 2005
±¾Æª½éÉÜÈçºÎÁ´½Óµ½Sql Server 2005.
²ÉÓÃSQL ±¾µØ¿Í»§ ODBCÇý¶¯
²ÉÓÃSqlÉí·ÝÑéÖ¤
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
ÄãÕýÔÚʹÓÃSQL Server 2005 Express£¿±ðÍü¼ÇÁË£¬ServernameµÄÓï·¨ÊÇServername\SQLEXPRESS£¬Äã¿ÉÒÔÓÃÄã°²×°SQL Server 2005 ExpressµÄÄÇ̨»úÆ÷µÄ»úÆ÷ÃûÌæ´úµôServername
²ÉÓÃwindowsÉí·ÝÑéÖ¤
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;
ÔÚÉÏÃæµÄÓï·¨ÖУ¬"Integrated Security=SSPI" ºÍ "Trusted_Connection=yes"ÊǵÈЧµÄ¡£
¹ØÓÚÊäÈëÓû§ºÍÃÜÂëµÄÌáʾ£º
Ê×ÏÈ£¬Äã±ØÐëÉèÖÃÁ´½Ó¶ÔÏóµÄÌáʾÊôÐÔΪ"adPromptAlways"£¬È»ºóÔÙʹÓÃÁ´½Ó×Ö´®Á´½Óµ½Êý¾Ý¿â¡£
oConn.Properties("Prompt") = adPromptAlways
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;
ÔÊÐíMARS£¨¶à¸ö»î¶¯½á¹û¼¯£©
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;MARS_Connection=yes
ÔÚÉÏÃæµÄÓï·¨ÖУ¬ "MultipleActiveResultSets=true" ºÍ "MARS_Connection=yes" ÊǵÈЧµÄ ¡£
ҪʹÓÃMARS¹¦ÄÜ£¬±ØÐë°²×°ADO.net 2.0£¬Ado.net 1.0ºÍAdo.net 1.1²»Ö§³ÖMARS¡£
²ÉÓüÓÃÜ·½Ê½·¢Ë͵½ÍøÂç
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Encrypt=yes;
¸½¼ÓÊý¾Ý¿âÎļþÖÁÒ»¸ö±¾µØSql Server ExpressʵÀý
Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;
ΪʲôÐèÒªDatabase²ÎÊý£¿Èç¹ûÕâ¸öÊý¾Ý¿âÃûÒѱ»¸½¼Ó¹ý£¬Sql Server Express²»»áÔٴθ½¼ÓÕâ¸öÊý¾Ý¿â£¬Ëü½«Ê¹ÓÃÔ¸½¼ÓµÄÊý¾Ý¿âÀ´½¨Á¢Á´½Ó¡£
Êý¾Ý¿â¾µÏñ
Èç¹ûÄã²ÉÓÃAdo.net»òSql±¾µØÑéÖ¤·½Ê½Á´½Óµ½Ò»¸ö×÷Ϊ¾µÏñµÄÊý¾Ý¿â£¬µ±Ò»¸ö¾µÏñÊý¾Ý¿â³öÏÖ´íÎóµÄʱºò£¬ÄãµÄÓ¦ÓóÌÐòÄܹ»²ÉÓÃÓÐÀûµÄÇý¶¯×Ô¶¯×ªÏòÁ´½Ó¡£Äã±ØÐëÁ´½Ó×Ö´®ÖÐÖ¸¶¨×î³õµÄÊ×Òª·þÎñÆ÷ºÍÊý¾Ý¿âºÍ¹ÊÕϻָ´·þÎñÆ÷¡£
Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True;
ÕâÀï¿ÉÒÔÓÐÐí¶àÖÖÁ´½Ó×Ö´®µÄÊéд·½Ê½À´Á´½ÓÊý¾Ý¿â¾µÏñ¡£ÕâÖ»ÊÇÒ»¸öÖ¸³ö¹ÊÕϻָ´·þÎñÆ÷µÄÀý×Ó£¬Äã¿ÉÒÔºÍÆäËûÁ´½Ó·½Ê½×éºÏÔÚÒ»ÆðʹÓá£
²ÉÓÃOLE DB·½Ê
Ïà¹ØÎĵµ£º
ʹÓÃTranact-SQL ±àд´úÂëÀ´´´½¨Ò»¸öÐÂ±í£º
USE [OnlineJudge]
GO
/****** Object: Table [dbo].[User1] Script Date: 05/17/2010 14:05:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[User2](/*notice convert the tablename*/
[num] [int]IDENTITY(1,1) NOT N ......
sysforeignkeys
°üº¬¹ØÓÚ±í¶¨ÒåÖÐµÄ FOREIGN KEY Ô¼ÊøµÄÐÅÏ¢¡£¸Ã±í´æ´¢ÔÚÿ¸öÊý¾Ý¿âÖС£
ÁÐÃû Êý¾ÝÀàÐÍ ÃèÊö
constid int FOREIGN KEY Ô¼ÊøµÄ ID¡£
fkeyid int ¾ßÓÐ FOREIGN KEY Ô¼ÊøµÄ±í¶ÔÏó ID¡£
rkeyid int ÔÚ FOREIGN KEY Ô¼ÊøÖÐÒýÓõıí¶ÔÏó ID¡£
fkey smallint ......
----------Dbf µ¼Èë Sql Server±í----------
ÒÔϾùÒÔSQL2000¡¢VFP6¼°ÒÔÉϵıíΪÀý
´úÂëµ¼È룺²éѯ·ÖÎöÆ÷ÖÐÖ´ÐÐÈçÏÂÓï¾ä(ÏÈÑ¡Ôñ¶ÔÓ¦µÄÊý¾Ý¿â)
-------------Èç¹û½ÓÊܵ¼ÈëÊý¾ÝµÄSQL±íÒÑ´æÔÚ
--Èç¹û½ÓÊܵ¼ÈëÊý¾ÝµÄSQL±íÒѾ´æÔÚ
Insert Into ÒѾ´æÔÚµÄSQL±íÃû Select * from openrowset('MSDASQL','Driver=Microsoft ......
ºú»Ô£º13028803715 0755-82945017
9¡¢ÉîÛÚmicrosoft Windows 2003 Server±¨¼Û ÖÐÎıê×¼°æ5Óû§ 4100
10¡¢ÉîÛÚmicrosoft Windws 2003 Server±¨¼Û ÖÐÎÄÆóÒµ°æ25Óû§ 20500
11¡¢ÉîÛÚmicrosoft Windows 2008 Server±¨¼Û ÖÐÎıê×¼°æ5Óû§ 580 ......
¹«¸æ£º±¾²©¿ÍΪ΢ÈíÔƼÆËãÖÐÎIJ©¿ÍµÄ¾µÏñ²©¿Í£¬²¢²»±£Ö¤Á´½Ó¿ÉÓÃÐÔ£¬ÎªÁ˱£Ö¤ÔĶÁÌåÑ飬Çë·ÃÎÊhttp://blogs.msdn.com/azchina¡£
SQL Azure vs. SQL Server
¸ÅÒª
SQL Azure Database ÊÇÒ»¸öÀ´×Ô΢ÈíµÄ£¬»ùÓÚÔƵĹØϵÐÍÊý¾Ý¿â·þÎñ¡£SQL Azure Ìṩ¹ØϵÐÍÊý¾Ý¿â¹¦ÄÜÀ´×÷Ϊ¹«Ó÷þÎñ¡£»ùÓÚÔƵÄÊý¾Ý¿â½â¾ö·½°¸ ......