Tuesday, August 26, 2008

SQLyog MySQL GUI


SQLyog MySQL GUI Community Edition is a front end for the MySQL database server. The program is aimed at users that are familiar with SQL statements and need an easy to use, no fuss, graphical interface to execute SQL queries, manage users and permissions, edit table properties and more. The program supports execution of multiple queries and selected (highlighted) or single queries and offers a template explorer to quickly insert commonly used queries, such as create table, insert, drop table, rollback and others. In addition, you can export data in CSV, HTML & XML format and Import from a text file, export data and schema itself, flush hosts/logs and more. The program also allows you to diagnose and optimize your databases, save your favorite SQL scripts in favorite folders and more.

webyog.com

Tuesday, April 29, 2008

Microsoft Web Servers Hacked

Hundreds of thousands of Web sites - including several at the United Nations and in the U.K. government -- have been hacked recently and seeded with code that tries to exploit security flaws in Microsoft Windows to install malicious software on visitors' machines.

The attackers appear to be breaking into the sites with the help of a security vulnerability in Microsoft's Internet Information Services (IIS) Web servers. In an alert issued last week, Microsoft said it was investigating reports of an unpatched flaw in IIS servers, but at the time it noted that it wasn't aware of anyone trying to exploit that particular weakness.

On Thursday, Spanish anti-virus vendor Panda Security said that it had alerted Microsoft that a flaw IIS was the cause of all the break-ins. When I asked Microsoft whether they'd heard from Panda or if the hundreds of thousands of sites were hacked from a patched or unpatched flaw in IIS, a spokesman for the company didn't offer much more information.

According to Finnish anti-virus maker F-Secure, the number of hacked Web pages serving up malicious software from this attack may be closer to half a million.

Washington Post

Tuesday, April 22, 2008

Apache CouchDB

Apache CouchDB is a distributed, fault-tolerant and schema-free document-oriented database accessible via a RESTful HTTP/JSON API. Among other features, it provides robust, incremental replication with bi-directional conflict detection and resolution, and is queryable and indexable using a table-oriented view engine with JavaScript acting as the default view definition language.

CouchDB is written in Erlang, but can be easily accessed from any environment that provides means to make HTTP requests. There are a multitude of third-party client libraries that make this even easier for a variety of programming languages and environments.

Friday, February 15, 2008

Reviews: Kexi Project - Open source data management


Kexi is a Free/Libre and Open-Source integrated data management application, a long awaited Open Source competitor for products like Microsoft Access. Kexi can be used for creating database schemas, inserting data, performing queries, and processing data. Forms can be created to provide a custom interface to your data. All database objects - tables, queries and forms - are stored in the relational database, making it easy to share data and design.

  • Full visual designers for tables, queries and forms. Queries can be also designed in dedicated SQL view.
  • Running queries, support for parametrized queries.
  • Data entry and sorting.
  • Support for "Object" data allowing to store images of many types.
  • Designing and displaying relational data using combo boxes (lookup columns).
  • Simple printounts for table and query data with robust print preview.
  • Advanced CSV data import and export from files. Copying to clipboard and pasting from clipboard is also available, thus the data can be easily transferred to applications like spreadsheets or word processors.
  • User Mode, allowing to switch off all commands related to editing project's design (since 1.1.2)
  • "Find" window for searching thought table and form's contents with rich set of options (since 1.1.3)
  • Support for simple database templates (since 1.1.3)
Supported Database Engines
  • SQLite - file based (version 2.8 and 3.2) - the default built-in databse format allowing to store al lthe data and design in a single file that can be easily e-mailed or published in the Internet; requires no maintenance and installation.
  • MySQL servers.
  • PostgreSQL servers.

Data/Project Migration Tools

  • MySQL, PostgreSQL migration assistant allowing to reuse existing databases.
  • Microsoft Access migration assistant for database tables, being a unique solution.
  • An assistant allowing to export Kexi file-based database to a MySQL or PostgreSQL server.

Scripting and Macros

  • Python and Ruby programming languages are supported (beta stage, JavaScript support is in development; scripting is not yet available on Windows)
  • Macros similar to these in MS Access (usable, currently in further development, not yet available on Windows)

Used Technologies

  • Kexi uses the KDE and KOffice features for better user's experience. You can run it on most other destops (e.g. GNOME or XFCE) as well - Kexi will just use KDE's facilities in the background.
  • While the application is available on many operating systems, it does not contain Java or .NET code (only C++) and it is optimized for speed and ease of use.

Extensions

  • APIs for developing custom widgets, data providers and data importing/exporting. C++ language can be used as well as Python and Ruby scripting.
Kexi-Project.org

Wednesday, May 16, 2007

Oracle to get Agile with $495m deal

Oracle is buying product lifecycle management (PLM) specialist Agile Software in a deal likely to result in an overhaul of its existing PLM suite.

The database giant, which has bought more than 30 companies in three years, is spending $495m, or $8.10 per share, for Agile. It hopes the purchase will squeeze SAP.

The deal serves up Oracle 1,250 Agile PLM customers, with Agile expected to announce a 12 per cent increase in revenue to between $37m and $38m for its fourth quarter.

Oracle president Charles Philips said in a statement Agile will serve as the foundation for Oracle's PLM offering while furthering the strategy of delivering industry specific enterprise applications.

Oracle's existing PLM suite spans CAD, project collaboration, project management and sourcing, and is available through eBusiness Suite. The suite provides a unified data model for a single view of the product from inception through to design, delivery and service.

Read More

Thursday, February 22, 2007

Access To MySQL

Access to MySQL is a small program that will convert Microsoft Access Databases to MySQL.

  • Wizard interface.
  • Transfer data directly from one server to another.
  • Create a dump file.
  • Select tables to transfer.
  • Select fields to transfer.
  • Transfer password protected databases.
  • Supports both shared security and user-level security.
  • Optional transfer of indexes.
  • Optional transfer of records.
  • Optional transfer of default values in field definitions.
  • Identifies and transfers auto number field types.
  • Command line interface.
  • Easy install, uninstall and upgrade.
More @ bullZip.com

Monday, February 19, 2007

Create a copy of an existing SQL Server database

Here u can find a Stored Procedure for talking backup of your existing Sql Database


----------------------------------------------------------------------------------------------------------------------------------

USE master
GO

-- the original database (use 'SET @DB = NULL' to disable backup)
DECLARE @DB varchar(200)
SET @DB = 'PcTopp'

-- the backup filename
DECLARE @BackupFile varchar(2000)
SET @BackupFile = 'c:\pctopp\sqlserver\backup.dat'

-- the new database name
DECLARE @TestDB varchar(200)
SET @TestDB = 'TestDB'

-- the new database files without .mdf/.ldf
DECLARE @RestoreFile varchar(2000)
SET @RestoreFile = 'c:\pctopp\sqlserver\backup'


-- ****************************************************************
-- no change below this line
-- ****************************************************************


DECLARE @query varchar(2000)

DECLARE @DataFile varchar(2000)
SET @DataFile = @RestoreFile + '.mdf'

DECLARE @LogFile varchar(2000)
SET @LogFile = @RestoreFile + '.ldf'

IF @DB IS NOT NULL
BEGIN
SET @query = 'BACKUP DATABASE ' + @DB + ' TO DISK = ' + QUOTENAME(@BackupFile, '''')
EXEC (@query)
END

-- RESTORE FILELISTONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE HEADERONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE LABELONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE VERIFYONLY FROM DISK = 'C:\temp\backup.dat'

IF EXISTS(SELECT * FROM sysdatabases WHERE name = @TestDB)
BEGIN
SET @query = 'DROP DATABASE ' + @TestDB
EXEC (@query)
END

RESTORE HEADERONLY FROM DISK = @BackupFile
DECLARE @File int
SET @File = @@ROWCOUNT

DECLARE @Data varchar(500)
DECLARE @Log varchar(500)

SET @query = 'RESTORE FILELISTONLY FROM DISK = ' + QUOTENAME(@BackupFile , '''')

CREATE TABLE #restoretemp
(
LogicalName varchar(500),
PhysicalName varchar(500),
type varchar(10),
FilegroupName varchar(200),
size int,
maxsize bigint
)
INSERT #restoretemp EXEC (@query)

SELECT @Data = LogicalName FROM #restoretemp WHERE type = 'D'
SELECT @Log = LogicalName FROM #restoretemp WHERE type = 'L'

PRINT @Data
PRINT @Log

TRUNCATE TABLE #restoretemp
DROP TABLE #restoretemp

IF @File > 0
BEGIN
SET @query = 'RESTORE DATABASE ' + @TestDB + ' FROM DISK = ' + QUOTENAME(@BackupFile, '''') +
' WITH MOVE ' + QUOTENAME(@Data, '''') + ' TO ' + QUOTENAME(@DataFile, '''') + ', MOVE ' +
QUOTENAME(@Log, '''') + ' TO ' + QUOTENAME(@LogFile, '''') + ', FILE = ' + CONVERT(varchar, @File)
EXEC (@query)
END
GO


------------------------------------------------------------------------------------------------

Thursday, February 15, 2007

All in One Developer Cheat Sheet!

I’m not one of those people that can remember every detail of every language and never look anything up. It’s nice to have a cheat sheet with a quick summary of some of the most commonly used procedures, tags, tools, syntax, etc, saving time that would have been used to look it up on Google or dig through documentation either online or in printed text. The following is a list of links to several different cheat sheets on a wide variety of tasks and tools. You can print them out and hang them on your wall (my personal choice) or simply bookmark them for easy access down the road. If you have any additional suggestions or see something I’ve missed, let me know…

Command Line

Databases

Programming

Unix/Linux

Web Development

Miscellaneous Topics

Sunday, February 4, 2007

How to send mails From Stored Procedure?

Here we go...

If we want to write a code that sends Newsletters via Emails to many users, then what we can do ideally something like this
/*
for loop
{
( send mail); /* takes long time */
}

Mails are sent using SMTP server n it takes a long time then the for loop execution speed..
so what we need to do is, we should insert some kind of waiting code between each mail sending.. like,
for loop
{
( send mail); /* takes long time */
thread.sleep(5000); /* wait for 5 seconds..*/
}

but I have a great method if you are using MS SQL server as your database...

We can write a stored proc that can send emails behalf of us....

what we do here
we pass folowing parameters...
From Address,To address,subject and Message Body...

You could schedue a job to run an SProc that uses the
CDO mail object to send out your emails.

We need here two objects that is
1. Message object
2. Configuration Object
After setting properties of each of these objects u can use it to send your emails...
Just use this stored procedure and create one job that runs periodically on your server..

Here is the source code...

===============================================
CREATE PROCEDURE sp_SMTPemail
(
@From as nvarchar(50)
,@To as nvarchar(50)
,@Subject as nvarchar(255)
,@Body as text
) --WITH ENCRYPTION--
AS
-- Declare
DECLARE @message int
DECLARE @config int
DECLARE @hr int
DECLARE @src varchar(255), @desc varchar(255)
SET @hr = 0

EXEC @hr = sp_OACreate 'CDO.Message', @message OUT -- create the message
object
EXEC @hr = sp_OACreate 'CDO.Configuration', @config OUT -- create the
configuration object
-- Configuration Object
EXEC @hr = sp_OASetProperty @config, 'Fields(cdoSendUsingMethod)',
'cdoSendUsingPort' -- Send the message using the network
EXEC @hr = sp_OASetProperty @config, 'Fields(cdoSMTPServer)',
'your.server.com' -- SMTP Server
EXEC @hr = sp_OASetProperty @config, 'Fields(cdoSMTPServerPort)', 25 --
Server SMTP Port
EXEC @hr = sp_OASetProperty @config, 'Fields(cdoSMTPAuthenticate)',
'cdoAnonymous' -- Anonymous SMTP Authenticate
EXEC sp_OAMethod @config, 'Fields.Update'
-- Message Object
EXEC @hr = sp_OASetProperty @message, 'Configuration', @config -- set
message.configuration = config
EXEC @hr = sp_OASetProperty @message, 'To', @To
EXEC @hr = sp_OASetProperty @message, 'From', @From
EXEC @hr = sp_OASetProperty @message, 'Subject', @Subject
EXEC @hr = sp_OASetProperty @message, 'bodyformat',0
EXEC @hr = sp_OASetProperty @message, 'MailFormat',0
EXEC @hr = sp_OASetProperty @message, 'HTMLBody', @Body
EXEC sp_OAMethod @message, 'Send()'
-- Destroys the objects
EXEC @hr = sp_OADestroy @message
EXEC @hr = sp_OADestroy @config

-- Errorhandler
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @message, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
-- log and/or handle the error here if there is one...
RETURN
END
GO