这个我知道的我是写@tempdate,不是这个问题
解决方案 »
- 求助:驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“SQL Server 返回的响应不完整。连接已关闭。...
- 因为经常删除一些记录导致自增列不连续了,我想对自增列重新建一次,如何保证原来的先后次序不会变动呢?
- 如何强制SQL Server表中日期的时分秒无论是新插的还是更改的永远为全0?
- 先进来罗...
- sql 2000导入oracle 9i
- 高手请进,记录处理问题
- 怎么向含有自增长列的表中Insert一列?
- 如何防止插入重複的數據
- SQL取数问题
- 关于VC++ ADO连接sql sever数据库失败的问题
- 求一SQL函数。在线等待!!!
- 如何存取指定數目的數據
select @tempdate='2004-7-23 12:00:00'
,@tempdate1='20040723.txt'set @s='bcp "select * from sms..table_name where datediff(hour,rec_time,'''+@tempdate+''')>0 and datediff(hour,rec_time,'''+@tempdate+''')<=24 " queryout c:\ftptemp\cjtxt\xdcj'+@tempdate1+'.txt -c -S数据库名 -U用户名 -P密码'
EXEC master..xp_cmdshell @s
select @tempdate='2004-7-23 12:00:00'set @s='bcp "select * from sms..table_name where datediff(hour,rec_time,'''+@tempdate+''')>0 and datediff(hour,rec_time,'''+@tempdate+''')<=24 " queryout c:\ftptemp\cjtxt\xdcj'+convert(varchar,@tempdate,112)+'.txt -c -S数据库名 -U用户名 -P密码'
EXEC master..xp_cmdshell @s
select @tempdate='2004-7-23 12:00:00',@temps=convert(varchar,@tempdate,120)set @s='bcp "select * from sms..table_name where datediff(hour,rec_time,'''+@temps+''')>0 and datediff(hour,rec_time,'''
+@temps+''')<=24 " queryout c:\ftptemp\cjtxt\xdcj'+convert(varchar,@tempdate,112)+'.txt -c -S数据库名 -U用户名 -P密码'
EXEC master..xp_cmdshell @s