RSS
magnify
Home Archive for category "MSSQL"
formats

SQL to Append all Fields if Shorter than a set Length

Published on July 12, 2012 by in MSSQL, mysql

This came in very handy for me at one point because I needed to have a certain field in each row 14 characters long, but half of them were only 12 characters long. In MySQL: UPDATE `table` SET `field` = CONCAT(`field`, ‘1’) WHERE LEN(`field`) = 13; In MSSQL: UPDATE `table` SET `field` = CONCAT(`field`, ‘1’)

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

LEN in MySQL

Published on February 1, 2012 by in MSSQL, mysql

In MySQL 5.1 LEN is called LENGTH, you use it exactly the same and pass in the link, so: LENGTH(link).

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
1 Comment  comments 
formats

SELECT Duplicate Items Using SQL

Published on December 20, 2011 by in MSSQL, mysql, sql

If you have a table which has duplicate items in then you can use the below statement to select them. SELECT * FROM tableName GROUP BY columnName HAVING ( COUNT( columnName) >1 )

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

MSSQL Select Not Null

Published on September 2, 2010 by in Microsoft, MSSQL

I mainly use MySQL these days, so get screwed over for a few minutes when I have to do something in MSSQL that is slightly different when it comes to it’s custom syntax. If you want to show all entries in a specific column and where it is not Null then you can do the

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
1 Comment  comments 
formats

ODBC SQL Server Memory General Network Error

Published on August 9, 2010 by in error, MSSQL

Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’ [Microsoft][ODBC SQL Server Driver][Shared Memory]General network error. Check your network documentation. /site/path/to/script/aspfile.asp, line # ..and that’s what it throws you! At about this point you may want to scream, or just be a tad annoyed by that damn machine running your site. Basically your server is

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
© Copyright © 2012 · Web Development London UK · All rights reserved · Site hosted on the hsmoore.com network
By using the site and/or making use of any of our services you agree to our Terms and Conditions