This is something I'm very curious about! There's a strong meme that SQL is dynamically typed, but it is very much static. ("Compile time" is "prepare time", so it feels dynamic compared to host program compilation, but the vast majority of problems are caught before query execution, and with widespread, better tooling, could be caught at host program compile time too.)
Do you call it dynamic because of the delay in getting error feedback, because the RDBMS you use is genuinely loosey-goosey with types, or for another reason?
A good question. I think I consider “prepare time” not “compile time”, but “run time”, because it happens not at my will on my dev machine, but on demand on client’s machine or production server, and all the types will be inferred only when the program is run.
I suppose if you had good unit test coverage that would mitigate your particular problem, shifting the errors from production to your dev box. Not a solution to the static typing problem, of course.
For my part I use LINQ2SQL and the whole thing becomes statically typed.