I've just been win a separate thread in which this question was effectively asked...
http://www.bay12forums.com/smf/index.php?topic=125466.0Browse that. I like my answer (obviously!), with the zig-zag up to the water's edge, the floodgate and the final fortification link... This requires that the block concerned be a stone one, not a soil-type.
However, at the surface (or where there's a handy place to stand, atop an underground cavern pool or even a magma-tube/lake) a channelling last-block connection can be made, as KroganElite sort of describes... But in case those diagrams aren't understandable, here's my versions of what I think has just been said...
Bank River (side-on view)
________
########≈≈≈≈≈
#############
__________
__mine->_#≈≈≈≈≈
###############
.- channel here
v
__________
_________#≈≈≈≈≈
###############
.- ramp remains after channelling, usually not a problem
v
_________
<-water≈≈▲≈≈≈≈≈
###############
.- but, if worried, construct a floor back over it to deny access
v
__________
<-water≈≈▲≈≈≈≈≈
###############
Caveats about water pressure and ensuring you have protection against flooding your fortress. Or emergency shut-offs for if/when it
does start flooding.
I suggest that, at the very least, before that channelling in from the above (or the fortification in from the side), you should install a floodgate at the adjacent bit of tunnel and link it to a lever, then open it at leisure knowing that you
might need to close it in a hurry. Practice makes perfect, of course.