Monday 23 April 2012

How to Delete all records from all tables from Database

Following is the SQL query used to delete all records from all tables from Database.
This is useful during development scenarios where you need to get rid of all the dummy records and insert a fresh data.


SQL Query: Appropriate comments are provided to explain its operation





/* The Following set of queries is used to delete all records from all tables from your database */
/* Disables Referential integrity */
/*---------------------------------*/
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
GO
/* Delete records from tables */
/*----------------------------*/
EXEC sp_MSForEachTable '
IF OBJECTPROPERTY(object_id(''?''), ''TableHasForeignRef'') = 1
DELETE FROM ?
else
TRUNCATE TABLE ?
'
GO
/* Enables Referential integrity */
/*-------------------------------*/
EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
GO
/*Query ot be used if you would like to reseed all table*/
/*------------------------------------------------------*/
EXEC sp_MSForEachTable '
IF OBJECTPROPERTY(object_id(''?''), ''TableHasIdentity'') = 1
DBCC CHECKIDENT (''?'', RESEED, 0)
'
GO


Source : http://mrsupport.blogspot.in/

Search for a Text in whole Database SQL

Search for a Text in whole Database SQL

Hi,

There was a requirement to search for a text in the whole SQL database. found this Stored procedure very useful. though it is worth sharing...

Resource: http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm


-- SearchAllTables ''
CREATE PROC SearchAllTables
(
@SearchStr nvarchar(100)
)
AS
BEGIN
CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
SET NOCOUNT ON
DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')
WHILE @TableName IS NOT NULL
BEGIN
SET @ColumnName = ''
SET @TableName =
(
SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
AND OBJECTPROPERTY(
OBJECT_ID(
QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)
), 'IsMSShipped'
) = 0
)
WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
BEGIN
SET @ColumnName =
(
SELECT MIN(QUOTENAME(COLUMN_NAME))
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = PARSENAME(@TableName, 2)
AND TABLE_NAME = PARSENAME(@TableName, 1)
AND DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
AND QUOTENAME(COLUMN_NAME) > @ColumnName
)
IF @ColumnName IS NOT NULL
BEGIN
INSERT INTO #Results
EXEC
(
'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630)
FROM ' + @TableName + ' (NOLOCK) ' +
' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
)
END
END
END
SELECT ColumnName, ColumnValue FROM #Results
END

source: http://mrsupport.blogspot.com/

Grant of Transport Allowance to the Running Staff only taking into account pay plus 30% of pay

GOVERNMENT OF INDIA
MINISTRY OF RAILWAYS
(RAILWAY BOARD)
No. E(P&A) II-2011/RS-51
RBE No.5/2012
New Delhi, dated 17.04.2012
The General Managers,
All Indian Railways & Production Units etc.,
(As per mailing list No.I & II)

Sub: Grant of Transport Allowance to the Running Staff only taking into account pay plus 30% of pay.
One of the Zonal Railways had sought clarification whether 30% pay element is to be reckoned for the purpose of payment of Transport Allowance to Running Staff or otherwise.

2. The issue has already been considered and also discussed with the representatives of the Staff Side after the implementation of the Fifth CPC recommendations but was not agreed to. Therefore, it is clarified that 30% pay elements, is not to be reckoned for the  purpose of payment of Transport Allowance to Running Staff.
3. This issues with the concurrence of the Finance Directorate of the Ministry of Railways.

sd/-
(Salim Md.Ahmad)
Deputy Director /E(P&A)II,
Railway Board
Source: NFIR

Procedure of sending SO_TO_HO files at Head Post Office

Procedure of sending SO_TO_HO files at Head Post Office
 1. First ensure that following points.A] In Sanchay Post à Superviosr à PO name and Address --> New Form --> See the Your office and Head Post Office details is feed. Secondly in below see your office the running SB all categories are add in boxes and saved.

B] Installed the latest DBAnlayzer (20.03.2012) and entered the Server name --> Select the radio button of DATA TRANFSER --> Select the radio button of SO_TO_HO option and below select the one by one in your office running all SB categories. ( After selection the said SB categories button are disabled. )

C] Check the SO_TO_HO folder in My Computer à C:\ drive .

2. Now you ensure that you have already received the your office USER ID and PASSWORD for uploading the SO_TO_HO data

3. After the day end of Sanchay Post and Time Transaction Report check the SO_TO_HO folder and noticed that in your office running all SB categories files are created in this folder.

4. Start the Internet and type following website is
www.tamilnadupost.nic.in/sanchaypost/

5. Entered the USER ID and PASSWORD ( IN CAPITAL LETTER ) and click on LOGIN button

6. Now you see the file uploading screen and select one by one file from C:\SO_TO_HO folder through BROWSE button.

7. After uploading the all files click on UPLOAD button.

8. After successfully uploading the all created file LOGOUT the website.

**FOR ACCURACY AND CORRECTNESS IN SANCHAY POST DATA DONE THE PROPER TRANSACTIONS AND AVOID MANUALLY CORRECTION ON -- LIST OF TRANSACTION**.

Three postal employees, accomplice caught stealing parcels



New Delhi, April 22,2012(IANS): Four men, including three postal department employees, were arrested for stealing parcels from a post office van in the capital’s cantonment area, police said Sunday.
According to police, out of the accused, Jai Bhagwan, 47, Shiv Shankar, 55, and Janardan Majhi, 47, were employees of the post and telegraph department. The fourth was identified as Vinod Kumar, 48, an accomplice.
“They (accused) had parked a postal department parcel van and were stealing the contents of parcels when an officer from the department saw them and informed the police,” a police official told IANS.
Acting upon the information, the police team apprehended the culprits red-handed.

“They had all the materials required for opening and resealing the parcels so that the theft could not be detected immediately,” the officer added.
The accused were presented in court Saturday and have been sent to Tihar jail for 14 days’ judicial custody.
source:tkbsen.com

Central Government releases fund for Delhi to award Post Matric Scholarship

Press Information Bureau
Government of India
Ministry of Social Justice & Empowerment
23-April-2012 17:28 IST

Central Government releases fund for Delhi to award Post Matric Scholarship

Ministry of Social Justice & Empowerment has released an amount of Rs.9,79,40,000 /-(Rupees- Nine crore Seventy nine lakh forty thousand only) to the NCT of Delhi, towards central assistance for the current financial year 2011-2012,under the centrally sponsored scheme of Post-Matric Scholarships to student belonging to Scheduled Castes.
The Post Matric Scholarship for SC Students Scheme is a single largest intervention by Government of India for educational development of scheduled caste students. It is a flagship Scheme of the Ministry, in operation since 1944, which provides financial assistance to Scheduled Caste students studying at post matriculation level in the country. There is no upper limit on the number of scholarships and all the SC students fulfilling the eligibility criteria are covered under the Scheme. About 48 lakh students are anticipated to be covered during 2011-12.During X FY Plan, an amount of Rs. 1826.91 Crore was released to cover 113.82 lakh beneficiaries. It has increased sharply in XI FY Plan and Rs.6780.52 crore has been released so far to cover 196.16 lakh beneficiaries.

In order to streamline the delivery system of the Scheme and fulfilling the objective of improving enrollment and retention of SC students all the State Governments and Administrators of UTs have been advised by Ministry to ensure timely and regular disbursement of scholarship to the beneficiary students, payment through bank/post-office accounts, start online processing of scholarship and designate Grievance Redressal Officers (GROs) at the State and District levels to redress students’ scholarship-related grievances. The Scheme is implemented through State Governments and Union Territory Administrations which receive 100% Central assistance from the Government of India for the total expenditure under the scheme, over and above their respective Committed Liability. The North Eastern states have been exempted from the burden of committed liability.
The Scheme has been revised by the Government on 31-12-2010 w.e.f. 1.7.2010 and the revision includes increase in
(i) Parental income ceiling from Rs. 1.00 lakh p.a. to Rs. 2.00 lakh p.a.;

(ii) regrouping of courses; and

(iii) rates of maintenance and other allowances.
Rates of maintenance and other allowances have been increased by 60% with respect to pre-revised rates. Presently, 23 State Governments have already implemented revised Scheme. Others are under process to implement the revised Scheme.

Review of Speed Post Discount Structure and Operational Machanism

The following modifications have been made with effect from 01.05.2012 in Speed Post Discount Structure and Operational Machanism.
 
1.The power to offer the credit facility to customer generating revenue below Rs 10,000/- on case to case basis in consultation with Circle IFA has been delegated to Heads of Circles. However such customers will not be eligible for any value additions like free pick up etc.
 
2.Customers may be allowed to pledge NSC Certificate for the amount equivalent to four months of expected business in lieu of Bank Guarantee.
 
3. The period of agreement signed between Department of posts and customer has been enhanced to two years subject to the condition that the Bank Guarantee be valid for three years from the date of agreement.
Click here to view the original OM no 57-02/2010-BD&MD dated 13.04.2012

Manner of Delivery of Speed Post Articles containing Passports

It has been decided by the Ministry of External ffairs New delhi that the present modality of delivering the speed post artilce containing Pass port"either to the addressee or his/her authorised representative on behalf of the addressee" is the most viable on and will be continued Passport delivery system. The said decision has been comminucated vide Department of Posts OM no: 57-01/2010-BD & MD dtd 11-04-2011. 
 
 
CLICK HERE to view the said OM in original.

SB Order no 05/2012: Revision of Interest Rate in RD , VIII and IX Year NSC


SB Order No.05/2012
 No.113-01/2011-SB
Government of India
Ministry of Communications & IT
Department of Posts
Dak Bhawan, Sansad Marg,
New Delhi-110001.
Date: 19.04.2012
To
All Heads of Circles/Regions
Addl. Director General, APS, New Delhi.
Subject:- Revision in Interest Rates of Small Savings Schemes w.e.f 1st April 2012.

Sir / Madam, 
The undersigned is directed to refer to this office SB Order No.4/2012 vide which it was conveyed that 
MOF(DEA) vide its OM No. 6-1/2011-NS-II (Pt.) dated 26.03.2012, has revised interest rates of Small Savings Schemes from 1st of April 2012. Revise interest rates were also conveyed. 
2. It is further informed that maturity value of a 5 Years RD account opened on or after 1.4.2012 with monthly deposit of Rs.10/- shall be Rs.746.51 and in case of 5 Years NSC VIII-Issue, maturity value of a 
certificate of Rs.100/- purchased on or after 1.4.2012 shall be Rs. 152.35 after 5 years. In case of 10 Years NSCIX-Issue, maturity value of a certificate of Rs.100/- purchased on or after 1.4.2012 shall be Rs.238.87. 
3. This is for information of the field staff as well as general public and Notifications will be circulated as an received from MOF(DEA). 
4. This issues with the approval of DDG(FS) 
Yours faithfully,
(Kawal Jit Singh)
Assistant Director (SB)
Copy to:-
1. DDG(FS)/DDG(VIG)/JS&FA/DDG(PAF)/DDG(RB)/DDG (Estt.)/DDG(PG & Inspections)/DDG (PCO)
2. Director (FS)/Director (CBS), Dak Bhawan.
3. Director of Audit (P&T), Delhi.
4. Resident Audit Officer, Room No.517-B, Dak Bhawan, New Delhi.
5. All Directors/Dy. Directors of Accounts, Postal
6. Director, Postal Staff College, Ghaziabad.
7. All Directors, Postal Training Centres.
8. Director PTC Mysore for uploading the SB order on India Post Web Site.
9. A.D (Tech), SDC Chennai O/o CPMG T.N.Circle, Chennai.
10. AD /Inspection/PF/Vigilance
11. All Accounts Officers ICO(SB)
12. All recognized unions.
13. MOF(DEA), NS-II, North Block, New Delhi
14. Director, NSI, CGO Complex,’A’Wing, 4th Floor, Seminary Hills, Nagpur-440006
15. PS to Member (T)
16. PPS to Secretary Posts

Trai: One paisa per second plan mandatory


NEW DELHI: The Telecom Regulatory Authority of India (TRAI) has asked all service providers to ensure that they offer their customers atariff plan of one paisa per second along with other offerings.

The regulator in a tariff amendment order said it had become "mandatory" for service providers to offer in each service area at least one tariff plan each for both postpaid and prepaid subscriber with a uniform pulse rate of 'one second'.

"The service providers will be at liberty to offer alternative tariff plans with any pulse rate within the overall ceiling of 25 tariff plans," TRAI said in a statement.

The rates for premium rate services currently levied by service providers are substantially higher as compared to the normal tariff applicable for a two-way communication due to the fact that the charges levied also include the price for content.

Keeping in view the fact that calls and SMS made for participating in competition and voting hardly contain any content, TRAI's Telecommunication Tariff (Fifty First Amendment) Order 2012 also mandated that tariff for such calls and SMS shall not exceed four times of the applicable local call or SMS charges.

The amendment also provides flexibility to service providers to applyrevision in international long distance tariff uniformly for new as well as existing subscribers.

TRAI had issued a consultation paper in October last year on "Certain issues relating to Telecom Tariff" seeking views of stakeholders.

Most of the operators opposed when asked if one standard plan for all service providers particularly for a prepaid subscriber would be relevant in the present scenario of Indian telecom market.

The regulator has also retained the existing cap of 25 tariff plans that can be offered by access service providers including post-paid and pre-paid.

Source -TOI