<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CammaBlog &#187; SQL</title>
	<atom:link href="http://www.camma.ch/category/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.camma.ch</link>
	<description>die Informationsschnippsel-Sammlung eines Streifzugs durch die Weiten des Webs</description>
	<lastBuildDate>Fri, 27 May 2011 04:36:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQL Replace</title>
		<link>http://www.camma.ch/2010/11/17/sql-replace/</link>
		<comments>http://www.camma.ch/2010/11/17/sql-replace/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 07:50:27 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=1774</guid>
		<description><![CDATA[Muss man in einer Datenbank einen String ersetzen, kann dies einfach mit einem REPLACE Statement erledigt werden. REPLACE sucht nach einer bestimmten Zeichenfolge eines Strings und ersetzt diesen mit einer anderen Zeichenfolge. Somit ergibt dieses Statement: SELECT REPLACE&#40;'Camma Rocks!', 'Rocks', 'Rolls'&#41; gibt folgendes zur&#252;ck Camma Rolls! REPLACE sucht im ersten String nach einer &#220;bereinstimmung mit [...]]]></description>
			<content:encoded><![CDATA[<p>Muss man in einer Datenbank einen String ersetzen, kann dies einfach mit einem REPLACE Statement erledigt werden.</p>
<p>REPLACE sucht nach einer bestimmten Zeichenfolge eines Strings und ersetzt diesen mit einer anderen Zeichenfolge. Somit ergibt dieses Statement:</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Camma Rocks!'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Rocks'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Rolls'</span><span style="color: #66cc66;">&#41;</span></div></div>
<p>gibt folgendes zur&#252;ck</p>
<pre style="color: red">Camma Rolls!</pre>
<p>REPLACE sucht im ersten String nach einer &#220;bereinstimmung mit dem zweiten String und ersetzt diese mit dem dritten String. Die Stringl&#228;nge des alten und des neuen Strings m&#252;ssen nicht &#252;bereinstimmen. Beispiel:</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Camma Rocks!'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Rocks'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'is cool'</span><span style="color: #66cc66;">&#41;</span></div></div>
<p>ergibt:</p>
<pre style="color: red">Camma is cool!</pre>
<p>Hier wurde ein 5 Zeichen String mit einem 7 Zeichen String ersetzt. Wenn der String nicht gefunden wird, werden keine &#196;nderungen vorgenommen:</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Camma Rocks!'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Milch'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Zucker'</span><span style="color: #66cc66;">&#41;</span></div></div>
<p>gibt genau das zur&#252;ck was vorher schon da war:</p>
<pre style="color: red">Camma Rocks!</pre>
<p>Replace kann auch in Update-Statements genutzt werden.</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">UPDATE</span> adressen <br />
<span style="color: #993333; font-weight: bold;">SET</span> ortschaft <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>ortschaft<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Moritz, '</span>St Moritz<span style="color: #ff0000;">');</span></div></div>
<p>Alle Orte welche &#8220;Moritz&#8221; im Namen haben werden durch &#8220;St Moritz&#8221; ersetzt. Bei allen anderen Orten wird nichts unternommen.</p>
<p>Nat&#252;rlich kann dem Statement auch eine genauere Auswahl der Datens&#228;tze zur Verf&#252;gung gestellt werden.</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">UPDATE</span> adressen <br />
<span style="color: #993333; font-weight: bold;">SET</span> ortschaft <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>ortschaft<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Moritz, '</span>St Moritz<span style="color: #ff0000;">') <br />
WHERE ortschaft LIKE '</span>Moritz%<span style="color: #ff0000;">';</span></div></div>
<p>Dies ver&#228;ndert nur die Datens&#228;tze welche mit &#8220;Moritz&#8221; beginnen.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/02/09/sql-doppelte-datensaetze-finden/' title='SQL: doppelte Datens&#228;tze finden'>SQL: doppelte Datens&#228;tze finden</a></li>
<li><a href='http://www.camma.ch/2009/09/09/cms-made-simple-zeichenanzahl-inhalt-begrenzt/' title='CMS Made Simple: Zeichenanzahl Inhalt begrenzt'>CMS Made Simple: Zeichenanzahl Inhalt begrenzt</a></li>
<li><a href='http://www.camma.ch/2009/08/13/mysql-falsche-kodierungen-in-der-datenbank-korrigieren/' title='MySQL: Falsche Kodierungen in der Datenbank korrigieren'>MySQL: Falsche Kodierungen in der Datenbank korrigieren</a></li>
<li><a href='http://www.camma.ch/2009/05/18/sql-mehrere-felder-mit-teilweisen-null-werten-zusammenfuegen/' title='COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen'>COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=1774&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22SQL%20Replace%22%20http%3A%2F%2Ftinyurl.com%2F2vggeew" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2010/11/17/sql-replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL: doppelte Datens&#228;tze finden</title>
		<link>http://www.camma.ch/2010/02/09/sql-doppelte-datensaetze-finden/</link>
		<comments>http://www.camma.ch/2010/02/09/sql-doppelte-datensaetze-finden/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 08:13:27 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=1520</guid>
		<description><![CDATA[Will man auf einer Tabelle in nachhinein  einen Key &#252;ber mehrere Felder anlegen, scheitert das machmal an doppelten Datens&#228;tzen. Mit folgendem Schnippsel kann man doppelte Datens&#228;tze finden: Hier ein Beispiel f&#252;r eine Zelle SELECT DOMAIN, COUNT&#40;DOMAIN&#41; AS NumOccurrences FROM domains GROUP BY DOMAIN HAVING &#40; COUNT&#40;DOMAIN&#41; &#62; 1 &#41; Hier ein Beispiel f&#252;r einen Schl&#252;ssel [...]]]></description>
			<content:encoded><![CDATA[<p>Will man auf einer Tabelle in nachhinein  einen Key &#252;ber mehrere Felder anlegen, scheitert das machmal an doppelten Datens&#228;tzen. Mit folgendem Schnippsel kann man doppelte Datens&#228;tze finden:</p>
<p>Hier ein Beispiel f&#252;r eine Zelle</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DOMAIN</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DOMAIN</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> NumOccurrences<br />
<span style="color: #993333; font-weight: bold;">FROM</span> domains<br />
<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">DOMAIN</span><br />
<span style="color: #993333; font-weight: bold;">HAVING</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DOMAIN</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#41;</span></div></div>
<p>Hier ein Beispiel f&#252;r einen Schl&#252;ssel &#252;ber mehrere Zellen:</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DOMAIN</span><span style="color: #66cc66;">,</span> subdomain<span style="color: #66cc66;">,</span> email<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DOMAIN</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> NumOccurrences<br />
<span style="color: #993333; font-weight: bold;">FROM</span> domains<br />
<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">DOMAIN</span><span style="color: #66cc66;">,</span> subdomain<span style="color: #66cc66;">,</span> email<br />
<span style="color: #993333; font-weight: bold;">HAVING</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DOMAIN</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span>subdomain<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span>email<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span></div></div>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2009/08/13/mysql-falsche-kodierungen-in-der-datenbank-korrigieren/' title='MySQL: Falsche Kodierungen in der Datenbank korrigieren'>MySQL: Falsche Kodierungen in der Datenbank korrigieren</a></li>
<li><a href='http://www.camma.ch/2010/11/17/sql-replace/' title='SQL Replace'>SQL Replace</a></li>
<li><a href='http://www.camma.ch/2009/09/09/cms-made-simple-zeichenanzahl-inhalt-begrenzt/' title='CMS Made Simple: Zeichenanzahl Inhalt begrenzt'>CMS Made Simple: Zeichenanzahl Inhalt begrenzt</a></li>
<li><a href='http://www.camma.ch/2009/05/18/sql-mehrere-felder-mit-teilweisen-null-werten-zusammenfuegen/' title='COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen'>COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=1520&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22SQL%3A%20doppelte%20Datens%C3%A4tze%20finden%22%20http%3A%2F%2Ftinyurl.com%2Fyjkvk3r" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2010/02/09/sql-doppelte-datensaetze-finden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Script zum erstellen eines File und MySQL Backup mit FTP Upload</title>
		<link>http://www.camma.ch/2009/07/21/bash-script-zum-erstellen-eines-file-und-mysql-backup-mit-ftp-upload/</link>
		<comments>http://www.camma.ch/2009/07/21/bash-script-zum-erstellen-eines-file-und-mysql-backup-mit-ftp-upload/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 21:00:48 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[CMS Made Simple]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[Webservice]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=1125</guid>
		<description><![CDATA[Update 21.07.2009 - mysqldump angepasst, damit die dumps auch mit phpMyAdmin eingelesen werden k&#246;nnen. - durchg&#228;ngige Benennung der Dateien (Zeitformat &#252;berall gleich) - Problembehebung Zeitformat (19:22:20 hat zumindest Mac auf einem smb Share nicht gerne) - DB information_schema wird nicht mehr mitgesichert - Vor jeder File Erstellung wird die Zeit neu eingelesen. Dadurch hat man [...]]]></description>
			<content:encoded><![CDATA[<p>Update 21.07.2009<br />
- mysqldump angepasst, damit die dumps auch mit phpMyAdmin eingelesen werden k&#246;nnen.<br />
- durchg&#228;ngige Benennung der Dateien (Zeitformat &#252;berall gleich)<br />
- Problembehebung Zeitformat (19:22:20 hat zumindest Mac auf einem smb Share nicht gerne)<br />
- DB information_schema wird nicht mehr mitgesichert<br />
- Vor jeder File Erstellung wird die Zeit neu eingelesen. Dadurch hat man die genaue &#220;bersicht des Backupzeitpunkts</p>
<p>Update 30.06.2009 &#8211; INCFILE Pfad angepasst. Nun wird das tar-inc-backup.dat File sicher im gleichen Ordner wie das Script abgelegt.</p>
<p>Gestern habe ich das f&#252;r mich ultimative Script zum erstellen eines Backup via Bash Script entdeckt.</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/sh<br />
# Website + MySQL backup script<br />
# Full backup day - Sun (rest of the day do incremental backup)<br />
# Copyright (c) 2005-2006 nixCraft &lt;http://www.cyberciti.biz/fb/&gt;<br />
# This script is licensed under GNU GPL version 2.0 or above<br />
# Modified June 2009 by BlatterTech Informatik www.blattertech.ch<br />
#<br />
# Restore Database Backup<br />
# gunzip mybackup.sql.gzip<br />
# mysql -u USER -p dbname &lt; mybackup.sql<br />
#<br />
# Restore Files<br />
# You need to restore the last full backup first ($FULLBACKUP day)<br />
# followed by each of the subsequent incremental backups to the <br />
# present day in the correct order.<br />
#<br />
# ---------------------------------------------------------------------<br />
<br />
### Backp Name ###<br />
BACKUPSET=&quot;Backup of Website xy&quot;<br />
SHORTNAME=&quot;websitexy&quot;<br />
<br />
### System Setup ###<br />
DIRS=&quot;/home/path/to/files /home/path/to/other/files&quot;<br />
BACKUP=/tmp/backup.$$<br />
NOW=$(date +&quot;%Y%m%d&quot;)<br />
SCRIPTPATH=`dirname $0`<br />
INCFILE=&quot;$SCRIPTPATH/$SHORTNAME-tar-inc-backup.dat&quot;<br />
DAY=$(date +&quot;%u&quot;)<br />
# 1=Mon, 2=Tue, 3=Wed, ..<br />
FULLBACKUP=&quot;2&quot;<br />
<br />
### MySQL Setup ###<br />
MUSER=&quot;mysqluser&quot;<br />
MPASS=&quot;mysqlpassword&quot;<br />
MHOST=&quot;localhost&quot;<br />
MYSQL=&quot;$(which mysql)&quot;<br />
MYSQLDUMP=&quot;$(which mysqldump)&quot;<br />
GZIP=&quot;$(which gzip)&quot;<br />
<br />
### FTP server Setup ###<br />
FTPD=&quot;/path/on/ftpserver&quot;<br />
FTPU=&quot;ftpuser&quot;<br />
FTPP=&quot;ftppassword&quot;<br />
FTPS=&quot;your.ftpserver.com&quot;<br />
NCFTP=&quot;$(which ncftpput)&quot;<br />
<br />
### Other stuff ###<br />
EMAILID=&quot;your@email.com&quot;<br />
<br />
### Start Backup for file system ###<br />
[ ! -d $BACKUP ] &amp;&amp; mkdir -p $BACKUP || :<br />
<br />
### See if we want to make a full backup ###<br />
i=$(date +&quot;%Hh%Mm%Ss&quot;)<br />
<br />
if [ ! -f $INCFILE ]; then<br />
&nbsp; FTPD=&quot;$FTPD/full&quot;<br />
&nbsp; FILE=&quot;$SHORTNAME-files-full-$NOW-$i.tar.gz&quot;<br />
&nbsp; tar &nbsp;-g $INCFILE &nbsp;-zcvf $BACKUP/$FILE $DIRS<br />
elif &nbsp;[ &quot;$DAY&quot; == &quot;$FULLBACKUP&quot; ]; then<br />
&nbsp; FTPD=&quot;$FTPD/full&quot;<br />
&nbsp; FILE=&quot;$SHORTNAME-files-full-$NOW-$i.tar.gz&quot;<br />
&nbsp; tar -zcvf $BACKUP/$FILE $DIRS<br />
else<br />
&nbsp; FTPD=&quot;$FTPD/incremental&quot;<br />
&nbsp; FILE=&quot;$SHORTNAME-files-i-$NOW-$i.tar.gz&quot;<br />
&nbsp; tar -g $INCFILE -zcvf $BACKUP/$FILE $DIRS<br />
fi<br />
<br />
### Start MySQL Backup ###<br />
# Get all databases name<br />
DBS=&quot;$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')&quot;<br />
for db in $DBS<br />
do<br />
&nbsp; if [ &quot;$db&quot; == &quot;information_schema&quot; ]; then<br />
&nbsp; &nbsp; continue<br />
&nbsp; fi<br />
&nbsp; i=$(date +&quot;%Hh%Mm%Ss&quot;)<br />
&nbsp; FILE=$BACKUP/$SHORTNAME-mysql-$db.$NOW-$i.sql.gz<br />
&nbsp; $MYSQLDUMP -Q --opt --compact -u $MUSER -h $MHOST -p$MPASS $db | &nbsp;$GZIP -9 &gt; $FILE<br />
&nbsp; # FILE=$BACKUP/$SHORTNAME-mysql-$db.$NOW-$(date +&quot;%T&quot;).sql.bz2 <br />
&nbsp; # $MYSQLDUMP -Q --opt --compact -u $MUSER -h $MHOST -p$MPASS $db | &nbsp;bzip2 -cq9 &nbsp;&gt; $FILE<br />
done<br />
<br />
i=$(date +&quot;%Hh%Mm%Ss&quot;)<br />
### Make md5 Sum ###<br />
$(which md5sum) -b $BACKUP/* &gt;$BACKUP/$SHORTNAME-backup$NOW-$i.md5<br />
<br />
### Dump backup using FTP ###<br />
#Start FTP backup using ncftp<br />
#If ncftp not aviable, use ftp:<br />
#ftp -inv $FTPS &lt;&lt;END_SCRIPT<br />
#quote USER $FTPU<br />
#quote PASS $FTPP<br />
ncftp -u&quot;$FTPU&quot; -p&quot;$FTPP&quot; $FTPS&lt;&lt;EOF<br />
<br />
mkdir $FTPD<br />
mkdir $FTPD/$NOW<br />
cd $FTPD/$NOW<br />
lcd $BACKUP<br />
mput *<br />
quit<br />
EOF<br />
<br />
### Find out if ftp backup failed or not ###<br />
if [ &quot;$?&quot; == &quot;0&quot; ]; then<br />
&nbsp;rm -f $BACKUP/*<br />
else<br />
&nbsp;T=/tmp/backup.fail<br />
&nbsp;echo &quot;Date: $(date)&quot;&gt;$T<br />
&nbsp;echo &quot;Hostname: $(hostname)&quot; &gt;&gt;$T<br />
&nbsp;echo &quot;Backup Set: $BACKUPSET&quot;<br />
&nbsp;echo &quot;Backup failed&quot; &gt;&gt;$T<br />
&nbsp;mail &nbsp;-s &quot;BACKUP FAILED&quot; &quot;$EMAILID&quot; &lt;$T<br />
&nbsp;rm -f $T<br />
fi</div></div>
<p>Das <a href="http://www.cyberciti.biz/tips/how-to-backup-mysql-databases-web-server-files-to-a-ftp-server-automatically.html" target="_blank">Script habe ich hier</a> gefunden.</p>
<p>Auf der selben Seite gibt es einen Generator um das Script mit den eigenen Parametern abzuf&#252;llen.<br />
<a href="http://bash.cyberciti.biz/backup/wizard-ftp-script.php" target="_blank">http://bash.cyberciti.biz/backup/wizard-ftp-script.php</a></p>
<p>Ich habe das Script noch ein wenig aufgebohrt. So habe ich die M&#246;glichkeit geschaffen beim Fehlermail mitzugeben welches Backup den Fehler verursacht hat. Zudem habe ich die Bezeichnung des Backuptages auf die Tagesnummer ge&#228;ndert. Somit ist das Script nicht von der Systemsprache abh&#228;ngig.<br />
Zu guter letzt, habe ich eine Pr&#252;fung eingebaut ob das tar.dat File vorhanden ist. Dieses wird f&#252;r das incrementelle Backup verwendet. Falls dieses nicht existiert, wird ein Fullbackup gemacht.</p>
<p>Kunden von CeviNet k&#246;nnen das Script einfach in Ihrem Webspace als Cronjob einbinden:<br />
<div id="attachment_1129" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.camma.ch/wp-content/uploads/2009/06/cevinet_cronjob_backup.png"><img src="http://www.camma.ch/wp-content/uploads/2009/06/cevinet_cronjob_backup-300x152.png" alt="Cronjob einrichten" title="cevinet_cronjob_backup" width="300" height="152" class="size-medium wp-image-1129" /></a><p class="wp-caption-text">Cronjob einrichten</p></div><br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/04/02/cms-made-simple-versionen-in-nagios-monitoren/' title='CMS Made Simple Versionen in Nagios monitoren'>CMS Made Simple Versionen in Nagios monitoren</a></li>
<li><a href='http://www.camma.ch/2010/02/27/vertraege-in-der-internetbranche/' title='Vertr&#228;ge in der Internetbranche'>Vertr&#228;ge in der Internetbranche</a></li>
<li><a href='http://www.camma.ch/2009/10/12/backup-7-zip-und-batch-dateien-fuer-ein-automatisiertes-backup/' title='Backup: 7-zip und batch dateien f&#252;r ein automatisiertes Backup'>Backup: 7-zip und batch dateien f&#252;r ein automatisiertes Backup</a></li>
<li><a href='http://www.camma.ch/2009/10/08/47-massnahmen-um-eine-typo3-installation-sicher-zu-machen/' title='47 Massnahmen um eine Typo3 Installation sicher zu machen'>47 Massnahmen um eine Typo3 Installation sicher zu machen</a></li>
<li><a href='http://www.camma.ch/2009/10/05/ssh-port-absichern/' title='SSH-Port absichern'>SSH-Port absichern</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=1125&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22Bash%20Script%20zum%20erstellen%20eines%20File%20und%20MySQL%20Backup%20mit%20FTP%20Upload%22%20http%3A%2F%2Ftinyurl.com%2Fmkmh5x" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/07/21/bash-script-zum-erstellen-eines-file-und-mysql-backup-mit-ftp-upload/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen</title>
		<link>http://www.camma.ch/2009/05/18/sql-mehrere-felder-mit-teilweisen-null-werten-zusammenfuegen/</link>
		<comments>http://www.camma.ch/2009/05/18/sql-mehrere-felder-mit-teilweisen-null-werten-zusammenfuegen/#comments</comments>
		<pubDate>Mon, 18 May 2009 05:39:27 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=980</guid>
		<description><![CDATA[In MS SQL Server f&#252;gt man verschiedene Felder in der Regel so zusammen: SELECT vorname + ' ' + nachname AS name, strasse, plz + ' ' + ort AS ortschaft FROM adresse Wenn nun in einem der zusammengef&#252;gten Felder kein Wert steht, wird NULL als R&#252;ckgabewert zur&#252;ckgegeben. Hier hilft die Funktion COALESCE coalesce(ausdruck_1, ausdruck_2[, [...]]]></description>
			<content:encoded><![CDATA[<p>In MS SQL Server f&#252;gt man verschiedene Felder in der Regel so zusammen:</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> vorname <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">+</span> nachname <span style="color: #993333; font-weight: bold;">AS</span> name<span style="color: #66cc66;">,</span> strasse<span style="color: #66cc66;">,</span> plz <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">+</span> ort <span style="color: #993333; font-weight: bold;">AS</span> ortschaft <span style="color: #993333; font-weight: bold;">FROM</span> adresse</div></div>
<p>Wenn nun in einem der zusammengef&#252;gten Felder kein Wert steht, wird NULL als R&#252;ckgabewert zur&#252;ckgegeben.</p>
<p>Hier hilft die Funktion <strong>COALESCE</strong></p>
<p><em>coalesce(ausdruck_1, ausdruck_2[, _ audruck_n])</em></p>
<p>Die Funktion COALESCE kann eine beliebige Anzahl von Parametern verarbeiten. Die &#252;bergebenen Parameter sind typischerweise Ausdr&#252;cke, die der Reihe nach ausgewertet werden. Der erste Ausdruck, der einen Wert ungleich NULL zur&#252;ckliefert, bestimmt das Ergebnis der Funktion. Geben alle Ausdr&#252;cke NULL zur&#252;ck, so ist das Ergebnis der Funktion NULL. Es m&#252;ssen mindestens 2 Parameter &#252;bergeben werden. Ausserdem sollten die darauf achten, dass alle Ausdr&#252;cke einen Wert vom selben Datentyp zur&#252;ckliefern oder zumindest eine implizite Typenumwandlung unterst&#252;tzen.</p>
<p>Die Funktion COALESCE ist &#228;quivalent mit folgenden CASE-Funktionen</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">CASE</span><br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">WHEN</span> ausdruck_1 ist <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">THEN</span> ausdruck_1<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">WHEN</span> ausdruck_2 ist <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">THEN</span> ausdruck_2<br />
&nbsp; &nbsp; <span style="color: #66cc66;">-</span><br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">WHEN</span> ausdruck_n ist <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">THEN</span> ausdruck_n<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">ELSE</span> <span style="color: #993333; font-weight: bold;">NULL</span><br />
<span style="color: #993333; font-weight: bold;">END</span></div></div>
<p>Somit kann die obere SQL Abfrage so aufgebaut werden:</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">COALESCE</span><span style="color: #66cc66;">&#40;</span>vorname<span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">+</span> <span style="color: #993333; font-weight: bold;">COALESCE</span><span style="color: #66cc66;">&#40;</span>nachname<span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> name<span style="color: #66cc66;">,</span> strasse<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">COALESCE</span><span style="color: #66cc66;">&#40;</span>plz<span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">+</span> <span style="color: #993333; font-weight: bold;">COALESCE</span><span style="color: #66cc66;">&#40;</span>ort<span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> ortschaft <span style="color: #993333; font-weight: bold;">FROM</span> adresse</div></div>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/11/17/sql-replace/' title='SQL Replace'>SQL Replace</a></li>
<li><a href='http://www.camma.ch/2010/02/09/sql-doppelte-datensaetze-finden/' title='SQL: doppelte Datens&#228;tze finden'>SQL: doppelte Datens&#228;tze finden</a></li>
<li><a href='http://www.camma.ch/2009/09/09/cms-made-simple-zeichenanzahl-inhalt-begrenzt/' title='CMS Made Simple: Zeichenanzahl Inhalt begrenzt'>CMS Made Simple: Zeichenanzahl Inhalt begrenzt</a></li>
<li><a href='http://www.camma.ch/2009/08/13/mysql-falsche-kodierungen-in-der-datenbank-korrigieren/' title='MySQL: Falsche Kodierungen in der Datenbank korrigieren'>MySQL: Falsche Kodierungen in der Datenbank korrigieren</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=980&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22COALESCE%20-%20SQL%20mehrere%20Felder%20mit%20teilweisen%20Null-Werten%20zusammenf%C3%BCgen%22%20http%3A%2F%2Ftinyurl.com%2Foh9bud" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/05/18/sql-mehrere-felder-mit-teilweisen-null-werten-zusammenfuegen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatisiertes MySQL Backup</title>
		<link>http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/</link>
		<comments>http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 04:39:52 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=888</guid>
		<description><![CDATA[Im Moment besch&#228;ftige ich mich mit dem automatisierten Backup von MySQL sowie Webseiteninhalten. Eine M&#246;glichkeit zum Backupen von MySQL DBs ist der MySQL Administrator. Er kann auch automatisiert Backups erstellen. Nachteil dieser L&#246;sung ist, dass ein PC/Mac laufen muss, damit das Backup automatisiert &#252;ber den Cronjob ausgef&#252;hrt wird. Ein MySQL Backup kann jedoch auch &#252;ber [...]]]></description>
			<content:encoded><![CDATA[<p>Im Moment besch&#228;ftige ich mich mit dem automatisierten Backup von MySQL sowie Webseiteninhalten.</p>
<p>Eine M&#246;glichkeit zum Backupen von MySQL DBs ist der MySQL Administrator. Er kann auch automatisiert Backups erstellen. Nachteil dieser L&#246;sung ist, dass ein PC/Mac laufen muss, damit das Backup automatisiert &#252;ber den Cronjob ausgef&#252;hrt wird.</p>
<p>Ein MySQL Backup kann jedoch auch &#252;ber ein Shell Script oder ein PHP Script erstellt werden. Dieses wird dann vom Server mit Cronjob regelm&#228;ssig aufgerufen:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<a href="http://www.php.net/system"><span style="color: #990000;">system</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'mysqldump --opt -h%s -u%s -p&quot;%s&quot; %s | gzip &gt; %s/backup.sql.gz'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dbhost</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dbuser</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dbpwd</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dbname</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/getenv"><span style="color: #990000;">getenv</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Wer es ein wenig detaillierter haben will, findet im <a href="http://www.selfphp.de/kochbuch/kochbuch.php?code=56" target="_blank">selfphp Kochbuch</a> Hilfe.</p>
<p>Ein weiteres sehr gutes Script findet sich bei <a href="http://www.dagondesign.com/articles/automatic-mysql-backup-script/" target="_blank">DragonDesign</a>. Ich werde dieses Backupscript als Grundlage f&#252;r meine Weiterentwicklung gebrauchen.</p>
<p>Folgende Punkte will ich zus&#228;tzlich integrieren:</p>
<ul>
<li>Backup vordefinierter Ordner</li>
<li>Komprimieren des File und MySQL Backups in einem Archiv</li>
<li>Automatisiertes Hochladen des Backups auf einen entfernten FTP Server</li>
</ul>
<p>Je nach dem wie gut mein Hack ist, werde ich das Script danach hier zum Download anbieten.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/' title='PHP ausf&#252;hrliches Error Reporting'>PHP ausf&#252;hrliches Error Reporting</a></li>
<li><a href='http://www.camma.ch/2009/01/26/e-mailadressen-verschlusseln/' title='E-Mailadressen verschl&#252;sseln'>E-Mailadressen verschl&#252;sseln</a></li>
<li><a href='http://www.camma.ch/2010/11/17/sql-replace/' title='SQL Replace'>SQL Replace</a></li>
<li><a href='http://www.camma.ch/2010/10/20/perfide-masche-um-ein-trojaner-virus-unter-zu-jubeln/' title='Perfide Masche um ein Trojaner / Virus unter zu jubeln'>Perfide Masche um ein Trojaner / Virus unter zu jubeln</a></li>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=888&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22Automatisiertes%20MySQL%20Backup%22%20http%3A%2F%2Ftinyurl.com%2Fpe6aav" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Datenbankfelder mit verschiedenen Formatierungen kombinieren</title>
		<link>http://www.camma.ch/2009/03/18/datenbankfelder-mit-verschiedenen-formatierungen-kombinieren/</link>
		<comments>http://www.camma.ch/2009/03/18/datenbankfelder-mit-verschiedenen-formatierungen-kombinieren/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 10:35:52 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=753</guid>
		<description><![CDATA[Will man in einem SQL Statement ein int und ein varchar Feld zusammen in einem virtuellen Feld ausgeben, muss man die Werte auf einen gleichen Nenner (Typ) bringen: CAST&#40;Int_Feld AS VARCHAR&#41; Das Statement lautet also: SELECT CAST&#40;int_Feld AS VARCHAR&#41; + ' ' + varcharFeld AS kombiniertes_Feld FROM tabelle Related Posts: SQL Replace SQL: doppelte Datens&#228;tze [...]]]></description>
			<content:encoded><![CDATA[<p>Will man in einem SQL Statement ein int und ein varchar Feld zusammen in einem virtuellen Feld ausgeben, muss man die Werte auf einen gleichen Nenner (Typ) bringen:</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>Int_Feld <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#41;</span></div></div>
<p>Das Statement lautet also:</p>
<div class="codecolorer-container sql mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>int_Feld <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">+</span> varcharFeld <span style="color: #993333; font-weight: bold;">AS</span> kombiniertes_Feld <span style="color: #993333; font-weight: bold;">FROM</span> tabelle</div></div>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/11/17/sql-replace/' title='SQL Replace'>SQL Replace</a></li>
<li><a href='http://www.camma.ch/2010/02/09/sql-doppelte-datensaetze-finden/' title='SQL: doppelte Datens&#228;tze finden'>SQL: doppelte Datens&#228;tze finden</a></li>
<li><a href='http://www.camma.ch/2009/09/09/cms-made-simple-zeichenanzahl-inhalt-begrenzt/' title='CMS Made Simple: Zeichenanzahl Inhalt begrenzt'>CMS Made Simple: Zeichenanzahl Inhalt begrenzt</a></li>
<li><a href='http://www.camma.ch/2009/08/13/mysql-falsche-kodierungen-in-der-datenbank-korrigieren/' title='MySQL: Falsche Kodierungen in der Datenbank korrigieren'>MySQL: Falsche Kodierungen in der Datenbank korrigieren</a></li>
<li><a href='http://www.camma.ch/2009/05/18/sql-mehrere-felder-mit-teilweisen-null-werten-zusammenfuegen/' title='COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen'>COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=753&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22Datenbankfelder%20mit%20verschiedenen%20Formatierungen%20kombinieren%22%20http%3A%2F%2Ftinyurl.com%2Frcxdwc" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/03/18/datenbankfelder-mit-verschiedenen-formatierungen-kombinieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MS SQL Server Befehle</title>
		<link>http://www.camma.ch/2009/01/03/ms-sql-server-befehle/</link>
		<comments>http://www.camma.ch/2009/01/03/ms-sql-server-befehle/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 08:47:12 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://blog.blattertech.ch/?p=49</guid>
		<description><![CDATA[MS SQL und MySQL sind ja in vielem &#228;hnlich. Leider sind jedoch die einen oder anderen Befehle dennoch anders geschrieben. So geht z.B. &#8220;limit&#8221; nicht unter MS SQL. 2 Seiten welche die SQL Befehle f&#252;r MS SQL auflisten, sind hier zu finden: SQL Tutorial Einfache Beispiele f&#252;r SQL Kommandos Umfangreiches Tutorial zu MS SQL Server [...]]]></description>
			<content:encoded><![CDATA[<p>MS SQL und MySQL sind ja in vielem &#228;hnlich. Leider sind jedoch die einen oder anderen Befehle dennoch anders geschrieben. So geht z.B. &#8220;limit&#8221; nicht unter MS SQL.</p>
<p>2 Seiten welche die SQL Befehle f&#252;r MS SQL auflisten, sind hier zu finden:</p>
<p><a title="SQL Tutorial" href="http://sql.1keydata.com/de/sql-seitenuebersicht.php" target="_blank">SQL Tutorial</a></p>
<p><a title="Einfache Beispiele f&#252;r SQL Kommandos" href="http://www.torsten-horn.de/techdocs/sql-examples.htm" target="_blank">Einfache Beispiele f&#252;r SQL Kommandos</a></p>
<p><a href="http://www.tizag.com/sqlTutorial/" target="_blank">Umfangreiches Tutorial zu MS SQL Server Befehlen</a> (Es gibt auch ein MySQL Tutorial auf dieser Seite)<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/11/17/sql-replace/' title='SQL Replace'>SQL Replace</a></li>
<li><a href='http://www.camma.ch/2010/02/09/sql-doppelte-datensaetze-finden/' title='SQL: doppelte Datens&#228;tze finden'>SQL: doppelte Datens&#228;tze finden</a></li>
<li><a href='http://www.camma.ch/2009/09/09/cms-made-simple-zeichenanzahl-inhalt-begrenzt/' title='CMS Made Simple: Zeichenanzahl Inhalt begrenzt'>CMS Made Simple: Zeichenanzahl Inhalt begrenzt</a></li>
<li><a href='http://www.camma.ch/2009/08/13/mysql-falsche-kodierungen-in-der-datenbank-korrigieren/' title='MySQL: Falsche Kodierungen in der Datenbank korrigieren'>MySQL: Falsche Kodierungen in der Datenbank korrigieren</a></li>
<li><a href='http://www.camma.ch/2009/05/18/sql-mehrere-felder-mit-teilweisen-null-werten-zusammenfuegen/' title='COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen'>COALESCE &#8211; SQL mehrere Felder mit teilweisen Null-Werten zusammenf&#252;gen</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=49&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22MS%20SQL%20Server%20Befehle%22%20http%3A%2F%2Ftinyurl.com%2Fpqo2vk" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/03/ms-sql-server-befehle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

