Wednesday, July 10, 2013

Turn browser window/tab into a notepad


paste the following line the browsers address bar

 data:text/html,

 the browser window/tab turns into a notepad

Tuesday, March 12, 2013

Script for creating a folder & taking a backup up in that folder


declare @name varchar(500)
declare @q nvarchar(MAX)
declare @foldername varchar(500)
set @foldername = 'D:\db backup\dbbackup_' + CONVERT(varchar,getdate(),110) + ''
--EXEC master.sys.xp_dirtree @DataPath
EXEC master.dbo.xp_create_subdir @foldername

set @name = @foldername + '\next_' + CONVERT(varchar,getdate(),110) + '.bak'
set @q = ' BACKUP DATABASE [Next] TO  DISK = N''' + @name + ''' WITH NOFORMAT, NOINIT,
 NAME = N''Next-Full Database Backup'', SKIP, NOREWIND, NOUNLOAD,  STATS = 10'
print @q
exec sp_executesql @q

set @name = @foldername + '\Mirror_test_' + CONVERT(varchar,getdate(),110) + '.bak'
set @q = ' BACKUP DATABASE [Mirror_test] TO  DISK = N''' + @name + ''' WITH NOFORMAT, NOINIT,
 NAME = N''Mirror_test-Full Database Backup'', SKIP, NOREWIND, NOUNLOAD,  STATS = 10'
print @q
exec sp_executesql @q

Sunday, February 10, 2013

Check Box in Crystal Report or MicorSoft Report.


The following Example shows how to Place a Check Box in Crystal Report

Steps to be performed :

1. Expand Field Explorer

2. Go To Formula's-> Right Click on that And New Formula

3. Give a Name to that Formula Editor

4. Now Editor will be displayed

5. In that Editor place the below Formula
if{Table.FieldName} = true Then
Chr(254)
Else
Chr(168)


6. Close the Editor it will show save Prompt save the formula

7. Drag and drop your formula field to your crystal report
Right Click to format Object for that Formula-> Select Format Object

8. Go to Fonts Tab and Set Font as 'Wingdings' and Press Ok

9. Now check it will display if value is true then checked check box else un-checked checkbox.