-
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...
Last edited by sqldeveloper; 03-16-2005 at 01:01 AM.
-
Tried specify sql server name and login info in bcp?
-
See if this works instead:
Exec Master..xp_cmdshell 'osql -Uuserid -Ppassword -Sservername -ddatabase -Q"DBCC CHECKDB" > "c:\Test.txt"'
-
Please post in the same thread when you need to reply to an existing post.
-
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.
-
Create a job with the followig step:
SET QUOTED_IDENTIFIER ON
DBCC CHECKDB
Select the advanced tab and fill in the output file section. When you run the job, the output will go to your file.
-
How do I add a Windows id as the userid on osql?
'osql -Uuserid -Ppassword -Sservername -ddatabase -Q"DBCC CHECKDB" > "c:\Test.txt"'
-
osql.exe -E -SServername -ddatabase -Q"DBCC CHECKDB" > c:\test.log
-
As demonstrated by Mak, the -E switch means to use a trusted connection a.k.a. the user's windows account.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|