ich suche (siehe meine letzten Topics) nach einer Möglichkeit einem Trigger einen Anhang mit den Results anzuhängen. Jetzt bin ich auf dies hier gestoßen, was mir im ersten Schritt weiterhelfen könnte:
Code:
Here is a simple method of exporting all the data from SQL Server table to a Text File
CREATE Procedure BCP_Text_File
(
@table varchar(100),
@FileName varchar(100)
)
as
If exists(Select * from information_Schema.tables where table_name=@table)
Begin
Declare @str varchar(1000)
set @str='Exec Master..xp_Cmdshell ''bcp "Select * from '+db_name()+'..'+@table+'" queryout "'+@FileName+'" -c'''
Exec(@str)
end
else
Select 'The table '+@table+' does not exist in the database'
Execute this procedure by giving Table Name and the File Name
EXEC BCP_Text_File 'Employee','C:\emp.txt'
Now all the data from Employee table will be exported to the text file which will be located at C:\emp.txt
Ich kenn halt kein BCP, entsprechend kann ich relativ wenig damit anfangen... klar, ich kann englisch, aber kann mir jemand erklären, was ich wo ändern soll, damit dies funktioniert? Mir gehts da nicht um das was, sondern wo im Code... Bin da grad ein wenig planlos - kann allerdings auch am späten Freitag nachmittag liegen