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

ms sql Ò»´Î²åÈë¶àÌõ¼Ç¼µÄÓï¾ä

ÓеÄʱºòÎÒÃÇÐèÒªÒ»´ÎÏñÊý¾Ý¿âÖÐÌí¼Ó¶àÌõ¼Ç¼£¬ÎÒÃÇ¿ÉÒÔʹÓÃÏÂÃæµÄÓï¾äÀ´ÊµÏÖ£º
--Ìí¼ÓÒ»Ìõ¼Ç¼
INSERT INTO tableName(col1,col2,col3) VALUES (1,2,3)
--Ìí¼Ó¶àÌõ¼Ç¼
INSERT INTO tableName(col1,col2,col3)
SELECT 3,4,5
UNION ALL
SELECT 6,7,8
--´ÓÁíÍâµÄÒ»ÕűíÖжÁÈ¡¶àÌõÊý¾ÝÌí¼Óµ½Ð±íÖÐ
INSERT INTO tableName(col1,col2,col3)
SELECT a,b,c from tableA
--´ÓÆäËûµÄ¶àÕűíÖжÁÈ¡Êý¾ÝÌí¼Óµ½Ð±íÖÐ
INSERT INTO tableName(col1,col2,col3)
SELECT a,b,c from tableA WHERE a=1
UNION ALL
SELECT a,b,c from tableB WHERE a=2
ÔÚmysql¿ÉÒÔÕâÑù
insert
 
into
 tablefortest(a,b)
values
(
1
,
2
) ,(
3
,
4
) ,(
5
,
6
)


Ïà¹ØÎĵµ£º

½â¾öSQL¡¡SERVER2005²»ÄÜÔ¶³ÌÁ¬½ÓÎÊÌâ

¸Õ×°ÍêÊý¾Ý¿â¾Í±»ÈË·è¿ñɨÃèsa£¬ÎÞ±ÈÓôÃÆ¡£
¸ÄsaÃû³Æ£¬1433¶Ë¿ÚºÅ£¬ÒòΪ¿ª·¢ÐèÒª»¹±ØÐë´ò¿ªÔ¶³ÌÁ¬½Ó£¬½á¹ûÔÚ¿Í»§¶ËÎÞÂÛÈçºÎ¶¼²»ÄÜÁ¬½ÓÉÏ·þÎñÆ÷¡£
¿ñº¹Çë°Ù¶È´óÉñ³öÂí£¬°Ñ¸÷ÖÖÅäÖÃÁ·Á˸öÊ죬½á¹û»¹ÊÇû½â¾ö¡£
¸ãЦµÄÊÇ×îºóÎÞÒâÖÐÔÚMicrosoftÂÛ̳ÉÏ¿´µ½Õâôһ¾ä£¬ÐÞ¸ÄÍê¶Ë¿ÚºÅ£¬ÔÚ¿Í»§¶ËµÇ¼µÄʱºòÒªÔÚIPºóÃ棫¶ººÅ£«¶Ë¿Úº ......

ÈçºÎÅäÖà SQL Server 2005 ÒÔÔÊÐíÔ¶³ÌÁ¬½Ó

½ñÌìÔÚÒ»¸öVPSÉÏ°²×°sql2005£¬°²×°ºÃºó±¾µØÒ»Ö±Á¬½Ó²»ÉÏ
¼ò½é
ÔÚ³¢ÊÔ´ÓÔ¶³Ì¼ÆËã»úÁ¬½Óµ½ Microsoft SQL Server 2005 ʵÀýʱ£¬¿ÉÄÜ»á½ÓÊÕµ½´íÎóÏûÏ¢¡£ÔÚʹÓÃÈκγÌÐòÁ¬½Óµ½ SQL Server ʱ¶¼¿ÉÄܻᷢÉú´ËÎÊÌâ¡£ÀýÈ磬ÔÚʹÓà SQLCMD ʵÓù¤¾ßÁ¬½Óµ½ SQL Server ʱÊÕµ½ÒÔÏ´íÎóÏûÏ¢£º
Sqlcmd:´íÎó:Microsoft SQL Native Cli ......

²éѯ´æ´¢¹ý³ÌµÄ²ÎÊýÐÅÏ¢µÄSQLÓï¾ä

declare @SchemaName nvarchar(50)
set @SchemaName='dbo'
declare @CommandName nvarchar(50)
set @CommandName='spName'
SELECT
                DB_NAME() AS [PROCEDURE_CATALOG],
         ......

SQL ¼Ü¹¹

¼Ü¹¹£¨Schema£©¡£Î¢ÈíµÄ¹Ù·½ËµÃ÷£¨MSDN£©£º
"Êý¾Ý¿â¼Ü¹¹ÊÇÒ»¸ö¶ÀÁ¢ÓÚÊý¾Ý¿âÓû§µÄ·ÇÖظ´ÃüÃû¿Õ¼ä£¬Äú¿ÉÒÔ½«¼Ü¹¹ÊÓΪ¶ÔÏóµÄÈÝÆ÷"£¬Ïêϸ²Î¿¼
http://technet.microsoft.com/zh-cn/library/ms190387.aspx.ÎÒÃÇÖªµÀ£¬ÔÚJAVAÖУ¬ÃüÃû¿Õ
¼äÃûÆäʵ¾ÍÊÇÎļþ¼ÐÃû¡£Òò´ËÎÒÃǷdz£Ã÷È·Ò»µã£ºÒ»¸ö¶ÔÏóÖ»ÄÜÊôÓÚÒ»¸ö¼Ü¹¹£¬¾ÍÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ