i've tried Exec Master..xp_cmdshell 'bcp "DBCC CHECKDB" queryout "c:\Test.txt"'
Hi,
i Exected...
Exec Master..xp_cmdshell 'bcp "DBCC CHECKDB" queryout "c:\Test.txt"'
i've tried through this SQL script in Query Analyser but.
the Result is not storing in the Text file, and getting output this
---------------------------------------
Password:
NULL
Do you want to save this format information in a file? [Y/n]
Starting copy...
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]BCP host-files must contain at least one column
NULL
BCP copy out failed
NULL
----------------------------------------
Please help me, Successful Query.
Thanks <b>Nosepicker</b>
u r solutions is right...
Which u gave the Query...
Exec Master..xp_cmdshell 'osql -Uuserid -Ppassword -Sservername -ddatabase -Q"DBCC CHECKDB" > "c:\Test.txt"'
i've Executed, It's work's fine in the VB6,VB.Net,ASP.Net...
I've done project, i've facility to take Backup and Restore the Database...
Results of Database Integrety Check
When the results of your query is provided in the result window, simply click in the resulting pane and select FILE > Save As, and provide a name. The results will be saved.