Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQLÖлñµÃEXECºóÃæµÄsqlÓï¾ä»ò·µ»ØÖµµÄ·½·¨

SQLÖлñµÃEXECºóÃæµÄsqlÓï¾ä»ò·µ»ØÖµµÄ·½·¨
Ç°ÑÔ£ºÔÚÊý¾Ý¿â³ÌÐò¿ª·¢µÄ¹ý³ÌÖÐ,ÎÒ勱ÃǾ­³£»áÅöµ½Ñ§Ï°ÀûÓÃEXECÀ´Ö´ÐÐÒ»¶ÎÐèÒª·µ»ØijЩֵµÄsqlÓï¾ä£¨Í¨³£Êǹ¹Ô춯̬sqlÓï¾äʱʹÓã©£¬»òÕßÔÚÒ»¸öHTML´æ´¢¹ý³ÌÖÐÀûÓÃEXECµ÷ÓÃÁíÒ»¸öHTMLÓзµ»ØÖµµÄ´æ´¢¹ý³Ì£¨±ØÐë»ñµÃ·µ»ØÖµ£©£¬ÄÇôÈçºÎ»ñµÃÕâЩ·µ»ØÖµÄØ?
1.EXECÖ´ÐÐsqlÓï¾äµÄÇé¿ö
declare @rsql varchar(250)
declare @csql varchar(300)
declare @rc nvarchar(500)
declare @cstucount int
declare @ccount int
set @rsql='(select Classroom_id from EA_RoomTime where zc='+@zc+' and xq='+@xq+' and T'+@time+'=''·ñ'') and ClassroomType=''1'''
--exec(@rsql)
set @csql='select @a=sum(teststucount),@b=sum(classcount) from EA_ClassRoom where classroom_id in '
set @rc=@csql+@rsql
exec sp_executesql @rc,N'@a int output,@b int output',@cstucount output,@ccount output--½«execµÄ½á¹û·ÅÈë±äÁ¿ÖеÄ×ö·¨
--select @csql+@rsql
--select @cstucount
ÉÏÃæµÄ@rcÕâ¸öHTMLsqlÓï¾äµÄ¹¦ÄÜÊÇÕÒ³öÌض¨Ê±¼ä¶ÎÀïËùÓÐÓпյĽÌÊÒÊýÁ¿ÒÔ¼°ÕâЩ½ÌÊÒËùÄÜÈÝÄɵÄѧÉúÈËÊý,ÒòΪÉæ¼°µ½Ñ§Ï°¶¯Ì¬µÄsqlÓï¾ä£¨@csqlÕâ¾äÀïÌõ¼þÖÐÓÐÒ»¸öHTMLÁÐÃûÊǶ¯Ì¬±ä»¯µÄ£©µÄ¹¹Ôì,ËùÒÔÒª·ÅÔÚexecÀïÖ´ÐУ¬µ«ÊÇͬʱÎÒ勱ÓÖÒª·µ»Ø2¸öHTML½á¹û£¬ËùÒÔÖ´ÐÐʱµÄ´úÂëΪ£º
exec sp_executesql @rc,N'@a int output,@b int output',@cstucount output,@ccount output--½«execµÄ½á¹û·ÅÈë±äÁ¿ÖеÄ×ö·¨
ÕâÑù¾Í½«·µ»ØÖµ·Åµ½Ñ§Ï°ÁË£¬@cstucount£¬@ccountÁ½¸öHTML±äÁ¿ÖУ¬µÃµ½Ñ§Ï°ÁËÎÒ勱ÃÇÏëÒªµÄ½á¹û¡£
2.execÖ´Ðдø·µ»ØÖµµÄ´æ´¢¹ý³ÌµÄÇé¿ö
ÎÒ勱ÃÇÀ´¿´Ò»¸öHTML¼òµ¥µÄ´æ´¢¹ý³Ì£º
create procedure ProTest
(
@name varchar(10),
@money int output
)
as
begin
if(@name='1')
set @money=1000
else
set @money=2000
end
Õâ¸öHTMLÖ»ÊÇÒ»¸öHTML¼òµ¥µÄʾÀý£¬Õâ¸öHTML´æ´¢¹ý³Ì·µ»ØµÄÊÇ@money Õâ¸öHTML²ÎÊýµÄÖµ£¬ÄÇôµ±ÎÒ勱ÃÇÔÚÁíÍâÒ»¸öHTML´æ´¢¹ý³ÌÖе÷Óô˴洢¹ý³ÌµÄʱºòÈçºÎ»ñÈ¡Õâ¸öHTML²ÎÊýÄØ£¬·½·¨ÈçÏ£º
declare @m int ---ÓÃÀ´½ÓÊÕ·µ»ØÖµµÄ±äÁ¿
exec ProTest @name='1',@money=@m output --Ò»¶¨Òª×¢ÃûÊÇoutput
¾ÍÕâô¼òµ¥£¬ÎÒ勱ÃǾͻñµÃÁË·µ»ØÖµ¡£
 


Ïà¹ØÎĵµ£º

SQL Server ÈÏÖ¤(Certification)

΢ÈíµÄÊý¾Ý¿âÈÏÖ¤´Ó°üÀ¨3¸ö·½ÃæµÄ£º
MCTS: Microsoft Certified Technology Specialist
MCITP: Microsoft Certified IT Professional
MCM: Microfot Certified Master.
 Î¢Èí½¨Òé²Î¼Ó×îа汾µÄÊý¾Ý¿âÈÏÖ¤¿¼ÊÔ£¬µ±Ç°°æ±¾ÊÇÖ¸Microsoft SQL Server 2008¡£
SQL Server2008 MCTS°üÀ¨3¸öÈÏÖ¤£º
1> SQL Server 200 ......

ʹÓÃvisio 2003½¨Á¢sql server·´Ïò¹¤³Ì

Èý²½×ß¡£
<1>½¨Á¢Êý¾ÝÔ´
´ò¿ª¿ØÖÆÃæ°å—>¹ÜÀí¹¤¾ß—>Êý¾ÝÔ´ (ODBC)£¬»òÖ±½ÓÔËÐÐodbccp32.cplÃüÁî¡£´ò¿ªODBCÊý¾ÝÔ´¹ÜÀíÆ÷¡£Ìí¼ÓÒ»¸öϵͳÊý¾ÝÔ´¡£Ñ¡ÔñSql Server×÷ΪÊý¾ÝÔ´µÄÇý¶¯³ÌÐò£¬¼üÈëÊý¾ÝÔ´Ãû³Ædemo£¬Ñ¡ÔñºÏÊʵÄsql server·þÎñÆ÷£¬È»ºóһ·ĬÈÏÏÂÈ¥¡££¨ÔÚºóÃæµÄ²½ÖèÖпÉÒÔÑ¡ÔñÐèÒª½øÐз´Ïò¹¤³Ì ......

oracle Ïà關µÄsql語¾ä

Êý¾Ý×Öµädict×ÜÊÇÊôÓÚOracleÓû§sysµÄ¡£
¡¡¡¡1¡¢Óû§£º
¡¡¡¡¡¡select username from dba_users;
¡¡¡¡¸Ä¿ÚÁî
¡¡¡¡¡¡alter user spgroup identified by spgtest;
¡¡¡¡2¡¢±í¿Õ¼ä£º
¡¡¡¡¡¡select * from dba_data_files;
¡¡¡¡¡¡select * from dba_tablespaces;//±í¿Õ¼ä
¡¡¡¡¡¡select tablespace_name,sum(bytes), sum(b ......

vfp/(asp/vfpdll/Sql)

ÒÔÏÂÊÇ·¢ÔÚ÷×ÓÂÛ̳µÄÌù×Ó£¬×ª·¢¹ýÀ´£¬Ï£Íû¸øÓõÃ×ŵĺüÓѲο¼¡£
ÎҵijÌÐòÒÔÇ°Ò»Ö±ÊÇÓû¨Éú¿Ç°ó¶¨IPʵÏÖµÄÔ¶³Ì£¬ÓÉÓÚ¿Í»§·þÎñÆ÷ºÍ¿Í»§¶Ë¶¼ÊÇͨ¹ý¿í´øÉÏÍø£¬Ò»°ãµÄ²Ù×÷£¨¿ª½ø»õµ¥¡¢ÏúÊÛµ¥µÈ£©ËÙ¶ÈÒ²»¹²»´í£¬µ«ÊÇÔÚÔ¶³Ì¿Í»§¶ËÐÞ¸ÄÉÌÆ·×ÊÁÏ£¨10000¶àÌõ¼Ç¼£©¡¢²éѯһ¶ÎʱÆڵĽøÏú´æÁ÷Ë®£¨Ò»ÖÜ5000ÌõÒÔÉÏ£©µÈÉæ¼°µ½È¡¼Ç¼Á¿´óµ ......

SQLÓαêÔ­ÀíºÍʹÓ÷½·¨

SQLÓαêÔ­ÀíºÍʹÓ÷½·¨
Êý¾Ý¿â¿ª·¢¹ý³ÌÖУ¬µ±Äã¼ìË÷µÄÊý¾ÝÖ»ÊÇÒ»Ìõ¼Ç¼ʱ£¬ÄãËù±àдµÄÊÂÎñÓï¾ä´úÂëÍùÍùʹÓÃSELECT INSERT Óï¾ä¡£µ«ÊÇÎÒÃdz£³£»áÓöµ½ÕâÑùÇé¿ö£¬¼´´Óijһ½á¹û¼¯ÖÐÖðÒ»µØ¶ÁÈ¡Ò»Ìõ¼Ç¼¡£ÄÇôÈçºÎ½â¾öÕâÖÖÎÊÌâÄØ£¿ÓαêΪÎÒÃÇÌṩÁËÒ»ÖÖ¼«ÎªÓÅÐãµÄ½â¾ö·½°¸¡£
1.1 ÓαêºÍÓαêµÄÓŵã
    ÔÚÊý¾Ý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ