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

MSSQLÈçºÎתΪORACLE

¸Õ¿ªÊ¼Ñ§Ï°´æ´¢¹ý³Ì£¬Ð´Á˸öMSSQLµÄ£¬²»Ì«ÊìϤORACLEµÄ¸ÃÔõôд¡£Ï£Íû¸÷λ´óÏÀ°ïæ
SQL code:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go





ALTER PROCEDURE [dbo].[proc_getTotal]--<getTotal, gjjktemp, getTotal>
-- Add the parameters for the stored procedure here

--declare
@tableNamed nvarchar(20),
@start nvarchar(20),
@end nvarchar(20),
@centerid varchar(20),
@stationid varchar(20),
@itemid int,
@itemcode varchar(20),
@a int output
AS
BEGIN
--set @tableNamed = 'R_Hour_Data'
--set @start = '2009-1-1 0:00:00'
--set @end = '2010-12-31 0:00:00'
--set @centerid = 86
--set @stationid = 6
--set @itemid = 12516
--set @itemcode = '1CV'
declare @countOne int
declare @countTwo int
declare @s nvarchar(4000)
declare @startyear nvarchar(4) --¿ªÊ¼Äê
declare @endyear nvarchar(4) --½áÊøÄê
declare @tableName nvarchar(40) --±íÃû
declare @colName nvarchar(40) --ÁÐÃû
set @startyear = substring(@start,1,5)
set @endyear = substring(@end,1,5)

SET NOCOUNT ON;
if @tableNamed is not null
begin
set @s='select @i=count(*) from '+@tableNamed+'_'+@startyear+' as a where a.StaticDate >= '''+@start+''' and a.StaticDate<= '''+@end+''' and a.centerid = '+@centerid+' and a.stationid = '+@statio


Ïà¹ØÎÊ´ð£º

vc²Ù×÷mssqlһСÎÊÌâ

ÏÖÔÚÁ¬µÄÒ»Ô¶³Ìmssql£¬Ã¿´Î²éѯ±È½ÏÂý£¬ÏÖÔÚÏëһϰÑËùÓмǼ²éѯ³öÀ´ÓÃÊý¾Ý¼¯±£´æÆðÀ´£¬È»ºóÕë¶ÔÊý¾Ý¼¯Ôٴβéѯɸѡ¡£
ÏÖÔÚÎÊÏÂÄǸöÊý¾Ý¼¯ÈçºÎ±£´æ²éѯ¼Ç¼£¬¶øÔٴβéѯ£¬¶àлÁË¡£
¿ÉÒÔ°ÑÊý¾Ý¼¯ÖеÄÊý¾Ý·Åµ½ÄÚ´ ......

MSSQL ת»» MYSQL

ÈçºÎ½«MSSQLÊý¾Ý¿âת»»ÎªMYSQL
ÔÚÍøÉÏÕÒÁ˺ܶà ˵µÄºÜÂÒ ÇëÎÊÓиßÊÖ¿ÉÒÔ½ÌÏÂÂð ллÁË
ûÓÐʲôºÃ°ì·¨¡£Á½ÕßÖ®¼ä»¹ÊÇÓÐЩ²îÒìµÄ¡£

Êý¾ÝÀàÐÍ£¬´æ´¢¹ý³ÌÓï·¨¡£

Èç¹ûÖ»ÊDZíºÍ¼Ç¼£¬Ôò¿ÉÒÔ°²×°Ò»¸öMYS ......

ÔÚMSSQLÖÐдһ¸ö´¥·¢Æ÷,¼±ÓÃ

±íµÄ½á¹¹ÈçÏ£º

±í1£ºtb_big
×ֶΣºfalseIDÖµ£º1£¬2£¬3
×ֶΣºbigtype Öµ£ºA£¬B£¬C£¨ÓëfalseIDµÄÖµµÄλÖÃÒ»Ò»¶ÔÓ¦£¬¼´1¶ÔÓ¦A£¬2¶ÔÓ¦B£©

±í2£ºtb_small
×ֶΣºfalseID£¨Óëtb_bigµÄfalseID ......

ÈçºÎÓÃasp²åÈëÊýÖµµ½ mssql Varbinary(16)×Ö¶Î

ÒѾ­¼ÜÉèºÃÁËÓÎÏ·£¬ÄÜÔËÐÐÁË£¡¡¾ÓÎÏ·²»ÊÇÎÒ×öµÄËùÒÔÀïÃæµÄÔ´ÂëʲôµÄ¶¼²»´óÇå³þ¡¿ÓÎϷʹÓõÄÊý¾Ý¿âÊÇMSSQLµÄ¡£
ÏëÓÃÍøվʵÏÖÔÚÍøÒ³ÖÐ×¢²áÕ˺ÅÀ´²åÈëµ½Ö¸¶¨µÄMSsqlÓû§±íÖÐ! ÒÔ±ã´ïµ½ÔÚÍøÕ¾×¢²áÁËÕ˺źóÄÜÔÚÓÎÏ·ÀïÃæ ......

mssql ÈçºÎ¼Èë 2008-1-1 ÕâÑùµÄʱ¼ä¸ñʽ

ÎÒÓÃ("insert into LM_info ([content],[date],[username]) values ('"&content&"',date(),'"&username&"')")
ÊÇ´íÎóµÄ¡£

µ«ÊÇÎÒÓÃgetdat ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ