SQL´æ´¢¹ý³Ì²âÊÔ£¨4£©——´´½¨T
ÎÊÌâ
ÈçºÎ´´½¨Ò»¸öT-SQL²âÊÔÌ×¼þÓÃÓÚ²âÊÔSQL´æ´¢¹ý³Ì¡£
Éè¼Æ
Ê×ÎÞ£¬Í¨¹ý²åÈë´óÁ¿²âÊÔƽ̨Êý¾Ý×¼±¸ºÃÒ»¸ö°üº¬´ý²â´æ´¢¹ý³ÌµÄµ×²ãÊý¾Ý¿â¡£½ÓÏÂÀ´£¬Ê¹ÓÃÒ»¸öSQLÓαê(cursor)±éÀúÕâ¸ö²âÊÔÓÃÀýÊý¾Ý±í¡£Õë¶Ôÿ¸ö²âÊÔÓÃÀý£¬µ÷Óôý²â´æ´¢¹ý³Ì²¢ÇÒÈ¡µÃËüµÄ·µ»ØÖµ£¬°Ñʵ¼Ê·µ»ØÖµÓëÆÚÍûÖµ½øÐбȽϣ¬´Ó¶øÅж¨²âÊÔ½á¹ûÊÇͨ¹ýÓë·ñ£¬È»ºóÏÔʾ»ò±£´æ²âÊÔ½á¹û¡£
·½°¸
——testAuto.sql
——ΪdbEmployeesÌî³äÊý¾Ý
truncate table dbEmployees.dbo.tblEmployees
insert into dbEmployees.dbo.tblEmployees values('e11','Adams','15/10/2009')
insert into dbEmployees.dbo.tblEmployees values('e22','Baker','15/10/2009')
insert into dbEmployees.dbo.tblEmployees values('e33','Young','15/10/2009')
insert into dbEmployees.dbo.tblEmployees values('e44','Zetta','15/10/2009')
——´Ë´¦²åÈë¸ü¶àÊý¾Ý
declare tCursor cursor fast_forward
for select caseID,input,expected
from dbTestCasesAndResults.dbo.tblTestCases
order by caseID
declare @caseID char(4),@input char(3),@expected int
declare @actual int,@whenRun datetime
declare @resultLine varchar(50)
set @whenRun = getdate()
open tCursor
fetch next
from tCursor
into @caseID,@input,@expected
while @@fetch_status = 0
begin
exec @actual = dbEmployees.dbo.usp_StatusCode @input
if (@actual = @expected)
begin
set @resultLine = @caseID + ': Pass'
print @resultLine
end
else
begin
set @resultLine = @caseID + ': FAIL'
&nbs
Ïà¹ØÎĵµ£º
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssql
Óï¾ä£¬²»¿ÉÒÔÔÚaccess
ÖÐʹÓá£
SQL
·ÖÀࣺ
DDL—
Êý¾Ý¶¨ÒåÓïÑÔ(CREATE
£¬ALTER
£¬DROP
£¬DECLARE)
DML—
Êý¾Ý²Ù×ÝÓïÑÔ(SELECT
£¬DELETE
£¬UPDATE
£¬INSERT)
DCL—
Êý¾Ý¿ØÖÆÓïÑÔ(GRANT
£¬REVOKE
£¬COMMIT
£¬ROLLBACK)
Ê×ÏÈ,
¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1
¡¢ËµÃ÷£º ......
index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......
Sql´úÂë
--²ÉÓÃSQLÓï¾äʵÏÖsql2005ºÍExcel Êý¾ÝÖ®¼äµÄÊý¾Ýµ¼Èëµ¼³ö£¬ÔÚÍøÉÏÕÒÀ´Ò»--Ï£¬ÊµÏÖ·½·¨ÊÇÕâÑùµÄ£º
--Excel---->SQL2005 µ¼È룺
select * into useinfo from O ......
ÊìϤSQL SERVER 2000µÄÊý¾Ý¿â¹ÜÀíÔ±¶¼ÖªµÀ£¬ÆäDTS¿ÉÒÔ½øÐÐÊý¾ÝµÄµ¼Èëµ¼³ö£¬Æäʵ£¬ÎÒÃÇÒ²¿ÉÒÔʹÓÃTransact-SQLÓï¾ä½øÐе¼Èëµ¼³ö²Ù×÷¡£ÔÚTransact-SQLÓï¾äÖУ¬ÎÒÃÇÖ÷ҪʹÓÃOpenDataSourceº¯Êý¡¢OPENROWSET º¯Êý£¬¹ØÓÚº¯ÊýµÄÏêϸ˵Ã÷£¬Çë²Î¿¼SQLÁª»ú°ïÖú¡£ÀûÓÃÏÂÊö·½·¨£¬¿ÉÒÔÊ®·ÖÈÝÒ×µØʵÏÖSQL SERVER¡¢ACCESS¡¢EXCELÊý¾Ýת»»£ ......
SQLÈÕÆÚ¸ñʽ»¯
0 »ò 100 (*) ĬÈÏÖµ mon dd yyyy hh:miAM£¨»ò PM£©
1 101 ÃÀ¹ú mm/dd/yyyy   ......