r****r 发帖数: 2 | 1 declare @sqlcmd varchar(1024),
@product varchar(32)
select @procut = 'product'
select @sqlcmd = 'select * from ' +
quoatename(@product,'''')
exec(@sqlcmd)
that's it. |
|
s**********0 发帖数: 266 | 2 declare @sqlcmd varchar(8000)
set @sqlcmd = 'declare @col_1 int; set @col_1 = 3; print @col_1'
exec (@sqlcmd) |
|
i****a 发帖数: 36252 | 3 LS has the correct info.
you need to construct your @sqlcmd fully before you execute.
do "print @sqlcmd", copy the result and execute it in new window
doing:
can |
|
a*****e 发帖数: 1717 | 4 Here's python one I used before,
drawbacks:
1. data pacing violation, limit on size of each quote, interval etc.
2. futures symbols are less standardized
3. IB data sucks, but ok for median to long term backtest
4. the ibpy is out-dated, you have to update yourself to get new
features.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from ib.ext.Contract import Contract
from ib.opt import ibConnection, message
from time import sleep
from datetime import date
import pyodbc, os, sys
# print all mess... 阅读全帖 |
|
|
b********r 发帖数: 59 | 6 Or take a look at osql or sqlcmd (both are command line
utilities for SQL Server 2000/2005) for complicated queries |
|
b********r 发帖数: 59 | 7 Sorry, it works only in SQL Server.
For SQL Server 2k5 or 2k8, you can use sqlcmd to replace osql |
|
|
c*****d 发帖数: 6045 | 9 create file c:\demo.sql
declare @name1 char(20);
declare @name2 char(20);
set @name1='abc';
set @name2=CONVERT(VARCHAR(20),GETDATE(),112);
select @name1;
select @name2;
go
然后在dos下
sqlcmd -S your_server_ip -U user_name -P password -i c:\demo.sql -o c:\out_
20091106.txt |
|
g********e 发帖数: 9 | 10 客户需要我们每天9点送一个文件.写了一个很简单的store procedure.问题是怎样可以
每天早上自动运行这个store procedure,然后把结果存在一个delimited形式的文件里,
再把这个文件放到客户的ftp site?
用SQLCMD吗?怎么用?
请大牛指点.谢谢 |
|
u**d 发帖数: 211 | 11 用 sql server,有一个 Script,主要是 insert 之类的更新
我想在 sql server management studio 的窗口里执行文件里的
script,应该用什么命令?
网上搜了一下,sqlcmd osql 之类的都是在命令行执行
谢谢! |
|
y****9 发帖数: 144 | 12 New to SQL server ( just try to learn it as an Oracle DBA), did a test about
recovering a db, can someone tell me how to do a complete recovery in the
following case:
1. big_table reference point:
1> select max(id) from big_table;
2> go
-----------
2000000
2. Backup database testdata
3. insert several records into table big_table in the testdata database
1> select max(id) from big_table;
2> go
-----------
2000003
4. Shutdown the instance
5. delete the ... 阅读全帖 |
|
y****9 发帖数: 144 | 13
I was using SQLCMD in SQL Server 2008. |
|
j*******7 发帖数: 6300 | 14 提醒大家:osql这个工具一定不要再用了!!!它会把script中的non-ascii字符替换
成另外的字符,我们这儿出过事故。用sqlcmd,参数可以完全一样。 |
|
d******i 发帖数: 7160 | 15 我装过2005 express。
不过装完后没找到sqlcmd(你是说用这个console吧).
你用的哪个版? |
|