Wednesday, August 17, 2011

How to: Modify Column Data Types (Visual Database Tools)

To modify the data type of a column


1.In Object Explorer, right-click the table with columns for which you want to change the scale and click Design.
The table opens in Table Designer.

2.Select the column for which you want to modify the data type.

3.In the Column Properties tab, click the grid cell for the Data Type property and choose a new data type from the drop-down list.

The new data type is assigned to the column after you click outside the grid cell or use the TAB key to move to another grid cell. It takes effect in the database when you save your changes in Table Designer.

Some time it does not work. Especially if there is a table dependancy (constraints ) and data.
So that time, run the script.

ALTER TABLE table ALTER COLUMN column_name new_data_type


Example .
ALTER TABLE MyTable ALTER COLUMN MyColumn NVARCHAR(100)

Saturday, August 6, 2011

Get job in TCS ... Just in INR 14,700..... Beware of spam emails...


Hard to believe but it's true, people started this business. Today morning,  I received email stating the same.
According to email,  I suppose to deposit a cash of 14,700/-(Fourteen thousand Seven hundred rupees) as an initial amount, and I'll get guaranteed job in TCS.

In order to, aware people around and request not to believe in all these craps. Immediately report, If you come across any consultancy\agency doing business , putting all these toppings of deposit security amount.
Exactly, gluing the email, I received.


Here's the email detail

fromtataconsultancy Service tataconsultancyservice_2011@hotmail.com
reply-totataconsultancyservice_2011@hotmail.com
toinfo@tata.com
dateSat, Aug 6, 2011 at 3:51 AM
subject Dear Applicant...


Tata Consultancy Services(TCS)
5th Floor, PTI Bldg., 4, Parliament
Street New Delhi - 110 001.
Email:tataconsultancyservice_2011@hotmail.com

REF: "TATA CONSULTANCY SERVICE" DIRECT RECRUITMENTS OFFER.

Your Resume has been selected from JOB SEEKERS DATA BASE for our new plant. The
Company selected 62 candidates list for Senior Engineer, IT, Administration,
Production, marketing ,Retail and general service Departments. It is our pleasure to inform
you that your Resume was selected as one of the 62 candidates shortlisted for the interview.

Tata Consultancy Services(TCS)  is involved for Senior Engineer, IT, Administration,
Production, marketing ,Retail and general service Departments in India; The
Company is recruiting the candidates for our new plants in Delhi, Bangalore, Pune.Hyderabad
Kolkata ,Chennai and Mumbai. Your interview will be held at The Company Corporate office in
New Delhi on 21th Of August at 11.30am, we are  pleased to inform you that the
62 candidate’s selected 56 candidates will be giving appointment, meaning your Application can be in progress to the final stage. You will have to come to the Company corporate office in New Delhi. Your offer letter with Air Ticket will be sent to you by courier before date of interview. The Company can offer you a salary with benefits for this post 65, 000/- to 200, 000/- P.M. + (HRA + D.A + Conveyance
and other Company benefits. The Designation and Job Location will be fixing by Company HRD. At time of final process. You have to come with photo-copies of all required documents.

REQUIRED DOCUMENTS BY THE COMPANY HRD
======================================
1) Photo-copies of Qualification Documents.
2) Photo-copies of Experience Certificates (If any)
3) Photo-copies of Address Proof
4) Two Passport
======================================
1. Full Names:
2. Contact Address:
3. Mobile Number:
4. Sex:
5. Age:
======================================
You are to deposit a cash of 14,700/-(Fourteen thousand Seven hundred rupees) as an initial amount in favour of our Company accountant name in charges to collect your payment. Payment for the Rs. 14,700/- (Fourteen thousand Seven hundred rupees) through any [STATE BANK OF INDIA]
(AXIS BANK) OR [ICICI BANK] Branch from your Home City to our Company accountant name in charge. Account NO,  which will be sending to you upon your response. This is a refundable interview security deposit.  Your offer letter With Air tickets will be send to your Home Address by courier after receiving  The confirmation of interview security deposit. This Company will pay all the expenditure to you at the time of face-to-face meeting with you in our corporate office. The Job  profile, salary offer, and date -time of interview will be mention in your offer letter.
Your offer letter will dispatch very shortly after receiving your confirmation of cash deposited in STATE BANK OF INDIA,AXIS BANK OR ICICI BANK. We wish you the best of  luck for the subsequent and remaining stage. The last date of security deposited in  bank  13th Of August 2011 you have to give the information after deposited the Security amount in bank to the Company HRD -direct recruitment via email.

Your Letter with supporting document will be dispatch same time by courier to your postal address after receipt of security deposit confirmation in bank. The interview process and arrangement expenditure will be paid by Tata Consultancy Services(TCS). Lodging, travelling and local conveyance actual will be paid by Tata Consultancy Services(TCS) as per  bills. The candidate has to deposit the initial refundable security as mentioned by HRD.
NB: You are advice to reconfirm your mailing address and phone number in
your reply. And 14,500/- (Fourteen thousand Five hundred rupees) will be the refundable
Amount, as 200 rupees will be deducted as bank charges for funds deposit. And if
you are been selected or not, still the amount will be refunded to you, as the amount
is just to prove that you will be coming for the interview in order for us not to run at
lost after sending you the air ticket and you don't show up on the day of interview.
Wishing you the best of lucks.


Regards,
Mr.Sai Kumar Patil
SENIOR H.R MANAGER


Please be aware of this kind of emails. And please help me to let other people aware. Immediately report,  if by chance, anyone of you come to know about  the originators of this kind of business.

I heard, another fraud agency of this kind was doing the similar business , in the name of Wipro.

Big Giant like Wipro and TCS has a moral responsibility for society to find out the agencies doing this sort of business or at least make people aware about the frauds (using their reputed names).

Even though, I'm educated, but at first instance, reading first paragraph, It impress me like it's through HR TCS. Later on,  I understood this is a spam. Imagine the desperate and a person-in-need could definitely  believe on this.

If you read the email carefully, you would find it funny, indeed. I'll help you by highlighting the stuffs.
"Your offer letter with Air Ticket will be sent to you by courier before date of interview."
wow , great deal isn't it. But very hard to believe.

Look the document this stupid required.

REQUIRED DOCUMENTS BY THE COMPANY HRD
======================================
1) Photo-copies of Qualification Documents.
2) Photo-copies of Experience Certificates (If any)
3) Photo-copies of Address Proof
4) Two Passport
======================================
Great, they need two passport of mine.

Look at this, now they need money.

"You are to deposit a cash of 14,700/-(Fourteen thousand Seven hundred rupees) as an initial amount in favour of our Company accountant name in charges to collect your payment. Payment for the Rs. 14,700/- (Fourteen thousand Seven hundred rupees) through any [STATE BANK OF INDIA] (AXIS BANK) OR [ICICI BANK] Branch from your Home City to our Company accountant name in charge. Account NO, which will be sending to you upon your response."

Read more,

"Your offer letter will dispatch very shortly after receiving your confirmation of cash deposited in STATE BANK OF INDIA,AXIS BANK OR ICICI BANK"

"This Company will pay all the expenditure to you at the time of face-to-face meeting with you in our corporate office."


Please help society to find out the existence of these kind of people or business. TCS, WIPRO must have done something as their reputed name has been used. Here's they are directly using the TCS office corporate office address.

I'm jotting all this to aware people around and request not to believe in all these craps. Immediately report, if you come across any consultancy\agency doing such business (of putting all the toppings) of deposit security amount. I know there are so many consultancy running, who ask you to deposit some money to provide job.

If any responsible body is seriuos and would really like to investigate against these sort of fake agencies to expose them . Being a responsible  citizen I can help by forward the email which I have received today itself
(6th Aug 2011).

 
One last request , dont believe in all these. Just believe in your self  and apply for job online.

Enjoy and Good Wishes.


Friday, August 5, 2011

SCOPE_IDENTITY() vs. @@IDENTITY - Retrieving Identity for Most Recently Added Row in Table

Returns the last identity value inserted into an identity column in the same scope. A scope is a module: a stored procedure, trigger, function, or batch. Therefore, two statements are in the same scope if they are in the same stored procedure, function, or batch.



SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY are similar functions because they return values that are inserted into identity columns.
IDENT_CURRENT is not limited by scope and session; it is limited to a specified table. IDENT_CURRENT returns the value generated for a specific table in any session and any scope. For more information, see IDENT_CURRENT (Transact-SQL).
SCOPE_IDENTITY and @@IDENTITY return the last identity values that are generated in any table in the current session. However, SCOPE_IDENTITY returns values inserted only within the current scope; @@IDENTITY is not limited to a specific scope.
For example, there are two tables, T1 and T2, and an INSERT trigger is defined on T1. When a row is inserted to T1, the trigger fires and inserts a row in T2. This scenario illustrates two scopes: the insert on T1, and the insert on T2 by the trigger.
Assuming that both T1 and T2 have identity columns, @@IDENTITY and SCOPE_IDENTITY will return different values at the end of an INSERT statement on T1. @@IDENTITY will return the last identity column value inserted across any scope in the current session. This is the value inserted in T2. SCOPE_IDENTITY() will return the IDENTITY value inserted in T1. This was the last insert that occurred in the same scope. The SCOPE_IDENTITY() function will return the null value if the function is invoked before any INSERT statements into an identity column occur in the scope.
Failed statements and transactions can change the current identity for a table and create gaps in the identity column values. The identity value is never rolled back even though the transaction that tried to insert the value into the table is not committed. For example, if an INSERT statement fails because of an IGNORE_DUP_KEY violation, the current identity value for the table is still incremented.

SELECT @@IDENTITY
It returns the last IDENTITY value produced on a connection, regardless of the table that produced the value, and regardless of the scope of the statement that produced the value.
@@IDENTITY will return the last identity value entered into a table in your current session. While @@IDENTITY is limited to the current session, it is not limited to the current scope. If you have a trigger on a table that causes an identity to be created in another table, you will get the identity that was created last, even if it was the trigger that created it.
SELECT SCOPE_IDENTITY()
It returns the last IDENTITY value produced on a connection and by a statement in the same scope, regardless of the table that produced the value.
SCOPE_IDENTITY(), like @@IDENTITY, will return the last identity value created in the current session, but it will also limit it to your current scope as well. In other words, it will return the last identity value that you explicitly created, rather than any identity that was created by a trigger or a user defined function.
SELECT IDENT_CURRENT(‘tablename’)
It returns the last IDENTITY value produced in a table, regardless of the connection that created the value, and regardless of the scope of the statement that produced the value.
IDENT_CURRENT is not limited by scope and session; it is limited to a specified table. IDENT_CURRENT returns the identity value generated for a specific table in any session and any scope.
To avoid the potential problems associated with adding a trigger later on, always use SCOPE_IDENTITY() to return the identity of the recently added row in your T SQL Statement or Stored Procedure.



@@IDENTITY to retrieve the identity of the most recently added row in a table.  Although this is one of those common practices in SQL Server 7, which does not have a SCOPE_IDENTITY()function, it is no longer the accepted way to get the identity of the most recently added row in a table in SQL Server 2000 and SQL Server 2005.
@@IDENTITY returns the most recently created identity for your current connection, not necessarily the identity for the recently added row in a table.  You could have a situation where there is a trigger that inserts a new record in a Logs Table, for example, when your Stored Procedure or INSERT SQL Statement inserts a record in the Orders Table.  If you use@@IDENTITY to retrieve the identity of the new order, you will actually get the identity of the record added into the Log Table and not the Orders Table, which will create a nasty, nasty bug in your data access layer.
To avoid the potential problems associated with someone adding a trigger later on, always use SCOPE_IDENTITY() to return the identity of the recently added row in your INSERT SQL Statement or Stored Procedure.

Health Benefits of Cashews

  Benefits of Cashews. Healthy food is an integral part of healthy body. Regular exercises such as Yoga and healthy diet is important to...