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

SQL 2000Óû§×Ô¶¨Ò庯Êý

Ò»¡£SQL Server µÄÈýÖÖ×Ô¶¨Ò庯Êý
“×Ô¶¨Ò庯Êý”ÊÇÎÒÃÇƽ³£µÄ˵·¨£¬¶ø“Óû§¶¨ÒåµÄº¯Êý”ÊÇ SQL Server ÖÐÊéÃæµÄ˵·¨¡£
SQL Server 2000 ÔÊÐíÓû§´´½¨×Ô¶¨Ò庯Êý£¬×Ô¶¨Ò庯Êý¿ÉÒÔÓзµ»ØÖµ¡£
×Ô¶¨Ò庯Êý·ÖΪ£º±êÁ¿Öµº¯Êý»ò±íÖµº¯Êý
Èç¹û RETURNS ×Ó¾äÖ¸¶¨Ò»ÖÖ±êÁ¿Êý¾ÝÀàÐÍ£¬Ôòº¯ÊýΪ±êÁ¿Öµº¯Êý¡£¿ÉÒÔʹÓöàÌõ Transact-SQL Óï¾ä¶¨Òå±êÁ¿Öµº¯Êý¡£
Èç¹û RETURNS ×Ó¾äÖ¸¶¨ TABLE£¬Ôòº¯ÊýΪ±íÖµº¯Êý¡£
±íÖµº¯ÊýÓÖ¿É·ÖΪ£ºÄÚǶ±íÖµº¯Êý£¨ÐÐÄÚº¯Êý£©»ò¶àÓï¾äº¯Êý
Èç¹û RETURNS ×Ó¾äÖ¸¶¨µÄ TABLE ²»¸½´øÁеÄÁÐ±í£¬Ôò¸Ãº¯ÊýΪÄÚǶ±íÖµº¯Êý¡£
Èç¹û RETURNS ×Ó¾äÖ¸¶¨µÄ TABLE ÀàÐÍ´øÓÐÁм°ÆäÊý¾ÝÀàÐÍ£¬Ôò¸Ãº¯ÊýÊǶàÓï¾ä±íÖµº¯Êý¡£
±êÁ¿Öµº¯ÊýʾÀý
CREATE FUNCTION dbo.Foo()
RETURNS int
AS 
BEGIN
    declare @n int
    select @n=3
    return @n
END
create function GetSex(@sex int)
returns varchar(2)-- ÓÃnvarchar(1)
as                    --  nvarchar:²»¹ÜÊÇÒ»¸ö×Ö·û»¹ÊÇÒ»¸öºº×Ö,¶¼´æΪ2¸ö×Ö½Ú
begin                 -- varchar:ºº×ÖÊÇ2¸ö×Ö½Ú,ÆäËû×Ö·û´æΪ1¸ö×Ö½Ú
declare @ssex varchar(2)-- ÓÃnvarchar(1)
 if(@sex=1)
    set @ssex='ÄÐ'
  else
    set @ssex='Å®'
return (@ssex)
end
µ÷Óãº
select id,username,dbo.GetSex(Sex) as sex ,loginnum from t_user
ÄÚǶ±íÖµº¯ÊýʾÀý
CREATE FUNCTION dbo.Foo()
RETURNS TABLE
AS 
    return select id, title from msgs
ÄÚǶ±íÖµº¯ÊýÖ»ÓÐÒ»¸ö select Óï¾ä¡£
¶àÓï¾ä±íÖµº¯ÊýʾÀý£¨²¿·Ö£©
CREATE FUNCTION FindUsers (@userid int )
RETURNS @FindUser TABLE (id int primary key, UserName varchar(30), RegDateTime DateTime,LoginNum int)
as
begin
insert into @FindUser Select ID, UserName,RegDateTime,LoginNum from T_User Where ID=@userid
return
end 
µ÷Óãº
SELECT * from FindUsers(6)
×¢ÒâÆä RETURNS ²¿·Ö¡£
¶àÓï¾äº¯ÊýµÄÖ÷ÌåÖÐÔÊÐíʹÓÃÒÔÏÂÓï¾ä¡£Î´ÔÚÏÂÃæµÄÁбíÖÐÁг


Ïà¹ØÎĵµ£º

SQL Server 2008¼¸ÏîÐÂÌØÐÔ¸ÅÊö

¼Æ»®ÓÚ2008ÄêµÚÒ»¼¾¶È·¢²¼µÄSQL Server 2008²»½ö¶ÔÔ­ÓÐÐÔÄܽøÐÐÁ˸Ľø£¬»¹Ìí¼ÓÁËÐí¶àÐÂÌØÐÔ£¬±ÈÈçÐÂÌíÁËÊý¾Ý¼¯³É¹¦ÄÜ£¬¸Ä½øÁË·ÖÎö·þÎñ£¬±¨¸æ·þÎñ£¬ÒÔ¼°Office¼¯³ÉµÈµÈ¡£
¡¡¡¡SQL Server¼¯³É·þÎñ
¡¡¡¡SSIS(SQL Server¼¯³É·þÎñ)ÊÇÒ»¸öǶÈëʽӦÓóÌÐò£¬ÓÃÓÚ¿ª·¢ºÍÖ´ÐÐETL(½âѹËõ¡¢×ª»»ºÍ¼ÓÔØ)°ü¡£SSIS´úÌæÁËSQL 2000µÄDTS¡£Õ ......

SQL Server JDBC Çý¶¯·â×°

1¡¢½¨Á¢Ò»¸öjdbc.jsp Îļþ£º
2¡¢½«ÏÂÃæÏàÓ¦µÄ´úÂ븴ÖƵ½jdbc.jspÖÐ
3¡¢±àдҪÁ¬½Óµ½Êý¾Ý¿âµÄjspÎļþʱ£¬Ö»Ð轫jdbc.jspÎļþ°üº¬µ½¸ÃjspÎļþÖоÍÐÐÁË
·½·¨£ºÌí¼Ó<%@  include file="jdbc.jsp">µ½jspÎļþÖм´¿É
//sql server2005:
<%@ page language="java" import ="java.util.*"%>
 
<%
& ......

Microsoft SQL Azure ³£¼ûÎÊÌâ½â´ð

¹«¸æ£º±¾²©¿ÍΪ΢ÈíÔƼÆËãÖÐÎIJ©¿ÍµÄ¾µÏñ²©¿Í£¬²¢²»±£Ö¤Á´½Ó¿ÉÓÃÐÔ£¬ÎªÁ˱£Ö¤ÔĶÁÌåÑ飬Çë·ÃÎÊhttp://blogs.msdn.com/azchina¡£
 
 
October CTPµÄ SQL Azure DatabaseµÄ¹Ø¼ü¹«¸æÊÇʲô£¿
    October CTPµÄSQL Azure database¶ÔÓÚPDC2009À´Ëµ»ù±¾¹¦ÄÜÒѾ­Íê³ÉÁË¡£ October CTP&nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ