Sunday, 7 October 2012

How to Send a Message to Other Computers In Your Network with "net send" Command

Change the Startup type of the Messenger service to Automatic, and then start the Messenger service. To do this, follow these steps:
  1. Open Windows Explorer.
  2. In the left pane, right-click My Computer, and then click Manage.
  3. In the Computer Management window, expand Services and Applications in the left pane, and then clickServices.
  4. In the right pane, double-click Messenger.
  5. In the Messenger Properties (Local Computer) dialog box, click the General tab.
  6. On the General tab, select Automatic from the Startup type list, and then click Apply.
  7. Under Service status, click Start, and then click OK.
Here is step-by-step
1. Open a Command Prompt Window or DOS-box by Start >> Run type cmd press Enter.The Command Prompt Window show at bottom picture.

2. Type net send MICROSOF-7293a9 Hello guy or net send Hello guy and press Enter.
3. You will see the popup like the bottom picture if the message was successfully sent.

If your message sent to your friend's computer by change computer name or IP this popup will show at your friend's computer.For more information for this command type: NET SEND ?

Tuesday, 2 October 2012

How to import data from Excel to SQL Server Table?

Use Distributed Queries
If you do not want to configure a persistent connection to the Excel workbook as a linked server, you can import data for a specific purpose by using the OPENDATASOURCE or the OPENROWSET function. The following code samples also import the data from the Excel Customers worksheet into new SQL Server tables:

SELECT * INTO LIT FROM OPENROWSET ('Microsoft.Jet.OLEDB.4.0',                                                                               'Excel 8.0;Database=C:\test\xltest.xls',  'SELECT * FROM [Sheet1$]')

  • Remember that Excel object names that are appended with a dollar sign ($) represent worksheets (for example, Sheet1$) and that plain object names represent Excel named ranges.
  • In some circumstances, especially when you designate the Excel source data by using the table name instead of a SELECT query, the columns in the destination SQL Server table are rearranged in alphabetical order.

Tuesday, 18 September 2012

How to repair a Suspect Database in SQL Server

How to repair a Suspect Database in SQL Server


There can be a possibility that when you connect to an SQL Server Instance you will find the database being marked as SUSPECT. During such scenarios, you will not be able to connect to the database. In this article we will go through the steps which you need to follow to recovery a database which is marked as SUSPECT. The steps mentioned in this article works on SQL Server 2005 and higher versions.

Some of the reasons why an SQL Server database can be marked as SUSPECT

  1. 1. Database could have been corrupted.
    2. There is not enough space available for the SQL Server to recover the database during startup.
    3. Database cannot be opened due to inaccessible files or insufficient memory or disk space.
    4. Database files are being held by operating system, third party backup software etc.
    5. Unexpected SQL Server Shutdown, Power failure or a Hardware failure.
Due to a hardware failure one of our database namely BPO was marked SUSPECT when the SQL Server came back online. Already due to the hardware failure we had downtime for more than two hours and adding to that when the server came back online our mostly critical database was marked as SUSPECT.

Steps to Recover a Database Marked as SUSPECT

1. Execute the below mentioned TSQL code to identify all the databases which are marked as SUSPECT.
USE master

2. Open the latest SQL Server Error Log and check for errors logged for the database which is marked as suspect. You can open SQL Server Error Log by expanding Management Node à SQL Server Error Logs. In my server I could find below mentioned entries in SQL Server Error Logs.

Sample Error Messages within SQL Server Error Log when database is marked as SUSPECT
Starting up database 'BPO'.
Error: 9003, Severity: 20, State: 9.
The log scan number (189624:16:2) passed to log scan in database 'BPO' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Error: 3414, Severity: 21, State: 1.
An error occurred during recovery, preventing the database 'BPO' (database ID 10) from restarting. Diagnose the recovery errors and fix them, or restore from a known good backup. If errors are not corrected or expected, contact Technical Support.
CHECKDB for database 'BPO' finished without errors on 2009-12-15 11:30:28.320 (local time). This is an informational message only; no user action is required.
3. When a database is in SUSPECT mode you will not be able to get connected to the database. Hence you need to bring the database first in EMERGENCY mode to repair the database. Execute the below mentioned TSQL code to bring the database in EMERGENCY mode.
USE master
Once the database is in EMERGENCY mode you will be able to query the database.

Monday, 17 September 2012


iPhone 5 sends Apple juggernaut into overdrive

Apple's new iPhone 5 has already smashed sales records, sending the technology group’s shares to new highs and confounding criticism from those who were underwhelmed by the device.

"Although more consumers are opting for the pre-order method around new Apple product launches, we still expect long lines at stores this Friday," said Brian White, an anlyst at Topeka Capital Markets.
Shares in Apple touched a fresh high of $698.62 as they closed in on $700 mark . They have soared 70pc this year, punishing those who believed that a company that was close to bankruptcy in the late 1990s could not sustain its growth. With a value of $650bn it is now comfortably the world’s biggest company.
Although some investors warn Apple’s own success will eventually make it a victim of the 'law of big numbers’ – meaning it is harder to produce growth from a larger initial base – for now competitors are doing what they can to burst the iPhone 5 frenzy.
South Korea’s Samsung, Apple’s chief rival and the world’s biggest seller of smartphones, ran a series of adverts in US newspapers last weekend titled 'It doesn’t take a genius’ comparing the iPhone 5 to its own Galaxy S III.
The greatest hope for rivals may come from the pressure that demand for the device will exert on Apple’s global supply chain. Concern over supply has risen because the iPhone 5 is the biggest overhaul of the device in more than two years.


Who doesn’t benefit from keeping company of great men? It is like the droplets of water that shine like pearls when resting on a lotus bloom.