Execute the BCP command today, and put the query results into an Excel file locally.
Command:
EXEC master.. Arbitrary N ‘BCP “SELECT” database ID’, ‘ ‘the name of the database “, “object ID”‘, ‘ ‘the name of the table “, “query”‘, ‘total consumption of CPU time (ms)’, ‘execution times’,’ ‘the average consumption of CPU time (ms)’, ‘ ‘ ‘ ‘the last execution time,’ minimum execution time (ms)] ‘, ‘ ‘maximum execution time (ms)’ UNION ALL SELECT CAST (dbid AS NVARCHAR(100)),dbname,CAST(ObjectId AS NVARCHAR(100)) ,ObjectName ,SelectStatement ,CAST(total_worker_time AS NVARCHAR(100)) , CAST(execution_count AS NVARCHAR(100)) ,CAST( avg_elasped_time AS NVARCHAR(100)) ,CAST( last_execution_time AS NVARCHAR(100)),CAST(min_worker_time AS NVARCHAR(100)) ,CAST( max_worker_time AS NVARCHAR(100)) FROM db.dbo.bdd_temp_find_top_select_cpu “queryout e: top_select_cpu.txt-c-s “10.0.8.102\sqlinstance” -t ‘
Error:
What went wrong:
You may not have the path or you may not have write permission for the path.
Solution: Change to a path with permissions or grant the corresponding permissions.
I chose to switch to a path with permission:
EXEC master.. Arbitrary N ‘BCP “SELECT” database ID’, ‘ ‘the name of the database “, “object ID”‘, ‘ ‘the name of the table “, “query”‘, ‘total consumption of CPU time (ms)’, ‘execution times’,’ ‘the average consumption of CPU time (ms)’, ‘ ‘ ‘ ‘the last execution time,’ minimum execution time (ms)] ‘, ‘ ‘maximum execution time (ms)’ UNION ALL SELECT CAST (dbid AS NVARCHAR(100)),dbname,CAST(ObjectId AS NVARCHAR(100)) ,ObjectName ,SelectStatement ,CAST(total_worker_time AS NVARCHAR(100)) , CAST(execution_count AS NVARCHAR(100)) ,CAST( avg_elasped_time AS NVARCHAR(100)) ,CAST( last_execution_time AS NVARCHAR(100)),CAST(min_worker_time AS NVARCHAR(100)) ,CAST( max_worker_time AS NVARCHAR(100)) FROM db.dbo.bdd_temp_find_top_select_cpu “queryout \\10.0.9.177\software\ top_select_cpu.txt-c-s “10.0.8.102\sqlinstance” -t ‘
Command:
EXEC master.. Arbitrary N ‘BCP “SELECT” database ID’, ‘ ‘the name of the database “, “object ID”‘, ‘ ‘the name of the table “, “query”‘, ‘total consumption of CPU time (ms)’, ‘execution times’,’ ‘the average consumption of CPU time (ms)’, ‘ ‘ ‘ ‘the last execution time,’ minimum execution time (ms)] ‘, ‘ ‘maximum execution time (ms)’ UNION ALL SELECT CAST (dbid AS NVARCHAR(100)),dbname,CAST(ObjectId AS NVARCHAR(100)) ,ObjectName ,SelectStatement ,CAST(total_worker_time AS NVARCHAR(100)) , CAST(execution_count AS NVARCHAR(100)) ,CAST( avg_elasped_time AS NVARCHAR(100)) ,CAST( last_execution_time AS NVARCHAR(100)),CAST(min_worker_time AS NVARCHAR(100)) ,CAST( max_worker_time AS NVARCHAR(100)) FROM db.dbo.bdd_temp_find_top_select_cpu “queryout e: top_select_cpu.txt-c-s “10.0.8.102\sqlinstance” -t ‘
Error:
What went wrong:
You may not have the path or you may not have write permission for the path.
Solution: Change to a path with permissions or grant the corresponding permissions.
I chose to switch to a path with permission:
EXEC master.. Arbitrary N ‘BCP “SELECT” database ID’, ‘ ‘the name of the database “, “object ID”‘, ‘ ‘the name of the table “, “query”‘, ‘total consumption of CPU time (ms)’, ‘execution times’,’ ‘the average consumption of CPU time (ms)’, ‘ ‘ ‘ ‘the last execution time,’ minimum execution time (ms)] ‘, ‘ ‘maximum execution time (ms)’ UNION ALL SELECT CAST (dbid AS NVARCHAR(100)),dbname,CAST(ObjectId AS NVARCHAR(100)) ,ObjectName ,SelectStatement ,CAST(total_worker_time AS NVARCHAR(100)) , CAST(execution_count AS NVARCHAR(100)) ,CAST( avg_elasped_time AS NVARCHAR(100)) ,CAST( last_execution_time AS NVARCHAR(100)),CAST(min_worker_time AS NVARCHAR(100)) ,CAST( max_worker_time AS NVARCHAR(100)) FROM db.dbo.bdd_temp_find_top_select_cpu “queryout \\10.0.9.177\software\ top_select_cpu.txt-c-s “10.0.8.102\sqlinstance” -t ‘
Read More:
- Error in header file when calling OpenGL to open obj file in vs2013: unable to open include file: “GL / glut. H”: no such file or directories
- Solution of vs unable to open source file and link library file
- How to solve the problem of “unable to open include file:” graphics. H “: no such file or directory”
- Vs fatal error C1083: unable to open include file: “sys / socket. H”: no such file
- Unable to open source file in vs
- Vs2019 OpenGL glut: error: unable to open include file: ‘GL / glut. H’: no such file or directory
- IntelliSense: unable to open source file ‘StdAfx. H’
- Error: unable to open include file: ‘GL / glut. H’
- Solution to the problem of vs2017 error report unable to open source file
- Panda was unable to open the. Xlsx file, xlrd.biffh.XLRDError : Excel xlsx file; not supported
- IntelliSense in VC + + 2010: unable to open source file “StdAfx. H”
- Solution of VS2008 unable to open GL / glaux. H header file
- Solution of unable to open source file “StdAfx. H” in vs2013 / 2012
- Vscode cnpm: unable to load file, but open console with CMD without error
- Vs error prompt: “unable to open source file XXXX. H” possible reasons and Solutions
- A fatal error C1083 occurred when compiling C + + code under. Net: unable to open the include file: “xuhk”_ Jnihelloworld. H “: solution to no such file or directory error.
- How to solve the problem of “unable to open source file XXXXX. H” in VS development?
- QT creator error: C1083: unable to open include file: “qmediaplayer”
- VMware virtual machine prompt: locking file failed, unable to open the disk solution
- Unable to open the physical file “d:\***.mdf”. Operating system error 5: “5(Access is denied.)”.