Tuesday, December 4, 2007

How do you select Top 3 records from your database

How do you select Top 3 records from your database

    Step 1

    To select top 3 records from all you need to do is issue this command in SQL Analyzer

    Select top 3 * from employees

    Step 2

    You can use a number to denote the number of records to return or percentage to do it.

    Select top 30 percent * from employees

    An example of screen layout is shown below:

    Edited By:Melanie Michael Jominin

© 2001 ISC/Inner Esteem

All rights reserved. All other product names and trademarks are registered properties of their respective owners.

301001

How to find the status and information of connected servers in your MSSQL Server

How to find the status and information of connected servers in your MSSQL Server

Step 1

To find the information of servers connected to MS SQL Server, go to SQL Analyzer and then issue the following command

Exec sp_helpserver

It will reveal status of servers and replication connected to MS SQL Server.

What is the difference between a remote server and a linked server

What is the difference between a remote server and a linked server

Remote Server is recognized and use by SQL server for replication task. Link Server are registered SQL Server from another machine.

How do I pass Query to Linked Server

How do I pass Query to Linked Server

Step 1

To pass query to linked server, user can choose to use this command

SELECT * FROM jaguar.northwind.dbo.employees

Or

SELECT *

FROM OPENQUERY(jaguar, 'SELECT * FROM northwind.dbo.employees')

GO

in SQL Analyzers

Both of these command will return data results from a linked server called Jaguar.