<p>What are some of the ways? What frameworks can you use?</p>

Well, I presume you mean unit testing your code that hits the database, in which case, there is
NDbUnit
, which appears to be a DbUnit clone for .NET.  I've never used it, but I have used DbUnit, and it is quite useful.
Edit: I assumed you were using .NET because you mentioned MSSQL.  If however you are actually using Java, there is
DbUnit
.