Montag, März 1st, 2010 | by Andreas Bruckner | Posted in Programmierung Allgemein, SQL 2008 | 1 Comment »
How to use an Update Cursor on MS SQL Server.
Requirements: If the update-table does not have a Primary Key, the cursor is read-only. So I advise to create at least a temporary Primary Key, and delete it afterwards.
Usage:
DECLARE curs as CURSOR
FOR SELECT * FROM t_image
FOR UPDATE
OPEN curs
FETCH curs INTO @lastValue
WHILE (@@FETCH_STATUS = 0) BEGIN
UPDATE [t_image]
SET [CALC_VALUE] = @lastValue
WHERE current of curs
FETCH curs INTO @lastValue
END
CLOSE calc
DEALLOCATE calc
if you replace “WHERE current of curs” by any “WHERE x = y” statement, it would decrease performance dramtically.
During a test with 80000 records, execution time without update cursor takes 20 minutes. Using an update cursor speeds up to a total time of 20 seconds!
Freitag, April 10th, 2009 | by Daniel Siegl | Posted in C#, Compact Framework, SQL 2008 | No Comments »
Nachdem ich nur mehr die SQL Server 2008 Tools installiert habe – gibt es Schwierigkeiten mit dem öffnen von SQLCe 3.1 Datenbanken – 2 Zeilen Code machens wieder gut. Gefunden habe ich das bei MobileTech
SqlCeEngineeng = new SqlCeEngine(@”DataSource=C:\MyDataBase.sdf”);
eng.Upgrade(@”DataSource=C:\MyDataBaseNew.sdf”);
Mittwoch, Januar 21st, 2009 | by Richard Deininger | Posted in Problemlösungen, Programmierung Allgemein, SQL 2008, Visual Studio | No Comments »
Beim druchforsten meiner Hack/DIY Seiten bin ich auf was tolles gestoßen. “Gizmo“ ein Freeware Tool, mit dessen Hilfe man all das machen kann, was ein Developer so ab und an mal braucht. Alleine die Featureliste sollte euch doch schon mal neugierig machen.
- Gizmo Drive (Mount ISOs, encrypted hard drive images to a virtual device,….)
- Gizmo Database (Query Analyzer and stored procedure analyser,….)
- Gizmo Editor (Colorizing text editor and hex/binary editor,….)
- Gizmo Hasher (Calculates hash values for files, folders and drives,…)
- Gizmo Script (Automate your PC and execute functions using scripts,…)
- Gizmo Synchronization (Synchronize files and deploy software between clients)
Ach ja eine DVD/CD Brenn function ist auch einbaut.
While reading my Hack/DIY sites I found something very usefull. “Gizmo” a freeware tool, with all the functionality a developer needs from time to time. Just read the featurelist and you know you want to have it.
- Gizmo Drive (Mount ISOs, encrypted hard drive images to a virtual device,….)
- Gizmo Database (Query Analyzer and stored procedure analyser,….)
- Gizmo Editor (Colorizing text editor and hex/binary editor,….)
- Gizmo Hasher (Calculates hash values for files, folders and drives,…)
- Gizmo Script (Automate your PC and execute functions using scripts,…)
- Gizmo Synchronization (Synchronize files and deploy software between clients)
Bevor I forget it, there is also a DVD/CD burning feature implemente.