I'm having a huge database over 100GBs and I need to burn an application (for demonstration purposes) on CD or DVD which uses this huge database... is there a way how to leave for example only first 100 records IN ALL TABLES ?
Thanks in advance.
Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.
I sometimes have to do something similar, usually when I take a production database into dev or test.
In most cases, I try to identify if there is a few tables that take up almost all of the space - that is usually the case.
Run this script:
I did not write it myself, but have it in a textfile, and I ashamed I no longer remember what source to credit... You can do the same thing in Management Studio btw (add a "Size" column to details view).
Now you know what tables take up the most space, and can deal with them indivdually.
EDIT: Found source: http://www.howtogeek.com/howto/database/determine-size-of-a-table-in-sql-server/
Create copy of database and copy necessary data to it using constructions like:
exec sp_MSforeachtable 'SELECT TOP 100 * INTO [newdb].[?] FROM [olddb].[?]';