DEFINITIONS

Definitions More Info.
Definition ID113
TitleSQL
CategorySCRIPT
Definitionsqlde_dosya_olusturup_export_etme
Definition Descriptionuse Anka go declare @cmdstr1 as varchar(128) set @cmdstr1='sqlcmd -i D:\AboneKutuk\AboneKutuk.sql -o D:\AboneKutuk\AboneKutuk.log' EXEC master..xp_cmdshell @cmdstr1 use master DECLARE @TodayDate as varchar(40), @TodayHour as varchar(40), @TodayMinu as varchar(40), @NewFileName as varchar(100), @cmdstr as varchar(128) SELECT @TodayDate = CONVERT(varchar(10), GETDATE(), 112) SELECT @TodayHour = DATEPART(hh,GETDATE()) SELECT @TodayMinu = DATEPART(mi,GETDATE()) SELECT @NewFileName = 'operatorno'+'_'+'dtelekom' + '_' + @TodayDate + '' + @TodayHour + '' + @TodayMinu + '.txt' print @NewFileName --set @cmdstr='COPY /y e:\hede.txt \\213.243.1.228\cucu\'+@NewFileName print @cmdstr --Exec master.dbo.xp_cmdshell 'net use "\\213.243.1.228\cucu" /u:DOL\dbadmin anDBka09' EXEC master..xp_cmdshell @cmdstr --net use * /delete ------------------------------------------------------------------------------- use Bute go declare @cmdstr1 as varchar(128) set @cmdstr1='sqlcmd -i e:\sorgu.sql -o e:\sorgu.log -h-1'-- -h-1 ile header kismni disable ettim. --sorgu icinde de set nocount on ile de footer da donen sonuc kismini disable ettim EXEC master..xp_cmdshell @cmdstr1 --select * from Stok ------------------------------------------------------------------------------------------------------- --bu KOMUTLA LOCAL SERVER BAĞLANMASINI SAĞLAYARAK OUTPUT VERİYOR use master go declare @cmdstr1 as varchar(255) set @cmdstr1='sqlcmd -S ACSDB01\ACSDB01 -i D:\rebuildindex\rebuildindex.sql -o D:\rebuildindex\rebuildindex.log' --sorgu icinde de set nocount on ile de footer da donen sonuc kismini disable ettim EXEC master..xp_cmdshell @cmdstr1
RecordBycunay
Record Date20-02-2012 17:36:00
Düzenle
Kopyala
Sil