March 6, 2003

Do Not Use CreateThread() when Using C-Runtime Functions

When writing multithreaded applications in the Windows Environment, you have two options for creating new threads: the C-runtime function _beginthread (and _beginthreadex) or the WIN32 API CreateThread(). If the thread is using C-Runtime functions (strcat, fopen, etc), use the beginthread approach. If the thread is created with the WIN32 API

A Power Function for Integers

Need a quick and dirty way to exponentiate integers? Or perhaps you are working on a number library of your own. This will work in all cases. templateTYPE power(TYPE x, TYPE y) { if (y == 0) { // Identity return 1; } else if (y > 0) { //

Validating the Data Type in a T-SQL Query

Using the ISNUMERIC() and ISDATE() functions, you can check the required column’s data type validity. If the column passes the data type validity check, it will return a 1. If it fails, it will return a 0.Example: select * from MyTableCompanyID MyValue———– ——-1 201 101 401 AB(4 row(s) affected)select *