TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
David Smith
NA
2k
0
BCP Error
Mar 27 2012 10:44 PM
Can someone tell me what i am doing wrong, I am getting error saying cannot use the output option when passing a constant to a stored procedure
// open source connection
using (SqlConnection c = new SqlConnection(conn))
{
c.Open();
using (SqlCommand cmd = c.CreateCommand())
{
//cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "exec master..xp_cmdshell bcp 'Select * FROM TOW_ESS_SQL.dbo.PDEL' queryout 'C:\\Test' -c -t; -T -SZTURA054052 ";
cmd.ExecuteNonQuery();
return true;
}
}
----------------------------------------------------------
below this work on my computer if I run the batch file but on other computers, it does not run for some reason, the command window pops up and then leaves. I am not for sure why.
Reply
Answers (
0
)
How to make query using sqlserver
how to get max two salary and lowest two salary