TSQL Email Validation (without regex)

Very basic would be: SELECT EmailAddress, CASE WHEN EmailAddress LIKE ‘%_@_%_.__%’ AND EmailAddress NOT LIKE ‘%[any obviously invalid characters]%’ THEN ‘Could be’ ELSE ‘Nope’ END Validates FROM Table This matches everything with an @ in the middle, preceded by at least one character, followed by at least two, a dot and at least two for … Read more

How to count total number of stored procedure and tables in SQL Server 2008

This will give you the count of tables and stored procedures. SELECT CASE TYPE WHEN ‘U’ THEN ‘User Defined Tables’ WHEN ‘S’ THEN ‘System Tables’ WHEN ‘IT’ THEN ‘Internal Tables’ WHEN ‘P’ THEN ‘Stored Procedures’ WHEN ‘PC’ THEN ‘CLR Stored Procedures’ WHEN ‘X’ THEN ‘Extended Stored Procedures’ END, COUNT(*) FROM SYS.OBJECTS WHERE TYPE IN (‘U’, … Read more

How to get only numeric column values?

SELECT column1 FROM table WHERE ISNUMERIC(column1) = 1 Note, as Damien_The_Unbeliever has pointed out, this will include any valid numeric type. To filter out columns containing non-digit characters (and empty strings), you could use SELECT column1 FROM table WHERE column1 not like ‘%[^0-9]%’ and column1 != ”

WSDL on SQL Server gives HTTP status 505 Version Not Supported

Today, years after I posted this question, we finally found the answer to this question. It was not a Squid proxy server as we had come to believe. We continued experiencing issues like this with various web services/sites. The last straw was when we finally needed to deploy an SVN server that was used by … Read more