35mm f.1.8 lens should be ok for doing nightclub photography with?

I will be using it on a Nikon d40

This would be better:
http://www.amazon.co.uk/...00DBL09FG/

Dollar for dollar zooms will always be inferior to fixed focal lengths.
If you spent the price of the SIGMA on a 35mm f1.8 lens - $1000 US, it would be better than the Sigma Zoom.
A 35mm f1.8 is a very good selection.
A f1.4 or 1.2 would be better, but much more money.
Most beginners do not know how to properly use 18mm to 24mm, so is not recommended for a beginner. Wasted money.

You need a flash for nightclub photo

As chiaraye says, you will need flash.
Also, will you have permission to use a DSLR. You had better check that out first.