How to load entire database into memory? I want to load my entire database into memory, but how can I do this? I have about 256 GB memory and my database is about 200 GB, so I can easily handle in memory.

When I do select count(*) from table1 sqlserver automatically load table into memory and after this I'm able to use table very fast, but I want to know how can I load my entire database into memory?

If I do select count(*) from on each table I'm able to work faster but is there any other way to load entire database to memory? I want to load the entire database by a single command, not select count(*) from table by table.
I want to load my entire database into memory, but how can I do this?  


Before figuring out "how" to do something, it is often best to be clear on "why" that something should be done. So, why exactly do you want to load your entire database into memory? Memory is a finite resource, so it needs to be used efficiently / wisely.


  I have about 256 GB memory and my database is about 200 GB, so I can easily handle in memory


Ok, so you appear to have 56 GB of RAM beyond the size of the database. But here is what is not being considered outside of the data itself:


Unless your company goes out of business, databases grow, even if you archive off older data. 56 GB will soon not be enough, right?
Memory is needed by the OS (Windows plus the related services such as Scheduled Tasks, etc)
Memory is needed by 3rd party software (monitoring, anti-virus maybe, etc)
Memory is needed to run the database engine process (the MSSQLSERVER or InstanceName NT Service)
Memory is needed to run the SQL Server Agent process
Each Connection / Session requires some amount of memory
Memory is needed for queries (look at the "memory grant" of a query plan):


aggregate operations
computations
sorting
etc

When objects call other objects, SQL Server maintains a call stack of each parent context so that control can revert back to that parent context when the current context completes. This call stack is managed in memory.
Query Plan cache
DMV stats / info
Result sets (or at least the pointers to the position within each Result Set that each process is currently at)
etc
etc


Now, regarding that 200 GB of data, you should consider this: Do you use all 200 GB of that data? I highly doubt it. Loading data pages into memory and not referencing them is inefficient and wasteful. You are far better off loading pages on demand because the disk I/O used to get them and the memory taken up by them will be worth both of those resources since you aren't wasting them on pages that nobody wanted anyway.


  I want to load entire database by single command not SELECT * table by table.


No, there is no single command to do this.

Also, the SELECT COUNT(*) method doesn't even accomplish this goal. All it does is load, via a Scan, the smallest object it can find, which might be a NonClustered Index, or it might actually be the base table itself.  But it doesn't load:


any indexes into memory (if scanning the Table) or the Table itself into memory (if scanning an Index), nor any objects that weren't scanned for the COUNT(*) operation. So you would still need to find a way to force an Index Scan for all Non-Clustered Indexes and/or a Table/Clustered Index Scan if a NonClustered Index was used for the COUNT(*) operation. But that would be even more wasteful because not only are they not always being used, but loading them each time would work against your ability to use the index DMVs to determine which indexes are, in fact, not being used!
any off-row LOB data pages (and probably not Overflow pages). You would need to select any LOB columns separately, and any variable-length columns that have Overflow data.