![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-02 12:50 |
共 48,038 主题排行 / 350,123 发帖 / 今日 1 篇 / 48,251 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » 可否用批处理对SQL数据库进行安装和操作? |
| 可打印版本 7,703 / 8 |
| 第1楼 maya0su | 发表于 2006-11-19 08:08 |
| 中级用户 发帖 131 积分 241 | |
|
可否用批处理对SQL数据库进行安装和操作? 1.有二个数据库文件1.mdb 和 2.mdb
请问如何用批处理把这二个文件导入到MSSQL里? 2.能否在批处理里对MSSQL的表进行操作? 对MSSQL不熟悉,故问此问题.... |
|
| 第2楼 chenall | 发表于 2006-11-19 10:59 |
| 银牌会员 发帖 469 积分 1,276 来自 福建泉州 | |
|
记得好像有一个命令行的ODBC程序,可以在命令行调用ODBC组件,可以找找看.
|
|
| 第3楼 maya0su | 发表于 2006-11-20 09:29 |
| 中级用户 发帖 131 积分 241 | |
|
找了,不行的....是个32位的界面数据源管理!
不能在命令行里运行.... 还有人能回答吗? |
|
| 第4楼 3742668 | 发表于 2006-11-20 13:41 |
| 荣誉版主 发帖 718 积分 2,013 | |
|
建议用bat+vbs来完成吧。
只要创建adodb.connection对象,使用 "Provider=SQLOLE DB; Data Source=FENG-F64129027D; User ID=sa;Password=; Initial Catalog=数据名"来连接就可以了。 由于只做过mdb和xls以及xml之间的转换,没有接触过sql,所以无法给出具体的代码了。 |
|
| 第5楼 maya0su | 发表于 2006-11-26 09:25 |
| 中级用户 发帖 131 积分 241 | |
|
首先谢谢版主
我找到了可以使用的命令行程序如下 C:\Program Files\Microsoft SQL Server\80\Tools\Binn 的目录 uncol.exe odbccmpt.exe cdw.exe itwiz.exe wiztrace.exe profiler.exe isqlw.exe dtsrun.exe sqlftwiz.exe dcomscm.exe osql.exe bcp.exe isql.exe dtswiz.exe sqlmangr.exe scm.exe rebuildm.exe cnfgsvr.exe svrnetcn.exe dtsrunui.exe(=dtsrun.exe) sqladhlp.exe 21 个文件 2,299,448 字节 0 个目录 8,476,901,376 可用字节 ================================================== Usage: odbccmpt <name of the executable file> Only one option per ODBCCMPT execution allowed. Examples how to enter compatibility flag: odbccmpt APPLICATIONX /T odbccmpt APPLICATIONX /v:6 Example to remove compatibility flag: odbccmpt APPLICATIONX /T /d ================================================== 用法: itwiz -D 数据库-名称 {-i workload-file | -t workload-table-name} -o 脚本-文件名 ================================================== 用法: dtsrun /option ] ... Options(“/?”将显示该屏幕;可以用“-”代替“/”): 包检索: /~S 服务器名称 /~U 用户名 /~P 密码 /E <使用信任连接,不使用 /U /P> /~N 包名称 /~M 包密码 /~G 包 Guid 字符串 /~V 包版本 Guid 字符串 /~F 结构化存储 UNC 文件名(如果还指定了 /S,则将被重写) /~R 知识库数据库名称 <若空白则使用默认值;从知识库数据库中装载包> 包操作(替代存储包设置): /~A 全局变量名: typeid=值 <可以引用整个字符串(包括名称: typeid)> /~L 日志文件名 /~W 将完成状态写入 Windows 事件日志 <True 或 False> DTSRun 操作(默认情况为执行包): /!X <不要执行;将包检索到 /F 文件名> /!D <不要执行;从 SQL Server 中除去包(无法从存储文件中除去)> /!Y <不要执行;输出加密命令行> /!C <将命令行复制到 Windows 剪贴板上(可以与 /!Y 和 /!X 一起使用)> 注意: ~ 是可选的;如果出现,参数就是由加密值组成的十六进制文本 (0x313233...) 命令开关和值之间的空白区域是可选的 在各个值之间嵌入的空白区域必须嵌入双引号中 如果一个选项被多次指定,则以最后一次为准(除非是多次指定 /A) ================================================== sqlfwiz.exe n=使用windows身份验证 s=服务器名称 u=用户名 p=密码 d=数据库名称 ================================================== 用法: osql disable commands ] <EOF> 批处理 控制台宽度自动调整 宽消息 默认错误级别为 — 1 对 1 ==================================================用法: bcp {dbtable | query} {in | out | queryout | format} datafile ==================================================isql: unknown option ? usage: isql <EOF> batch processing Auto console width scaling Wide messages default errorlevel is -1 vs 1 ==================================================sqladhlp -i to install the service with optional decimal Locale ID, default 1033 sqladhlp -r to remove the service ============================================ |
|
| 第6楼 maya0su | 发表于 2006-11-26 09:26 |
| 中级用户 发帖 131 积分 241 | |
|
distrib.exe 用法
[-PacketSize <..>] [-PollingInterval <..>] [-MessageInterval <..>] [-Continuous ] [-Output <..>] [-OutputVerboseLevel <0|1|2>] [-LoginTimeout <..>] [-QueryTimeout <..>] [-DefinitionFile <..>] [-AlignFixup ] ================================================== logread.exe 用法 [-KeepAliveMessageInterval <..>] -Publisher <..> -PublisherDB <..> [-PublisherSecurityMode <0|1>] [-PublisherLogin <..> ] [-PublisherPassword <..> ] [-Distributor <..> ] [-DistributorSecurityMode <0|1>] [-DistributorLogin <..> ] [-DistributorPassword <..> ] [-Buffers <..> ] [-SyncLogging] [-HistoryVerboseLevel <0|1|2> ] [-PacketSize <..>] [-ReadBatchSize <..>] [-ReadBatchThreshold <..> ] [-MaxCmdsInTran <..>] [-PollingInterval <..>] [-MessageInterval <..>] [-Continuous ] [-Output <..>] [-OutputVerboseLevel <0|1|2>] [-LoginTimeout <..>] [-QueryTimeout <..>] [-DefinitionFile <..>] [-AlignFixup ] ================================================== replmerg.exe 用法 (-Publisher <..>) | (-PublisherNetwork <..> -PublisherAddress <..>) -PublisherDB <..> -Subscriber <..> -SubscriberDB <..> -Publication <..> [-Hostname <..>] [-PollingInterval <in seconds>] [-ValidateInterval <in minutes>] [-SubscriptionType <0|1|2>] [-SubscriberConflictClean <0|1>] [-PublisherSecurityMode <0|1>] [-PublisherLogin <..>] [-PublisherPassword <..>] [-SubscriberSecurityMode <0|1>] [-SubscriberLogin <..>] [(-SubscriberPassword | -SubscriberEncryptedPassword) <..>] [-SubscriberType <0|1|2|3|4|5|6|7|8>] [-Validate <0|1|2|3>] [-FastRowCount <0|1>] [-HistoryVerboseLevel <0|1|2|3>] [-ProfileName <..>] [-MaxBcpThreads <..>] [-UseInprocLoader] [-InteractiveResolution <0|1>] [-KeepAliveMessageInterval <..>] [-PollingInterval <..>] [-StartQueueTimeout <..>] [-SrcThreads <..>] [-DestThreads <..>] [-ForceConvergenceLevel <0|1|(2 (Publisher|Subscriber|Both))] [-MetadataRetentionCleanup <0|1>] [-InputMessageFile <..>] [-InputMessageFromPublisher <0|1>] [-OutputMessageFile <..>] [(-Distributor <..>) | (-DistributorNetwork <..> -DistributorAddress <..>]) [-DistributorSecurityMode <0|1>] [-DistributorLogin <..>] [(-DistributorPassword | -DistributorEncryptedPassword) <..>] [-MaxDownloadChanges <..>] [-MaxUploadChanges <..>] [-UploadGenerationsPerBatch <..>] [-DownloadGenerationsPerBatch <..>] [-UploadReadChangesPerBatch <..>] [-DownloadReadChangesPerBatch <..>] [-UploadWriteChangesPerBatch <..>] [-DownloadWriteChangesPerBatch <..>] [-SubscriberDBAddOption 0|1|2|3] [-SubscriberDatabasePath <..>] [-FileTransferType <0|1>] [-FtpAddress <..>] [-FtpPort <..>] [-FtpUserName <..>] [-FtpPassword <..>] [-ExchangeType <1|2|3>] [-AltSnapshotFolder <..>] [-SyncToAlternate <0|1>] [-DynamicSnapshotLocation <..>] [-Continuous ] [-Output <..>] [-OutputVerboseLevel <0|1|2>] [-LoginTimeout <..>] [-QueryTimeout <..>] [-DefinitionFile <..>] [-AlignFixup ] ================================================== snapshot -Publisher <..> -PublisherDB <..> -Publication <..> [-ReplicationType <1|2> ] [-Distributor <..> ] [-DistributorSecurityMode <0|1>] [-DistributorLogin <..> ] [-DistributorPassword <..> ] [-PublisherSecurityMode <0|1>] [-PublisherLogin <..> ] [-PublisherPassword <..> ] [-MaxBcpThreads <..> ] [-BcpBatchSize <..> ] [-HistoryVerboseLevel <0|1|2|3> ] [-RowDelimiter <..> ] [-FieldDelimiter <..> ] [-70Subscribers ] [-ProfileName ] Merge Replication Dynamic Snapshot Parameters: [-DynamicFilterLogin <..> ] [-DynamicFilterHostName <..> ] [-DynamicSnapshotLocation <..> ] [-StartQueueTimeout <..> ] [-UsePerArticleContentsView <..> ] [-Continuous ] [-Output <..>] [-OutputVerboseLevel <0|1|2>] [-LoginTimeout <..>] [-QueryTimeout <..>] [-DefinitionFile <..>] [-AlignFixup ] ================================================== Usage: sqldumper [ProcessID [ThreadId [Flags[:MinidumpOverrideFlags] [SqlInfoPtr [DumpDir [ExceptionRecordPtr [ContextPtr]]]]]]] [-filtered <filtered dump init parameters>] |
|
| 第7楼 maya0su | 发表于 2006-11-26 09:27 |
| 中级用户 发帖 131 积分 241 | |
|
可否用批处理对SQL数据库进行安装和操作? 可否用批处理对SQL数据库进行安装和操作?
附件 scm.jpg (66.03 KiB) |
|
| 第8楼 maya0su | 发表于 2006-11-26 09:28 |
| 中级用户 发帖 131 积分 241 | |
|
以上为操作SQL的命令行工具,具体方法研究中
希望有更多的朋友,参加讨论! |
|
| 第9楼 electronixtar | 发表于 2006-11-27 01:13 |
| 铂金会员 发帖 2,672 积分 7,493 | |
|
如果没记错的话,用 isql 和 osql 可以,当初学习 SQL 的时候碰到过
[ Last edited by electronixtar on 2006-11-27 at 01:14 AM ] |
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |