sql ´æ´¢¹ý³Ì ¶¯Ì¬±í DateTimeÊý¾ÝÀàÐÍ Ìí¼ÓÎÊÌâ
ÎÒµÄÊý¾Ý¿âµÄ±íÊǶ¯Ì¬µÄ±í,ÔÚÌí¼ÓÊý¾ÝµÄʱºòÓÐÒ»¸ö×Ö¶ÎÊÇDATETIMEÊý¾ÝÀàÐ͵Ä,ÏÂÃæÊÇ´æ´¢¹ý³Ì
if exists (select * from sysobjects where name='proc_ADD_Order')
drop proc proc_ADD_Order
go
create procedure proc_ADD_Order
@memberID nvarchar(20),
@futuresClass nvarchar(4),
@orderWay nvarchar(10),
@orderSet char(1),
@orderCount int,
@orderPrice nvarchar(20),
@orderTime datetime,
@result char(1),
@penName nvarchar(40),
@txOrderClass nvarchar(10),
@contestID nvarchar(40),
@yyMM nvarchar(4)
as
declare @tablename nvarchar(15),@guid nvarchar(40) set @tablename = 'TxOrder'+@yyMM set @guid=newid()
exec(
'insert into '+@tablename+' ( [guid],[memberid],[futuresclass],[orderway],[orderset],[ordercount],[orderprice],[ordertime],[result],[penname],[txorderclass],[contestid]) values ( '''+@guid+''','''+@memberID+''','''+@futuresClass+''','''+@orderWay+''','''+@orderSet+''','+@orderCount+','+@orderPrice+'+0.00,'+@orderTime+','''+@result+''','''+@penName+''','''+@txOrderClass+''','''+@contestID+''' )'
)
go
ÏÂÃæÊÇÎҵIJâÊÔÊý¾Ý:
DECLARE @return_value int
EX
Ïà¹ØÎÊ´ð£º
create table [¿Í»§ÁªÏµ±í]([¿Í»§±àºÅ] varchar(2),[ÁªÏµÈÕÆÚ] datetime,[ÁªÏµÄÚÈÝ] int)
insert [¿Í»§ÁªÏµ±í]
select 'aa','2009/01/01',111 union all
select 'bb','2009/02 ......
listidÊÇintÊý¾Ý
declare @listid nvarchar(100)
set @listid='(1,2,3,7,9,10)'
select * from forums where listid in(@listid)ʱÌáʾÈçÏ´íÎó£º
ÔÚ½« nvarchar Öµ '(1,2,3,7,9,10)' × ......
ÄÄλ¸ßÊÖÌṩһ¸öSQlÓï¾ä£¬¿ØÖƱíÖÐÖ¸¶¨ÁеÄÖµ±ØÐëÊÇÕýÊý£¿
ÔÚ³ÌÐòÀïÃæÅжϲ»ºÃÂ𣿣¿
Äã¿ÉÒÔÔÚ½¨±íµÄʱºòÓÃcheckÔ¼Êø±íÖеĸÃ×Ö¶Îѽ£¡
È磺
create table tab_name£¨
name varchar2(20),
age numbe ......
²éѯ½á¹û¼¯£º
ps online totle
a 0 10
b 1 11
c 5 8
ÏëÏÔʾ³ÉÕâÑù ......