Here is a stored procedure to create a full backup of the database.
Run the code on the master database.
To backup a db run:
sp_backupdatabase 'databasename'
To verify the backup we need to use use CHECKSUM.
USE "master"
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE "dbo"."sp_backupdatabase" (
@DBName nvarchar(50)
)
WITH ENCRYPTION
AS
BEGIN
SET NOCOUNT ON;
DECLARE @sqlCommand NVARCHAR(1000)
DECLARE @dateTime NVARCHAR(20)
SELECT @dateTime = REPLACE(CONVERT(VARCHAR, GETDATE(),111),'/','') + REPLACE(CONVERT(VARCHAR, GETDATE(),108),':','')
SET @sqlCommand = 'BACKUP DATABASE ' + @DBName + ' TO DISK = ''D:\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\' + @DBName + '_backup_' + @dateTime + '.BAK'' WITH CHECKSUM'
EXECUTE sp_executesql @sqlCommand
END
Tuesday, 21 April 2009
Thursday, 9 April 2009
The Italy earthquake
I really feel sorry for people of L'Aquila and other towns in central Italy and Italy for what they have been experiencing after this. Prey god be merciful, but its the way now people behaving, and what wrongful deeds they are doing cost to other innocent people to suffer.
May god help the families of the sufferers to come out from this shock and great loss bravely.
May god help the families of the sufferers to come out from this shock and great loss bravely.
My New Kitchen
Its all fitted now and looks amazing, will post some pics of it soon, looking forward to long weekend (Easter one, tomorrow), when painter will come to paint and lay tiles on wall opposite to sink and Hob.
It was worth spending money with KBBC, Kitchen fitting company.
It was worth spending money with KBBC, Kitchen fitting company.
Saturday, 14 March 2009
Working on Saturday
I have to come on Saturday to work, so next release can be done in time for Internet World.
:(
:(
Friday, 13 March 2009
My New Car - RAV4
I bought a new car/SUV yesterday, its one year old, Toyota RAV4 XT5 Automatic and have amazing feature, I was very thrilled when I drove it to home and went on a ride with my dream girl Ritu, she loved it too.
:)
My kids who are in uni want to enjoy this ASAP, I guess, LOL.
Out of one feature, it senses the key itself and bearer don't need to press the button, just he has to open the driver side door.
:)
My kids who are in uni want to enjoy this ASAP, I guess, LOL.
Out of one feature, it senses the key itself and bearer don't need to press the button, just he has to open the driver side door.
Wednesday, 11 March 2009
ColdFusion > JVm memmory status
<cfset runtime = CreateObject("java","java.lang.Runtime").getRuntime() >
<cfset freeMemory = runtime.freeMemory() / 1024 / 1024 >
<cfset totalMemory = runtime.totalMemory() / 1024 / 1024 >
<cfset maxMemory = runtime.maxMemory() / 1024 / 1024 >
<cfoutput >
Free Allocated Memory: #Round(freeMemory)#mb
Total Memory Allocated: #Round(totalMemory)#mb
Max Memory Available to JVM: #Round(maxMemory)#mb
</cfoutput>
<cfset freeMemory = runtime.freeMemory() / 1024 / 1024 >
<cfset totalMemory = runtime.totalMemory() / 1024 / 1024 >
<cfset maxMemory = runtime.maxMemory() / 1024 / 1024 >
<cfoutput >
Free Allocated Memory: #Round(freeMemory)#mb
Total Memory Allocated: #Round(totalMemory)#mb
Max Memory Available to JVM: #Round(maxMemory)#mb
</cfoutput>
Tuesday, 10 March 2009
CF 8 - New Identity COL feature
I like the new feature of getting Identity column value from cfquery in CF*, saved me couple of line of code to get the value from SCOPE_IDENTITY() (MS SQL system variable), you just got to put result name in cfquery tag and then you can get it as resultname.IdentityCol, there is one restriction, you should have just one insert statement in that cfquery, when I had one local query lookup which was saving its result in local @VAR then this IdentityCol thing didn't work.
let me know if you are not clear about what I am saying, LOL
let me know if you are not clear about what I am saying, LOL
Subscribe to:
Posts (Atom)