October 4, 2003

SQL Server Database Restore Via Stored Procedure

The following stored procedure will restore the database. This is helpful when you need to restore the database from other applications: CREATE PROCEDURE [dbo].[sp_db_restore]@DBName varchar(60),@BackName varchar(120),@DataName varchar(60),@DataFileName varchar(120),@LogName varchar(60),@LogFileName varchar(120)

Constructors of Built-in Types

The way we have constructors for user defined data types, we also have constructors for built in data types like chat, int, float and so on. Here is a program

XML Made Easy with XMLBeans

very once in a while there comes around a tool so useful it makes you wonder why nobody ever did it before, or why it hasn’t been a part of

Manipulate Complex Numbers

The following demonstrates how to manipulate complex numbers: class Complex{ double real; double imag; Complex() { } Complex(double real,double imag) { this.real=real; this.imag=imag; } void addComplexNos(Complex comp1,Complex comp2) { this.real=comp1.real+comp2.real;

A Simple Way to Debug a Stored Procedure

Debugging stored procedures can be a headache, but heres an easier way to trace a stored procedure’s execution: Use the PRINT statement. PRINT lets you output and analyze variable values,