was told it's available in sql2005, but didn't work when i tried it.
such as
USE AdventureWorks
GO
SELECT AVG(OrderQty)
FROM Sales.SalesOrderDetail TABLESAMPLE SYSTEM (40 PERCENT)
error message says incorrect syntax near key word 'percent'.I ran your example against SQL Server 2005 SP1 and it ran without
error, returning a value of 2.
Is there any chance your copy of Adventureworks was upgraded, and is
stuck in 80 compatibilty mode? You can check this using sp_helpdb.
Roy Harvey
Beacon Falls, CT
On 27 Apr 2006 10:19:57 -0700, "=== Steve L ==="
<steve.lin@.powells.com> wrote:
>was told it's available in sql2005, but didn't work when i tried it.
>such as
>USE AdventureWorks
>GO
>SELECT AVG(OrderQty)
>FROM Sales.SalesOrderDetail TABLESAMPLE SYSTEM (40 PERCENT)
>error message says incorrect syntax near key word 'percent'.|||hmm...i don't think it's the db version.
i'm wondering if anything configuration settings need to be turned on
for this to work? maybe?|||ah...ha...indeed. it's working now after changing compatibilty mode
No comments:
Post a Comment