Tuesday, December 3, 2013

Language Errors You got to do without: #lesson 2 (Then & Than)



Hi Team,

I hope since my previous post, we’d use for with duration always.

Today, let me share the story of Then & Than.

They are one of the similar sounding words of English Language (or for the most, pronounced similarly); however, they’re used very differently.

Then (Adverb): It has multiple usage, but the most common of it is showing time (to show the order in which actions/tasks are performed): Once a TM has successfully completed the training, then we move them to Operations. (We also use it to show conditions: If you work in XYZ for 5 years, then you’ll be eligible for gratuity.)

670px-UseThenThan-Step-2Than (Conjunction): It is used only when we’ve to compare. When you are talking about a noun (thing, person, place or concept) being more, less, better, cooler, hotter, etc. in relation to another noun, the word than is necessary: The count of TMs in ABC is more than EFG C2C & Email.

And there goes my #lesson 2.

Additionally, on the day of Thanksgiving, I’d like to say  thank you  to all of you for bearing the Grammar Police Avatar of me and in turn help me to help us to make English better

Thursday, November 28, 2013

Language Errors You got to do without: #lesson 1 [For v/s Since]



Hi Team,

Greetings!

Yes, I’m back.J   And this time, with an effort to make our Language error free to a little extent.

English, the only language with which we communicate, is a wonderful language, but is also tricky. It is fraught with traps that we all frequently fall into. So, with this Learning Exercise, I hope to clear up a few of them. Thus, I’ll share 10 errors that we frequently make, and we should get rid off at the earliest.
So, all you XYZ-ians, brace yourself up; here comes the #lesson 1:

For, and not Since.

I’m sure you all have heard someone saying, “I’ve been working in XYZ since 3 years.”

Whenever we’ve to address duration, we make the mistake of using the preposition Since which is completely incorrect. It should be the preposition For. (Since is only used when we have the specific point in time when the action started: I’ve been working in XYZ since 2009.)

It rather should be, “I’ve been working in XYZ for 3 years.”

If you like please make comment or share this link.

Reference : Samrat Ghosh

Friday, July 12, 2013

SQL View & Indexed View



 What is view?

Basically view is virtual table and basically it used for
  • To provide a security mechanism that restricts users to a certain subset of data in one or more base tables.
  • To provide a mechanism that allows developers to customize how users can logically view the data stored in base tables.

What is Indexed View?

Indexed view is the clustered index that is created on view.

How to create view ?

To create view you need to use below statement
CREATE VIEW [VIEW NAME]
AS
SELECT ID1,ID2 FROM TABLE

How to create Index on View ?

CREATE UNIQUE CLUSTERED INDEX [IX_VIEW] ON [VIEWNAME]
(
[COLUMN NAME] [ASC/DSC]
)

Which index used when?

1)      Now suppose you have created one Index on empTable.EMPID and then you create view for this
2)      Now you have also create one cluster index for view on empTable.ID

Now Questions are....

Q1. Does the table use an index created on itself?
Q2. Does the view use an index created on itself?
Q3. Do both the queries use the same index? If yes, why? If no, why not?

Answer is very clear

Answer 1 :

When you select the record in table it will use IX_TABLE 

Answer 2

When you select the record in view it will use IX_TABLE

Answer 3

It will cost more time to refer view index (in simple query) so sql server use table index.

How can I force fully call Index View ?

By using NOEXPAND key word you can force the sql server to use Index view
SELECT Column1, Column2, ... FROMView1 WITH (NOEXPAND) WHERE

Share your feedback and if you have any question send me an email on viralpala@gmail.com


Monday, April 8, 2013

Is EXECUTE allowed with in User Define Function (UDF) in SQL server?


Is EXECUTE allowed with in User Define Function (UDF) in SQL server?


No, EXECUTE is not allowed within UDF and that’s why you cannot run dynamic SQL or Dynamic Query in the function.

When you try to run the EXECUTE in UDF you will get the error message


“Invalid use of 'EXECUTE' within a function”

So why SQL is not alllwoing EXECUTE with in UDF ?

Basically there is two reason for this.

1) Trust
2) Performance 


1) TRUST : 

 
Basically UDF is not design for Insert, update and delete and if SQL allow EXECUTE then with in that anyone can run that command. 


However you will thought that why Microsoft does not put validation on that like when you do Insert in EXECUTE and you run it from SP then it allowed and when you run it under UDF then they restrict you. 


Yes it is possible but it will slow the process and kill the purpose of UDF. 


2) Performance:

If Microsoft allowed EXECUTE then it will reduce the performance of UDF and whole idea behind UDF may not fulfill well. 


So what should you do to use Dynamic Query ? you should use Store Procedure for that.
 

Wednesday, February 27, 2013

Corporate Vocabulary:: One



Corporate Vocabulary:: One


11)   Ballpark (Pronounced as ball-park)

Meaning:
Noun: A baseball stadium or field.
Adjective(of prices or costs): Approximate; rough

Application: The ballpark figure of the TMs joining the next batch of coaching is 25.

22)   Leveraged Buyout(Pronounced as lev·er·aged buy·out).

Meaning:
Noun: The purchase of a controlling share in a company by its management

          Application: The idea of leveraged buyouts by the Company has proved to be a futile venture.

33)   Let's take this offline.

Meaning:
Let's discuss that after this meeting in private

           Application:      The requisites have been discussed in the board room, for the rest we’ll take              them offline

Feel free to send me your feedback on viralpala@gmail.com