If you want to import data only through a T-SQL query, then use the
function. To repeatedly get data from another server, create a linked server and then use the
function or use 4-part naming. If you are not using T-SQL, then
it is better to use the import/export wizard, and you can save it as a SSIS package for future use .