T/SQL Splint String/Text

One common task performed in database applications is given a full name, how can this be split into the first name and last name.  In this article, three different methods are discussed to perform this task using three different functions in SQL Server.  It is assumed in this article that the full name is just made up of one first name and one last name. Using SUBSTRING Function The first method is the use of the SUBSTRING string function,…

Read More

T/SQL Generate Random Numbers

SQL Server has a built-in function that generates a random number, the RAND() mathematical function.  The RAND math function returns a random float value from 0 through 1.  It can take an optional seed parameter, which is an integer expression (tinyint, smallint or int) that gives the seed or start value. To use it, you can simply do a simple SELECT, as follows: SELECT RAND() AS The result generated by this SELECT statement is as follows (note that…

Read More

T-SQL Comma Delimited Output

One of the common tasks performed when retrieving data from a SQL Server database is returning the result as a comma-delimited output instead of a result set.  This task can be performed by using a CURSOR selecting the column to be concatenated together.  Each row returned by the CURSOR is then concatenated together into a variable separating each one by a comma. Here’s how the script will look like using the table in the Northwind database. A sample…

Read More

Built-in tools troubleshoot SQL Server memory usage

Dynamic management views Dynamic management views, first introduced with SQL Server 2005, provide information about server and database state. These views are useful for monitoring overall SQL Server health, identifying the root cause of SQL Server performance bottlenecks, and tuning SQL Server instance or database performance. The following is a list of dynamic management views available in SQL Server 20008R2, SQL Server 2012 and SQL Server 2014. You can use these views to obtain SQL Server memory usage information;…

Read More

MMC – Microsoft Management Console

Microsoft Management Console (MMC) hosts administrative tools that you can use to administer networks, computers, services, and other system components. Here is a short list. Certificates certmgr.msc Indexing Service ciadv.msc Computer Management compmgmt.msc Device Manager devmgmt.msc Disk Defragmenter dfrg.msc Disk Management diskmgmt.msc Event Viewer eventvwr.msc Shared Folders fsmgmt.msc Group Policy gpedit.msc Local Users and Groups lusrmgr.msc Removable Storage ntmsmgr.msc Removable Storage Operator Requests ntmsoprq.msc Performance perfmon.msc Resultant Set of Policy rsop.msc Local Security Settings secpol.msc Services services.msc Windows Management…

Read More

Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation ‘=’

Searching for answers to an identical “Illegal mix of collations” error with conflicts between utf8_unicode_ci and utf8_general_ci. I found that some columns in the database were not specifically collated utf8_unicode_ci. It seems mysql implicitly collated these columns utf8_general_ci. Specifically, running a ‘SHOW CREATE TABLE table1’ query outputted something like the following: | table1 | CREATE TABLE `table1` ( `id` int(11) NOT NULL, `col1` varchar(4) CHARACTER SET utf8 NOT NULL, `col2` int(11) NOT NULL, PRIMARY KEY (`photo_id`,`tag`) ) ENGINE=InnoDB DEFAULT…

Read More

Posted in MySQL Tagged Comments Off on Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation ‘=’
File or directory is corrupted or unreadable

If you share your portable media with multiple people and multiple OS and devices and from time to time you may end getting this error message when trying to access a folder or file. You cannot access nor your can delete them. Solution (try this): Click on Start –> Run –> Type cmd and press Enter. “Command Prompt” will be opened. Since you are having problem with G & H drivers, enter the below command chkdsk /f g: –>…

Read More