January 18, 2011 at 2:16 pm
How can i export data from 10 different database to a single text file (ASCII) using bcp in which few columns has to be masked(***).
January 18, 2011 at 2:35 pm
Could you give some more detail.
I don't understand what you mean by " ...in which few columns has to be de identofied. ..."
January 18, 2011 at 2:41 pm
OK, Actually i was able to export data into text files by each table using import/exp[ort wizard but i would like to get data from 10 different databases inot a single file and i would also want to mask few columns as i have ot protect some sensitive data whille whne exportign to text.
January 18, 2011 at 6:45 pm
You could use the Export Wizrd, 1 for each database, then save them and run all 10 at once in a job. The first one creates (or truncates) the file, and the next 9 append to the existing file. You can "ignore" the columns you don't want.
Not the most glamorous solution, but should be simple to set up.
January 19, 2011 at 9:06 am
I understand using the export wizard but how can i mask few columns?
January 19, 2011 at 9:16 am
Please will you post some sample data showing what you have in your source tables, and what you want your target text file to look like.
Thanks
John
January 19, 2011 at 9:30 am
say for example if i have a column for "SSN" it should appear as
*** ** ***7
in the text file.
January 19, 2011 at 9:33 am
With that level of detail, I can't be more specific than to suggest you use the REPLACE function.
Also, have you considered using SSIS instead of bcp? You may find that it provides more flexibility.
John
January 19, 2011 at 9:38 am
Tara-1044200 (1/19/2011)
I understand using the export wizard but how can i mask few columns?
Sorry, I was thinking of "ignore" which will eliminate the column from the output completely. So if your table has 10 columns, only 9 would appear in your text file.
You could probably select "write a query ..." option and use REPLACE as John Mitchell suggested.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply