Category: SQL SERVER

MYSQL Articles, Errors and Fixes

SQL – How to ‘insert if not exists’ in MySQL

How to write INSERT IF NOT EXISTS queries in standard SQL If necessary, INSERT IF NOT EXISTS queries can be written in a single atomic statement, eliminating the need for a transaction, and without violating standards. In this article we explained several ways to write such queries in a platform-independent way. Several solutions: One solution […]

Tamp Table and table variable

SQL- What’s the difference between a temp table and table variable in SQL Server

Temporary Tables Temporary Tables are a great feature that lets you store and process intermediate results by using the same selection, update, and join capabilities that you can use with typical SQL Server tables. The temporary tables could be very useful in some cases to keep temporary data. Types There are mainly two types of Temporary Tables-Local & Global Temporary Tables. […]

MYSQL Articles, Errors and Fixes

[Solved-9 Answers] Which MySQL Datatype should be used for storing boolean values?

PROBLEM Since MySQL doesn’t seem to have any ‘boolean’ datatype, which datatype do we ‘abuse’ for storing true/false information in MySQL? Especially in the context of writing and reading from/to a PHP-Script. The several approaches are : tinyint, varchar fields containing the values 0/1, varchar fields containing the strings ‘0’/’1′ or ‘true’/’false’ And finally enum […]