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

Ò»²½Ò»²½Ñ§Linq to sql£¨ËÄ£©£º²éѯ¾ä·¨


select
 
ÃèÊö£º²éѯ¹Ë¿ÍµÄ¹«Ë¾Ãû¡¢µØÖ·ÐÅÏ¢
²éѯ¾ä·¨£º
var ¹¹½¨ÄäÃûÀàÐÍ1 = from c in ctx.Customers
                      select new
                      {
                          ¹«Ë¾Ãû = c.CompanyName,
                          µØÖ· = c.Address
                      };
¶ÔÓ¦SQL£º
SELECT [t0].[CompanyName], [t0].[Address]
from [dbo].[Customers] AS [t0]      
 
ÃèÊö£º²éѯְԱµÄÐÕÃûºÍ¹ÍÓÃÄê·Ý
²éѯ¾ä·¨£º
var ¹¹½¨ÄäÃûÀàÐÍ2 = from emp in ctx.Employees
                      select new
                      {
                          ÐÕÃû = emp.LastName + emp.FirstName,
                          ¹ÍÓÃÄê = emp.HireDate.Value.Year
                      };
¶ÔÓ¦SQL£º
SELECT [t0


Ïà¹ØÎĵµ£º

ʵÏÖSQL Server 2008Êý¾ÝѹËõ

ΪʲôÐèÒªÊý¾ÝѹËõ
¡¡¡¡Ê×ÏÈ¿ÉÄÜÐèÒªÌÖÂÛµÄÎÊÌâ¾ÍÊÇΪʲôÔÚ´æ´¢³É±¾²»¶Ï½µµÍµÄ½ñÌ죬΢Èí»¹ÒªÉ··Ñ¿àÐĵØÔÚSQL ServerÖÐʵÏÖ²¢ÇÒ²»¶Ï¸Ä½øÊý¾ÝѹËõ¼¼ÊõÄØ?
¡¡¡¡¾¡¹Ü´æ´¢³É±¾ÒѾ­²»ÔÙÊÇ´«Í³ÒâÒåÉϵÄÊ×Òª¿¼ÂÇÒòËØ£¬µ«ÊÇÕâ²¢²»´ú±íÊý¾Ý¿â³ß´ç²»ÊÇÒ»¸öÎÊÌ⣬ÒòΪÊý¾Ý¿â³ß´ç³ýÁË»áÓ°Ïìµ½´æ´¢³É±¾Ö®Í⣬»¹¼«´óµØ¹ØÁªµ½¹ÜÀí³É±¾º ......

SQL Server Óï¾ä

Êý¾Ý¿â£º
1¡¢  ´´½¨Êý¾Ý¿âµÄÓï·¨£º
if exists (select * from sysdatabases where name='DT_name')   /*ÅжÏÊÇ·ñ´æÔÚ£¬ÊÇÔòɾ³ý*/
drop database DT_name
create database database_name
on          primary  /* Ö¸¶¨Ö÷ÒªÎļþ×飬ÆäÖеÚÒ»¸öÖ÷ÒªÎļþ * ......

ms sql : xp_cmdshell

Ïò¸ßÊÖÇë½ÌÒ»¸öÎÊÌâ:
µ±ÎÒÖ´ÐÐ:
  use master
exec  xp_cmdshell 'osql /S musqlserver /U sa /P mypwd /d haodb /Q "select top 10 * from trandetail"  /o C:\my1.xls'
ÒÔÉÏÖ´Ðгɹ¦,»á²úÉúÐÂÎļþ:C:\my1.xls'
È»ºóÎÒÏ뽫´ËÎļþÖ±½Ócopyµ½Áíһ̨µçÄÔÖÐ[Òѽ¨Á¬½Ó]
Ö´ÐÐ
   ......

SQL ½«ÁÐת»»ÎªÐУ¬Ï൱ÓÚ½«±í½á¹¹Ðýת90¶È

½«ÁÐת»»ÎªÐУ¬Ï൱ÓÚ½«±í½á¹¹Ðýת90¶È
T_Student ±í
Stud_ID
Sex
Name
1
ÄÐ
Tom
2
Å®
Anne
3
ÄÐ
Jack
 
Ö´ÐÐ: Exec proColumnToRow ’T_Student’,’Name’,’ New_ID’
 
ת»»ºóµÄ±í
 
New_ID
Tom
Anne
Jack
Stud_ID
1
2
3
Sex
ÄÐ
Å®
ÄÐ
& ......

DB2 SQLÐÔÄÜÓÅ»¯Ïà¹ØµÄ10´óÒªËØ

ÏÂÃæÌá³öÁË10ÌõºÍDB2 SQLÐÔÄÜÏà¹ØµÄ10ÌõÒòËØ£º
1¡¢ÌṩÊʵ±µÄͳ¼ÆÐÅÏ¢
¶ÔDB2ÓÅ»¯¹ÜÀíÆ÷£¨otimizer£©¶øÑÔ£¬ÈçºÎ¸ü¼ÓÓÐЧµÄÖ´ÐÐSQLÓï¾äÊÇÓÉ´æÔÚÓÚDB2 catalogÖеÄͳ¼ÆÐÅÏ¢¾ö¶¨µÄ£¬ÓÅ»¯Æ÷ÀûÓÃÕâЩÐÅÏ¢¾ö¶¨×îÓÅ»¯µÄ·¾¶¡£
Òò´Ë£¬ÎªÁ˱£³ÖϵͳÄܹ»×ö³ö×î¼ÑÑ¡Ôñ£¬ÐèÒª¾­³£µÄÔËÐÐRunstatsÃüÁÀ´±£³Öϵͳͳ¼ÆÐÅÏ¢µÄ¼°Ê±ÓÐЧ¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ