Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 File names with rowcounts using dos command in sql

Author  Topic 

Jampandu
Starting Member

12 Posts

Posted - 2015-03-26 : 22:24:59
Hi Experts

I have below requirement and it needs to be addressed using sql.

There are 18 text files(file names are dynamic) and each file having different row counts in some “xyz” folder.
Here, I need to generate 19th text file which has the list of file names with row counts.

I am planning to import all of the text files into database and trying to generate 19th one.
Please let me know , if is there any alternative ways ..

Thanks in advance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-03-27 : 05:39:32
Importing the data is a waste of time if all you need is the row count. Use Powershell instead. Here's how to get the row counts: http://stackoverflow.com/questions/6855814/powershell-how-to-count-number-of-rows-in-csv-file

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -