sql server 2000µÄ·ÖÒ³´æ´¢¹ý³Ì
´æ´¢¹ý³ÌgetRecordfromPageµÄÄÚÈÝ
//getRecordfromPage.sql
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[getRecordfromPage]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[getRecordfromPage]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE getRecordfromPage
@tblName varchar(255), -- ±íÃû
@strGetFields varchar(1000) = '*', -- ÐèÒª·µ»ØµÄÁÐ
@fldName varchar(255)='', -- ÅÅÐòµÄ×Ö¶ÎÃû
@PageSize int = 10, -- Ò³³ß´ç
@PageIndex int = 1, -- Ò³Âë
@doCount bit = 0, -- ·µ»Ø¼Ç¼×ÜÊý, ·Ç 0 ÖµÔò·µ»Ø
@OrderType bit = 0, -- ÉèÖÃÅÅÐòÀàÐÍ, ·Ç 0 ÖµÔò½µÐò
@strWhere varchar(1500) = '' -- ²éѯÌõ¼þ (×¢Òâ: ²»Òª¼Ó where)
AS
declare @strSQL varchar(5000) -- Ö÷Óï¾ä
declare @strTmp varchar(110) -- ÁÙʱ±äÁ¿
declare @strOrder varchar(400) -- ÅÅÐòÀàÐÍ
if @doCount != 0
begin
if @strWhere !=''
set @strSQL = 'select count(*) as Total from [' + @tblName + '] where '+@strWhere
else
set @strSQL = 'select count(*) as Total from [' + @tblName + ']'
end
--ÒÔÉÏ´úÂëµÄÒâ˼ÊÇÈç¹û@doCount´«µÝ¹ýÀ´µÄ²»ÊÇ0£¬¾ÍÖ´ÐÐ×ÜÊýͳ¼Æ¡£ÒÔϵÄËùÓдúÂ붼ÊÇ@doCountΪ0µÄÇé¿ö£º
else
begin
if @OrderType != 0
begin
set @strTmp = '<=(select min'
set @strOrder = ' order by [' + @fldName +'] desc'
--Èç¹û@OrderType²»ÊÇ0£¬¾ÍÖ´ÐнµÐò£¬Õâ¾äºÜÖØÒª£¡
end
else
begin
set @strTmp = '>=(select max'
set @strOrder =' order by [' + @fldName +'] '
end
if @PageIndex > 1
begin --ÒÔÏ´úÂ븳ÓèÁË@strSQLÒÔÕæÕýÖ´ÐеÄSQL´úÂë
set @strSQL = 'select top ' + str(@PageSize) +' '+@strGetFields+ ' from ['
&nbs
Ïà¹ØÎĵµ£º
Private Sub CommandButton1_Click()
Worksheets("Sheet2").Select
Cells.Select
Selection.Delete Shift:=xlUp
Range("A1").Select
'Çå³ýÔÚExcelÖеÄÊý¾Ý,È·±£µ¼ÈëÐÅÏ¢²»³öÏÖÓëÔExcelÊý¾Ý½øÐеþ¼Ó
Dim cnnConnect As Object
Dim rstR ......
ͨ¹ýÁ¬½ÓÔËËã·û¿ÉÒÔʵÏÖ¶à¸ö±í²éѯ¡£Á¬½ÓÊǹØϵÊý¾Ý¿âÄ£Ð͵ÄÖ÷ÒªÌص㣬ҲÊÇËüÇø±ðÓÚÆäËüÀàÐÍ
Êý¾Ý¿â¹ÜÀíϵͳµÄÒ»¸ö±êÖ¾¡£
ÔÚ¹ØϵÊý¾Ý¿â¹ÜÀíϵͳÖУ¬±í½¨Á¢Ê±¸÷Êý¾ÝÖ®¼äµÄ¹Øϵ²»±ØÈ·¶¨£¬³£°ÑÒ»¸öʵÌåµÄËùÓÐÐÅÏ¢´æ·ÅÔÚ
Ò»¸ö±íÖС£µ±¼ìË÷Êý¾Ýʱ£¬Í¨¹ýÁ¬½Ó²Ù×÷²éѯ³ö´æ·ÅÔÚ¶à¸ö±íÖеIJ»Í¬ÊµÌåµÄÐÅÏ¢¡£Á¬½Ó²Ù×÷¸øÓû ......
ת×Ôhttp://lavasoft.blog.51cto.com/62575/23373
SQLÓïÑÔµÄCASEÓï¾ä±¸Íü
¸ÅÊö£º
SQLÓï¾äÖеÄCASEÓï¾äÓë¸ß¼¶ÓïÑÔÖеÄswitchÓï¾ä£¬ÊDZê×¼SQLµÄÓï·¨£¬ÊÊÓÃÓëÒ»¸öÌõ¼þÅжÏÓжàÖÖÖµµÄÇé¿öÏ·ֱðÖ´Ðв»Í¬µÄ²Ù×÷¡£Áé»îÓ¦ÓÃCASEÓï¾ä¿ÉÒÔʹSQLÓï¾ä±äµÃ¼ò½àÒ׶Á£¬ÏÂÃæÔÚDB2»·¾³ÏÂͨ¹ýÒ»¸ö¼òµ¥µÄ²éѯÀ´Õ¹Ê¾SQL CASEÓ ......
ÎÄÕÂÀ´Ô´£ºHttp://www.simple-talk.com
ÔÎĵØÖ·£ºhttp://www.simple-talk.com/sql/learn-sql-server/managing-transaction-logs-in-sql-server/
Ô×÷ÕߣºRobert Sheldon
·Ò룺Èý½úÒ»Ö¦»¨
ÒëÎÄÔµØÖ·£ºhttp://prj.souty.cn/Admin/Knowledges/ShowKnowledge.aspx?id=44dbde74-d2c5-41a5-a8e9-375ba7103025
ÔÚ SQL Serv ......
ÊÓͼ¿ÉÒÔ±»¿´³ÉÊÇÐéÄâ±í»ò´æ´¢²éѯ¡£¿Éͨ¹ýÊÓͼ·ÃÎʵÄÊý¾Ý²»×÷Ϊ¶ÀÌصĶÔÏó´æ´¢ÔÚÊý¾Ý¿âÄÚ¡£Êý¾Ý¿âÄÚ´æ´¢µÄÊÇ SELECT Óï¾ä¡£SELECT Óï¾äµÄ½á¹û¼¯¹¹³ÉÊÓͼËù·µ»ØµÄÐéÄâ±í¡£Óû§¿ÉÒÔÓÃÒýÓñíʱËùʹÓõķ½·¨£¬ÔÚ Transact-SQL Óï¾äÖÐͨ¹ýÒýÓÃÊÓͼÃû³ÆÀ´Ê¹ÓÃÐéÄâ±í¡£Ê¹ÓÃÊÓͼ¿ÉÒÔʵÏÖÏÂÁÐÈÎÒ»»òËùÓй¦ÄÜ£º
½«Óû§ÏÞ¶¨ÔÚ± ......