SQLÁ´½ÓÊý¾Ý¿â
Standard Security:
"Data Source=Aron1;Initial
Catalog=pubs;User Id=sa;Password=asdasd;"
- or -
"Server=Aron1;Database=pubs;User
ID=sa;Password=asdasd;Trusted_Connection=False"
(both
connection strings produces the same result)
Trusted Connection:
"Data
Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
- or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
(both connection strings produces the same result)
(use serverName\instanceName as Data Source to use
an specifik SQLServer instance)
Connect via an IP
address:
"Data Source=190.190.200.100,1433;Network
Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the
Data Source is the port to use (1433 is the default))
Enabling MARS (multiple active result sets):
"Server=Aron1;Database=pubs;Trusted_Connection=True;MultipleActiveResultSets=true"
Note! Use &nbs
Ïà¹ØÎĵµ£º
SQL server°²×°Ê±±¨¹ÒÆð´íÎó
SQL server°²×°Ê±Ê±£º¡°ÒÔǰµÄij¸ö³ÌÐò°²×°ÒÑÔÚ°²×°¼ÆËã»úÉÏ´´½¨¹ÒÆðµÄÎļþ²Ù×÷¡£ÔËÐа²×°³ÌÐò֮ǰ±ØÐëÖØÐÂÆô¶¯¼ÆËã»ú¡±´íÎó¡£ ´ò¿ª×¢²á±í±à¼Æ÷£¨¿ªÊ¼->ÔËÐÐ->regedit£©£¬ÔÚHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session ManagerÖÐÕÒµ½PendingFileRenameOperationsÏîÄ¿£¬²¢É¾ ......
ÎÒʹÓÃdelphiÒ²²»ÊǺܳ¤Ê±¼ä£¬ÓÉÓÚ¾³£ÒªÓõ½SQLÓï¾ä£¬×ܽáÁËһЩDelphiÖÐʹÓÃSQLÓï¾äҪעÒâµÄÊÂÏ¹éÄÉÆðÀ´Ö÷ÒªÓÐһϼ¸Ìõ£º
Ò»¡¢¿Õ¸ñ²»ÒªÂ©£º
ÎÒÃǾ³£ÒªÆ´×°SQLÓï¾ä£¬ÌرðÊÇwhereÌõ¼þ¾ä£¬ÔÚ¸÷¸öÓï¾äÖбðÍüÁËͷβ¼ÓÉϿոñ¡£ÒòΪÔÚÒ»¸öÓï¾äÖÐÎÒÃÇ»á×¢ÒâÓÿոñ·Ö¿ª¹Ø¼ü×Öµ«ÊÇÍùÍùÍüÁËͷβµÄ¿Õ¸ñ¡£ÀýÈ磺
sSQL=' select ......
CREATE proc sqlToMultiExcelFile
@sqlstr nvarchar(4000), --²éѯÓï¾ä,Èç¹û²éѯÓï¾äÖÐʹÓÃÁËorder by ,Çë¼ÓÉÏtop 100 percent
@primaryKey varchar(100),--·ÖÒ³Ö÷¼ü×Ö¶Î
@path nvarchar(1000), --Îļþ´æ·ÅĿ¼
@fname nvarchar(250), --ÎļþÃû
@sheetname varchar(250)='sheet1' --Òª´´½¨µÄ¹¤×÷±íÃû,Ä ......
¡¾1¡¿
create procedure proc_pager1
( @pageIndex int, -- ҪѡÔñµÚXÒ³µÄÊý¾Ý
@pageSize int -- ÿҳÏÔʾ¼Ç¼Êý
)
AS
BEGIN
declare @sqlStr varchar(500)
set @sqlStr='select top '+con ......