×î¼òµ¥µÄSQL ServerÊý¾Ý¿â´æ´¢¹ý³Ì·ÖÒ³
×î¼òµ¥µÄSQL ServerÊý¾Ý¿â´æ´¢¹ý³Ì·ÖÒ³
·¢²¼Ê±¼ä£º2008.07.02 05:11 À´Ô´£ºÈüµÏÍø ×÷ÕߣºAlizze
¡¾ÈüµÏÍø£IT¼¼Êõ±¨µÀ¡¿×î¼òµ¥µÄSQL ServerÊý¾Ý¿â´æ´¢¹ý³Ì·ÖÒ³:
1.Ö»ÐèÒªÌṩSqlÓï¾äºÍÿҳµÄ¼Ç¼Êý,Ò³Êý¾Í¿ÉÒÔÁË
2,Ëٶȳ¬¿ìÓ´,100W¼Ç¼1~3Ãë¾Í·Ö³öÀ´ÁË
3,¶ÔÓÚ´æ´¢¹ý³ÌÌرðºÃÓÃ
--//µ÷Óõķ½Ê½
±í
exec up_zbh_DivPageBySql 'select * from ±í',10,3
´æ´¢¹ý³Ì
exec up_zbh_DivPageBySql 'exec ´æ´¢¹ý³Ì',10,1
--//·â×°³ÉÒ»¸ö´æ´¢¹ý³Ì,µ÷ÓõÄʱºò·½±ãµÄºÜ¹þ!!
create procedure up_zbh_DivPageBySql
@strSql varchar(8000),
@nPageSize int,
@nPageCount int
as
SET NOCOUNT ON
DECLARE @P1 INT,
@nRowCount INT
--//×¢Òâ:@scrollopt = 1 »áÈ¡µÃSelectµÄʱºòµÄ×ÜÐÐÊý
EXEC sp_cursoropen @P1 OUTPUT, @strSql, @scrollopt = 2, @ccopt = 335873, @rowcount = @nRowCount OUTPUT
IF (@P1 != 0)
BEGIN
--SELECT @nRowCount AS nRecordCount, ceiling(1.0 * @nRowCount / @nPageSize) AS nPageCount, @nPageCount AS nPage
SET @nPageCount = (@nPageCount - 1) * @nPageSize + 1
EXEC sp_cursorfetch @P1, 32, @nPageCount, @nPageSize
EXEC sp_cursorclose @P1
END
GO
£¨ÔðÈα༣ºÂ¬Õ×ÁÖ£©
Ïà¹ØÎĵµ£º
/*
½¨±í£º
dept:
deptno(primary key),dname,loc
emp:
empno(primary key),ename,job,mgr,sal,deptno
*/
1 Áгöemp±íÖи÷²¿ÃŵIJ¿Ãźţ¬×î¸ß¹¤×Ê£¬×îµÍ¹¤×Ê
select max(sal) as ×î¸ß¹¤×Ê,min(sal) as ×îµÍ¹¤×Ê,deptno from emp group by deptno;
2 Áгöemp±íÖи÷²¿ÃÅjobΪ'CLERK'µÄÔ±¹¤µÄ×îµÍ¹¤×Ê£¬×î¸ß¹¤×Ê
sele ......
1¡¢WINDOWSÉí·ÝµÇ½£º
<connectionStrings>
<add name="connectionString" connectionString="Data Source=(local);Initial Catalog=AngelicaDB;Integrated Security=True" providerName="System .Data .SqlClient" /> ......
mysql´´½¨Êý¾Ý¿âsqlʵÀý
# MySQL-Front 3.2 (Build 2.10)
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET CHARACTER SET 'latin1' ......
½ñÌìÓöµ½¸öÓÐÒâ˼µÄÎÊÌ⣬ÊÇÒ»¸ö·Ö×éÅÅÐòµÄÎÊÌ⣬²»¹ýÒªÇó·Ö×éºÍ·Ö×é¼äÒ²ÒªÅÅÐò£¬Èç¹ûÕâ¸ö×éÄÚÓÐÒ»ÌõÊý¾ÝÊÇ×î½ü¸üеģ¬ÄÇôÕâÕû¸ö×鶼Ӧ¸ÃÅÅÔÚÇ°Ãæ¡£
ÏÂÃæÒÔOracleµÄHRʾÀýSchemaÖеÄemployees±íΪÀý£º
Óï¾ä°´²¿ÃÅ·Ö×飬·Ö×éÖ®¼äµÄÅÅÐòÊÇÕâÑùµÄ£ºÈç¹ûÕû¸ö·Ö×éÖÐÓÐÒ»¸öÔ±¹¤µÄhire_dateÊÇ×îеģ¬ÄÇôÕâ¸ö·Ö×é¾ÍÓ¦¸ÃÅÅÔÚÆä ......
SQL ServerÊý¾Ý¿â±¸·ÝÓÐÁ½ÖÖ·½Ê½£¬Ò»ÖÖÊÇʹÓÃBACKUP DATABASE½«Êý¾Ý¿âÎļþ±¸·Ý³öÈ¥£¬ÁíÍâÒ»ÖÖ¾ÍÊÇÖ±½Ó¿½±´Êý¾Ý¿âÎļþmdfºÍÈÕÖ¾ÎļþldfµÄ·½Ê½¡£ÏÂÃ潫Ö÷ÒªÌÖÂÛһϺóÕߵı¸·ÝÓë»Ö¸´¡£±¾Îļٶ¨ÄúÄÜÊìÁ·Ê¹ÓÃSQL Server Enterprise Manager(SQL ServerÆóÒµ¹ÜÀíÆ÷)ºÍSQL Server Quwey Analyser(SQL Server²éѯ·ÖÎöÆ÷)
¡¡¡¡
¡ ......