SELECT TOP 10
OrderID, CustomerID, EmployeeID, OrderDate
FROM dbo.Orders
e rispettivamente:
SELECT TOP 10 PERCENT
OrderID, CustomerID, EmployeeID, OrderDate
FROM dbo.Orders
Valgono ovviamente le clausole WHERE, etc...Oppure esiste SET ROWCOUNT
CREATE PROCEDURE SelectOrders
@RowCount int
AS
IF @RowCount IS NULL
SET @RowCount = 10
SET ROWCOUNT @RowCount
SELECT OrderID, CustomerID, EmployeeID, OrderDate
FROM dbo.Orders
WHERE EmployeeID = 5
ORDER BY OrderDate
From: http://www.devx.com/getHelpOn/10MinuteSolution/20564
Nessun commento:
Posta un commento