Sep 2, 2005 #1 maswien Technical User Joined Sep 24, 2003 Messages 1,286 Location CA I want save the output of command xp_cmdshell '...' to a table, is this possible? something like: insert into myTable exec (xp_cmdshell '...' ) Is there any other way to get the output saved?
I want save the output of command xp_cmdshell '...' to a table, is this possible? something like: insert into myTable exec (xp_cmdshell '...' ) Is there any other way to get the output saved?
Sep 2, 2005 #2 MDXer Technical User Joined Oct 19, 2002 Messages 1,982 Location US nope not like that. You maybeable to pipe the output to a txt file and then bcp it in to you table. Depending on what you xp_cmdshell task does. Shoot Me! Shoot Me NOW!!! - Daffy Duck Upvote 0 Downvote
nope not like that. You maybeable to pipe the output to a txt file and then bcp it in to you table. Depending on what you xp_cmdshell task does. Shoot Me! Shoot Me NOW!!! - Daffy Duck
Sep 2, 2005 1 #3 mrdenny Programmer Joined May 27, 2002 Messages 11,595 MDX I hate to disagree, but you can totaly do what maswien asked. This works perfectly on one of my servers. Code: create table #Temp1 (output varchar(1000)) insert into #Temp1 exec xp_cmdshell 'dir c:\' select * from #Temp1 drop table #Temp1 Denny MCSA (2003) / MCDBA (SQL 2000) --Anything is possible. All it takes is a little research. (Me) http://www.mrdenny.com (Not quite so old any more.) Upvote 0 Downvote
MDX I hate to disagree, but you can totaly do what maswien asked. This works perfectly on one of my servers. Code: create table #Temp1 (output varchar(1000)) insert into #Temp1 exec xp_cmdshell 'dir c:\' select * from #Temp1 drop table #Temp1 Denny MCSA (2003) / MCDBA (SQL 2000) --Anything is possible. All it takes is a little research. (Me) http://www.mrdenny.com (Not quite so old any more.)
Sep 2, 2005 #4 MDXer Technical User Joined Oct 19, 2002 Messages 1,982 Location US Well I stand corrected. I have known people try other methods in the past that didn't work. Star for you Denny Shoot Me! Shoot Me NOW!!! - Daffy Duck Upvote 0 Downvote
Well I stand corrected. I have known people try other methods in the past that didn't work. Star for you Denny Shoot Me! Shoot Me NOW!!! - Daffy Duck
Sep 2, 2005 Thread starter #5 maswien Technical User Joined Sep 24, 2003 Messages 1,286 Location CA Thanks denny! I guess it's a very good tip for every DBA. Upvote 0 Downvote
Sep 4, 2005 #6 mrdenny Programmer Joined May 27, 2002 Messages 11,595 thanks guys Denny MCSA (2003) / MCDBA (SQL 2000) --Anything is possible. All it takes is a little research. (Me) http://www.mrdenny.com (Not quite so old any more.) Upvote 0 Downvote
thanks guys Denny MCSA (2003) / MCDBA (SQL 2000) --Anything is possible. All it takes is a little research. (Me) http://www.mrdenny.com (Not quite so old any more.)