-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1;
GO
-- To update the currently configured value for advanced options.
RECONFIGURE;
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1;
GO
-- To update the currently configured value for this feature.
RECONFIGURE;
execute xp_cmdshell 'bcp DBA.dbo.FDummy
out F:\Backup\.....\.txt -c -T '
go
execute xp_cmdshell 'bcp DBA.dbo.Cdummy
out F:\Backup\.....\.txt -c -T '
BULK INSERT t1
FROM 'F:\Backup\.....\.txt'
--location with filename
WITH
(
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n'
)
GO
BULK INSERT CRS_dummy
FROM 'F:\Backup\.....\.txt'
--location with filename
WITH
(
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n'
)
GO
No comments:
Post a Comment