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
Ïà¹ØÎĵµ£º
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 ......
ÔÚµçÄÔÉÏ×°Á˸öÐéÄâ»ú£¬±¾»ú×°Á˸öMSSQL2000,ÔÚÐéÄâ»úÒ²×°Á˸öMSSQL2000£¬µ«Êǵ±Á¬½ÓÐéÄâ»úÉϵÄMSSQL£¬SQLÌáʾ³ö´í£¬ÎÞ·¨Á¬½Ó£¬¾õµÃºÜÆæ¹Ö£¬ÒòΪIPµØÖ·ÊDz»Í¬µÄ£¬×îºóÏëµ½Á˸ö°ì·¨£¬ÒòΪÊÇһ̨µçÄÔ£¬ËùÒԶ˿Ú1433Ö»ÓÐÒ»¸ö£¬±¾»úÕ¼ÁË1433£¬ÄÇôÐéÄâ»ú¾Íû·¨ÓÃÁË£¬Ïëµ½¾Í×ö£¬°ÑÐéÄâ»úµÄ¶Ë¿Ú¸Ä³ÉÁË1500¡£ÖØÆôµçÄÔ£¬µ«ÊÇ»¹ÊDz»Ä ......
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 ......
´æ´¢¹ý³Ì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 ......
public sealed class DbOper
{
///<summary>
/// DbOperÀàµÄ¹¹Ô캯Êý
///</summary>
private DbOper()
{
}
......