https://www.sqlservercentral.com/forums/topic/xp_cmdshell-procedure-expects-parameter-command_string-of-type-varchar
Here are the contents of @Cmd (varchar(max)):
bcp "SELECT [Data] FROM myserver..dbo.PEC_Citrus_RptData where [Data]
is not null order by [Data]" queryout "C:\Documents and Settings\All
Users\Documents\Shared\OutputFile.txt" -c -t -T -S
"MYMACHINE\MYINSTANCE"
Here's the code:
EXEC master..xp_cmdshell @Cmd ;
Here is the error:
Msg 214, Level 16, State 201, Procedure xp_cmdshell, Line 1
Procedure expects parameter 'command_string' of type 'varchar'.
?
You can't use varchar(max) with xp_cmdshell. Found that out the hard
way. Try a finite number (I usually just go with either 1000 or 8000).
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2020
(96)
-
▼
June
(11)
- Error: "SQL Server blocked access to procedure 'sy...
- xp_cmdshell - Procedure expects parameter 'command...
- Enabling xp_cmdshell in SQL Server
- how can I Update top 100 records in sql server
- How to get all installed programs on your machine
- How to group mysql rows with same column value int...
- Insert into a MySQL table or update if exists
- MySql Query Replace NULL with Empty String in Select
- Flush Windows File Cache
- MariaDB Explain
- How To Delete Duplicate Rows in MySQL
-
▼
June
(11)
No comments:
Post a Comment
Note: only a member of this blog may post a comment.