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

MSSQLд·¨¾«Á¶

1¡¢SQL2000ÖÐÒ»±íÓÐÒ»ÈÕÆÚÐÍ×Ö¶ÎBirthDay£¬¼Ç¼³öÉúÈÕÆÚ£¬ÏëÿÄêÔÚ±¾ÈÕÉúÈÕÇ°15Ì죬½«Æä¹ýÂ˳öÀ´£¬ÔõôдWhereÌõ¼þ£¿£º
select out_date from sales_out_head_tab where (DATEDIFF(day,DATEADD(year ,year(getdate())-year(out_date) ,out_date )
 ,getdate())  BETWEEN -15 and 0 ) order by out_date


Ïà¹ØÎĵµ£º

MsSql ºÍ Oracle ¿çÊý¾Ý¿â²éѯ

SQL
insert into   table_name(colum1,colum2)
select  colum1,colum2
 from  opendatasource('sqloledb','data source=·þÎñÆ÷Ãû;user id=Óû§Ãû ;password=ÃÜÂë ').database_name.dbo.table_name
ÈçÖ´ÐгöÏÖÒÔÏ´íÎó”sql server ×èÖ¹Á˶Ô×é¼þ \'ad hoc distributed queries\' µÄ·ÃÎÊ&l ......

ÐéÄâ»úÉÏMSSQLÁ¬½ÓµÄÎÊÌâ

ÔÚµçÄÔÉÏ×°Á˸öÐéÄâ»ú£¬±¾»ú×°Á˸öMSSQL2000,ÔÚÐéÄâ»úÒ²×°Á˸öMSSQL2000£¬µ«Êǵ±Á¬½ÓÐéÄâ»úÉϵÄMSSQL£¬SQLÌáʾ³ö´í£¬ÎÞ·¨Á¬½Ó£¬¾õµÃºÜÆæ¹Ö£¬ÒòΪIPµØÖ·ÊDz»Í¬µÄ£¬×îºóÏëµ½Á˸ö°ì·¨£¬ÒòΪÊÇһ̨µçÄÔ£¬ËùÒԶ˿Ú1433Ö»ÓÐÒ»¸ö£¬±¾»úÕ¼ÁË1433£¬ÄÇôÐéÄâ»ú¾Íû·¨ÓÃÁË£¬Ïëµ½¾Í×ö£¬°ÑÐéÄâ»úµÄ¶Ë¿Ú¸Ä³ÉÁË1500¡£ÖØÆôµçÄÔ£¬µ«ÊÇ»¹ÊDz»Ä ......

MsSql³£ÓÃÈÕÆÚ¸ñʽ

SQL ServerÖÐÎÄ°æµÄĬÈϵÄÈÕÆÚ×Ö¶Îdatetime¸ñʽÊÇyyyy-mm-dd Thh:mm:ss.mmm
ÀýÈç:
select getdate()
2004-09-12 11:06:08.177
ÕûÀíÁËÒ»ÏÂSQL ServerÀïÃæ¿ÉÄܾ­³£»áÓõ½µÄÈÕÆÚ¸ñʽת»»·½·¨:
¾ÙÀýÈçÏÂ:
select CONVERT(varchar, getdate(), 120 )
2004-09-12 11:06:08
select replace(replace(replace(CONVER ......

AspNetPagerÓëMSSQLº£Á¿·ÖÒ³´æ´¢¹ý³Ì½áºÏ

´æ´¢¹ý³ÌPagination£º
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[Pagination]
@tblName varchar(255), -- ±íÃû
@PKName varchar(255), -- ×Ö¶ÎÃû
@strGotFields varchar(1000) = '*' , --²éѯ×Ö¶ÎÃû
@PageSize int = 10, -- Ò³³ß´ç
@PageIndex int = 1, -- Ò³Âë
@OrderType bi ......

C#ʹÓÃSQLDMOʵÏÖ¶ÔMSSQLÊý¾Ý¿â½øÐб¸·ÝºÍ»Ö¸´

public sealed class DbOper
{
     ///<summary>
     /// DbOperÀàµÄ¹¹Ô캯Êý
     ///</summary>
     private DbOper()
     {
     }
     ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ