Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mpolaiah
Starting Member
24 Posts |
Posted - 2009-08-05 : 23:55:22
|
Hi All,i am execute the commanddeclare @SQLCmd varchar(500),@FilePath varchar(200),@nRequestid varchar(100)set @nRequestid=186--set @DBName='SMS'--set @TableName='AH_PRE_REQUEST_DETAILS'set @FilePath='F:\polo\'+@nRequestid+'.txt'--set @Separator='#'SET @SQLCmd ='sqlcmd -d SMS -Q "set nocount on;Select * From AH_PRE_REQUEST_DETAILS where nrequestid='+@nRequestid +'" -o"' + @FilePath + '" -W -s "' + '#' + '" -h -1' EXEC master..xp_cmdshell @SQLCmdit get the output once agani i run the same commanddeclare @SQLCmd varchar(500),@FilePath varchar(200),@nRequestid varchar(100)set @nRequestid=186--set @DBName='SMS'--set @TableName='AH_PRE_REQUEST_DETAILS'set @FilePath='F:\polo\'+@nRequestid+'.txt'--set @Separator='#'SET @SQLCmd ='sqlcmd -d SMS -Q "set nocount on;Select * From AH_PRE_REQUEST_DETAILS where nrequestid='+@nRequestid +'" -o"' + @FilePath + '" -W -s "' + '#' + '" -h -1' EXEC master..xp_cmdshell @SQLCmdi am get anothe outputHow to replace these two outputs at a one text fileit is possibleplase help meeeee........................ |
|
|
|
|