Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1241475
  • 博文数量: 510
  • 博客积分: 20296
  • 博客等级: 上将
  • 技术积分: 4680
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-30 03:58
文章存档

2011年(13)

2010年(92)

2009年(242)

2008年(163)

我的朋友

分类: 数据库开发技术

2011-09-10 13:04:02

       使用 sqlcmd 实用工具,可以在命令提示符处、在 SQLCMD 模式下的“查询编辑器”中、在 Windows 脚本文件中或者在 SQL Server 代理作业的操作系统 (Cmd.exe) 作业步骤中输入 Transact-SQL 语句、系统过程和脚本文件。此实用工具使用 OLE DB 执行 Transact-SQL 批处理。

语法
  1. sqlcmd 
  2. [{ { -U login_id [ -password ] } | –Etrusted connection }] 

  3. [ -N encrypt connection ][ -C trust the server certificate ]
  4. [ -znew password ] [ -Znew password and exit]
  5. [ -[protocol:]server[\instance_name][,port] ] [ -Hwksta_name ] [ -ddb_name ]
  6. [ -llogintime_out ] [ -A dedicated admin connection] 
  7. [ -iinput_file ] [ -ooutput_file ]
  8. [ -f< codepage> | i:< codepage > [ < , o: < codepage > ] ]
  9. [ -u unicode output] [ -[ 0 | 1 ] msgs to stderr ] 
  10. [ -R use client regional settings]
  11. [ -"cmdline query" ] [ -Q"cmdline query" and exit] 
  12. [ -eecho input ] [ -tquerytime_out ] 
  13. [ -Ienable Quoted Identifiers ] 
  14. [ -v var = "value"...] [ -xdisable variable substitution ]
  15. [ -hheaders ][ -scol_separator ] [ -wcolumn_width ] 
  16. [ -Wremove trailing spaces ]
  17. [ -[ 1 | 2 ] remove[replace] control characters ] 
  18. [ -ydisplay_width ] [-Ydisplay_width ]
  19. [ -on error batch abort] [ -Vseveritylevel ] [ -merror_level ] 
  20. [ -apacket_size ][ -ccmd_end ] 
  21. [ -[ c ] list servers[clean output] ] 
  22. [ -[ 1 ] print statistics[colon format]] 
  23. [ -[ 1 ] ] disable commands, startup script, enviroment variables [and exit] 
  24. [ -? show syntax summary]

本文来自MSDN,仅作个人学习查阅之用。
参考:
         
     
     
     


阅读(460) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~