sql - exporting by year and month from 100 tables -
i've been asked export data out of 100 tables.
for each table this:
select * table1 datepart(yyyy,table1.dos)=2011 , datepart(mm,table1.dos)=01
and then:
select * table1 datepart(yyyy,table1.dos)=2011 , datepart(mm,table1.dos)=02
etc...
i need every year , every month every table
i need export these data sets csv
can please give me guidance on how can automate instead of using import/export wizard manually?
dynamic sql sp_msforeachtable. here link info , examples:
Comments
Post a Comment