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.