Wednesday, September 9, 2009

Solution to: The backup set holds a backup of a database other than the existing database

SQL Error: Error 3154: The backup set holds a backup of a database other than the existing database.

Here is the solution:

RESTORE DATABASE <dbname>

FROM DISK = '<dbname.bak file path on local machine>' /*e.g. 'c:\dbname.bak' */
WITH REPLACE

Tuesday, August 25, 2009

Beginner's Guide to Exchanging Links

Reciprocal linking is an effective, free way to get more visitors to your website. Exchanging links with other webmasters can help you in two ways. Firstly, by getting your link displayed on other websites you are increasing the number of paths leading back to your your own site. This in turn will increase the number of visitors. Secondly, exchanging links will increase the chances of getting your web page ranked more highly in the results returned by search engines. The reason for this is that for most search engines, the number of links pointing to a site plays a huge part in determining where that site ranks. Why? Well, wouldn't you be more likely to visit a place that had been recommended to you by a friend? The same reasoning applies to search engine positioning. A link from site A to site B is like a vote for site B. The more votes that site B gets, the higher it is regarded by search engines. However, quantity is not everything! A link carries more weight if it is from a high quality site - in the same way that a recommendation from a trusted friend would be taken more seriously than a recommendation from a casual acquaintance. If you have been reading up on the subject of search engine positioning, you may be familiar with the term "PR", or "Page Rank". Page Rank is Google's way of measuring the "importance" of a web page. In simple terms PR is a number between 1 and 10 and can be viewed by downloading the Google toolbar. It is easy to become hung up on or obsessed by page rank, but my advice is to try to take your focus away from that PageRank icon on the Google toolbar and focus your efforts instead on building up a good set of reciprocal links. If you do this well, the PR and search engine rankings will come. So, how do you start reciprocal linking? The first step is to find other sites that you want to link to. Use search engines and links from other websites to find sites that complement your own and try to request links from sites that you think would interest your visitors. You can find some linking directory resources to help you with your searching on http://www.articleshub.org/link-directory.asp Link Exchange Resources You may have been recommended to avoid linking with your direct competitors. Whether you do this or not is entirely up to you - the main disadvantage of doing this is the chance of losing business, whereas the advantage is the extra traffic that you will gain by doing so. Personally I feel that the additional traffic gained from linking to competitors outweighs the potential chance of losing business to them. Before you start your linking campaign here are a few tips to help you: (1) Ensure that there is a visible link to the "Links" directory on the index page of the site you are requesting the link from and that the links directory is organised. It's unlikely that your link will be found by visitors if it is one of the 100 links on an unorganised links page. (2) Follow the above rules for your own website - it's only fair. (3) Once you have found a page it is good manners to add a link to your own site before requesting a link from another. This way the webmaster of that site will know that you are serious and will be more likely to link back to your site. (4) Being highly organised whilst requesting links is also important. Using link management software to keep track of all your link requests and automatically add them to your web page literally halves the time taken to request and manage links. (5) Keep track of all the links you have requested, either through link management software or in a spreadsheet. Add the URL, date requested and contact information for all the links you have requested and update this everytime a link is approved or declined. This will help you to keep track of your reciprocal linking campaign and prevent you from looking stupid by requesting a link from the same site multiple times. (6) Use tools to help you decide which sites to link to and to help monitor your own progress. Tools that I use include: Alexa Toolbar Google Toolbar Link Popularity tool Finally, set yourself a goal to request a specific number of links per week or per month. Keep going until you meet this target. It may be boring, but once you get into the way of doing this, it will seem like second nature and you will start to reap the benefits in the form of increased traffic to your website!

Advantages of Stored Procedures

A stored procedure is simply a compiled database object that contains one or more T-SQL statements. Although SQL Server has many system-provided stored procedures, you can create your own. Creating your own stored procedures offers several advantages. Click Here to read them

Thursday, August 20, 2009

ServerVariables Reference

The ServerVariables collection is used to retrieve the server variable values

Syntax:
Request.ServerVariables (server_variable)

ALL_HTTP Returns all HTTP headers sent by the client. Always prefixed with HTTP_ and capitalized
ALL_RAW Returns all headers in raw form
APPL_MD_PATH Returns the meta base path for the application for the ISAPI DLL
APPL_PHYSICAL_PATH Returns the physical path corresponding to the meta base path
AUTH_PASSWORD Returns the value entered in the client's authentication dialog
AUTH_TYPE The authentication method that the server uses to validate users
AUTH_USER Returns the raw authenticated user name
CERT_COOKIE Returns the unique ID for client certificate as a string
CERT_FLAGS bit0 is set to 1 if the client certificate is present and bit1 is set to 1 if the cCertification authority of the client certificate is not valid
CERT_ISSUER Returns the issuer field of the client certificate
CERT_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size
CERT_SECRETKEYSIZE Returns the number of bits in server certificate private key
CERT_SERIALNUMBER Returns the serial number field of the client certificate
CERT_SERVER_ISSUER Returns the issuer field of the server certificate
CERT_SERVER_SUBJECT Returns the subject field of the server certificate
CERT_SUBJECT Returns the subject field of the client certificate
CONTENT_LENGTH Returns the length of the content as sent by the client
CONTENT_TYPE Returns the data type of the content
GATEWAY_INTERFACE Returns the revision of the CGI specification used by the server
HTTP_<HeaderName> Returns the value stored in the header HeaderName
HTTP_ACCEPT Returns the value of the Accept header
HTTP_ACCEPT_LANGUAGE Returns a string describing the language to use for displaying content
HTTP_COOKIE Returns the cookie string included with the request
HTTP_REFERER Returns a string containing the URL of the page that referred the request to the current page using an <a> tag. If the page is redirected, HTTP_REFERER is empty
HTTP_USER_AGENT Returns a string describing the browser that sent the request
HTTPS Returns ON if the request came in through secure channel or OFF if the request came in through a non-secure channel
HTTPS_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size
HTTPS_SECRETKEYSIZE Returns the number of bits in server certificate private key
HTTPS_SERVER_ISSUER Returns the issuer field of the server certificate
HTTPS_SERVER_SUBJECT Returns the subject field of the server certificate
INSTANCE_ID The ID for the IIS instance in text format
INSTANCE_META_PATH The meta base path for the instance of IIS that responds to the request
LOCAL_ADDR Returns the server address on which the request came in
LOGON_USER Returns the Windows account that the user is logged into
PATH_INFO Returns extra path information as given by the client
PATH_TRANSLATED A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping
QUERY_STRING Returns the query information stored in the string following the question mark (?) in the HTTP request
REMOTE_ADDR Returns the IP address of the remote host making the request
REMOTE_HOST Returns the name of the host making the request
REMOTE_USER Returns an unmapped user-name string sent in by the user
REQUEST_METHOD Returns the method used to make the request
SCRIPT_NAME Returns a virtual path to the script being executed
SERVER_NAME Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs
SERVER_PORT Returns the port number to which the request was sent
SERVER_PORT_SECURE Returns a string that contains 0 or 1. If the request is being handled on the secure port, it will be 1. Otherwise, it will be 0
SERVER_PROTOCOL Returns the name and revision of the request information protocol
SERVER_SOFTWARE Returns the name and version of the server software that answers the request and runs the gateway
URL Returns the base portion of the URL

Tuesday, August 18, 2009

Comparison of payment gateways in India

If you are an Indian startup and you have an e-commerce component to your application, you will need to review, evaluate and shortlist a payment gateway that can handle online payments via credit and debit cards.  And most likely this will not be an easy or fast process.  In its current form, there are just a handful of payment gateway service providers in India. Access to information related to a few them is non-existent on the web.

I'm hoping that this post will help folks to do an easy and quick comparison between the various service providers.

Before we move on to the comparison, let's consider some of the criteria that are important while evaluating a payment gateway:

1) Cost:

All payment gateways have an intial setup cost and then charge a small percentage of the transaction. Few have an annual maintainence cost (AMC) as well. The initial setup cost is a one time charge only and is mostly non-refundable. The annual maintainence cost is an annually recurring charge. The transaction cost (TDR)  is charge per transaction and is generally anywhere between 4-7% of the transaction amount. The higher the volume, the more you can negotiate the transaction cost.

2) Support:

How helpful and responsive is the service provider when you run into a problem ? Do they provide off hours support ?

3) Chargeback policy and disputes:

What is the policy for chargebacks and refunds ? What is the policy for disputes ?

4) Ease of Integration:

Does the service provider provide an easy way to integrate the gateway into your app ? Do they provide alternate means for integration if tomorrow your architecture changes for some reason ?

Beyond these basic criteria, you'll also need to consider additional factors (depending on your requirements) like – what credit cards / banks are supported by the payment gateway ? Do they provide mobile banking option ? What is their rate of successful transactions etc ?

One often raised point is why not use PayPal as your payment gateway ? After all, they provide a great API for integration, there are plenty of code samples already available and their rates are quite competitive.

Well, the reason why PayPal may not suit everyone's requirements is because they do not provide you the option to charge customers in Indian Rupees. If using one of the PayPal supported currencies meets the requirements of your app, great. If not, you'll need to consider using a payment gateway that will allow payments in Indian Rupees.

So, here's a comparison of the major Indian online payment gateways (had to publish as a PDF since the spreadsheet wont fit on the blog).  The list includes a comparison of CCAvenueDirecPay (operated by TimesMoney group), EBS (collaboration with Axis bank), ABC Payments (operated by IndiaMart), HDFCICICI Payseal andTransecute.

The troublesome part of it was trying to locate the correct pricing plans for the various payment gateways, especially for DirecPay, HDFC and ICICI. DirecPay, HDFC and ICICI for whatever stupid reason choose not to list their pricing plans on their websites. You need to contact them via email or snail mail (ICICI) with your business details and only then, based on the nature of your business, transaction volume etc. do they send you a pricing plan. Sheer incovenience — I mean, so much ground work to simply get info on their pricing plans ? Its been 3-4 days since I emailed DirecPay and HDFC for details about their plans and am yet to hear back from them.  I fail to see why they dont provide a simple price info on their website rather than to go through this archaic process.

The comparison document is by no means complete just due to the sheer difficulty in locating correct information on the web. I'm keeping this document 'live' – in the sense that if you have any input / update suggestions to add any additional payment gateway to the list or to update info related to any of the ones already listed in the document, please send them in to me and I will continue updating the document.

So which payment gateway should an Indian startup use ?

To begin with, you should obviously analyse the various payment gateways on some of the criteria that I listed above. On top of that, if you need to review data related to the success rate, average time to refund etc. for some of these gateways, I would suggest reviewing the statistics revealed by IRCTC – India's biggest e-commerce site. They release monthly data related to transactions and payments, which includes how much each payment gateway contributed in terms of number of transactions, the amount contributed by each as well as the number of days to refund etc. For instance, only 53% of the transactions using the HDFC gateway completed successfully while ICICI gateway handled 17% of all the transactions that were done on the IRCTC website. The data also provides great insight into what are some of the main banks / debit cards being used by customers. For instance, 8.10% of all net banking transactions were attempted by ICICI customers while only 0.32% of all transactions were done by Bank of India customers.

Based on my research, if I were to use an Indian payment gateway today, I would personally go with either CCAvenue or EBS – for the simple reason that they make it very easy to get the needed information, have good online documentation and support wide range of credit/debit cards. In case of the other providers, its like a black hole – you try to seek out information and become a customer — and they try to make it that much harder to access that information.

If you have used / worked with and Indian payment gateway, I'd like to know how your experience has been ? If you were to recommend one to others, which one would it be ?

Payment Gateways: compare pricing and other features


     
 Pricing & Purchase UTI BankCCAvenue Paypal2Checkout
 


 Pricing Options 1
Setup: Rs. 10000/-
TDR: 6%
AMC: Rs. 6000/-
Setup: Rs. 7500/-
TDR: 7%
AMC: Rs. 1200/-
Setup: NIL
TDR: 3.5%
AMC: NIL
Setup: Rs. 2000/-
TDR: 5.5%+$0.45
AMC: NIL
 Pricing Options 2
Setup: Rs. 20000/-
TDR: 5%
AMC: Rs. 6000/-
Setup: Rs. 25000/-
TDR: 5%
AMC: Rs. 2400/-
 Pricing Options 3
Setup: Rs. 25000/-
TDR: 4%
AMC: Rs. 6000/-
 Credit Card Accepted UTI BankCCAvenue Paypal2Checkout
 Visa Card
 Mastercard
 American Express
 Diners Club International
 JCB Card
 Citibank E-Cards
 Discover
 Netbanking & Others UTI BankCCAvenue Paypal2Checkout
 Centurion Bank of Punjab
 Citibank
 HDFC Bank
 ICICI Bank Ltd.
 IDBI Bank
 IndusInd Bank
 Kotak Mahindra Group
 Oriental Bank of Commerce
 Punjab National Bank (PNB)
 UTI Bank
 The Bank of Rajasthan
 YES Bank
 Paymate (Mobile Payment)
 Itz Cash
 Payment Withdraw Method UTI BankCCAvenue Paypal2Checkout
 Payment Withdraw MethodDirect deposit in UTI Account Direct deposit in any Indian Bank Account Manually Cheque Request or Direct Deposit in any US / Indian AccountsWire transfer in any Indian Bank Account or Direct Deposit in any US Accounts