Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Problem with update statistics, ASE 11.5.1.1

4 posts in Windows NT Last posting was on 2000-11-04 17:55:19.0Z
Fredrik Wallin Posted on 2000-11-02 14:04:08.0Z
From: "Fredrik Wallin" <fredrik.wallin@wmdata.com>
Subject: Problem with update statistics, ASE 11.5.1.1
Date: Thu, 2 Nov 2000 15:04:08 +0100
Lines: 8
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <IG#YjfNRAHA.273@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: spencer.wm.net 194.18.224.226
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1525
Article PK: 1089000

I´ve tried to create a procedure that uses the update statistics command.
I´ve got syntax problem when I try to pass an argument to update statistics
i.e. UPDATE STATISTICS @tablename. Is it impossible to do this?

Fredrik Wallin


Bret Halford Posted on 2000-11-02 16:29:43.0Z
Message-ID: <3A019677.4A99F026@sybase.com>
Date: Thu, 02 Nov 2000 09:29:43 -0700
From: Bret Halford <bret@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.5 [en]C-CCK-MCD (WinNT; I)
X-Accept-Language: en,ja
MIME-Version: 1.0
Subject: Re: Problem with update statistics, ASE 11.5.1.1
References: <IG#YjfNRAHA.273@forums.sybase.com>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 14
NNTP-Posting-Host: bret-pc.sybase.com 157.133.80.211
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1524
Article PK: 1088998

Well, it is impossible to do it directly, as UPDATE STATISTICS does not support
variable
substitution. However, there are Dynamic SQL Techniques you can use to
accomplish this,
see Rob's notes at http://www.sypron.nl/dynsql.html

-bret

Fredrik Wallin wrote:

> I´ve tried to create a procedure that uses the update statistics command.
> I´ve got syntax problem when I try to pass an argument to update statistics
> i.e. UPDATE STATISTICS @tablename. Is it impossible to do this?
>
> Fredrik Wallin


Rob Verschoor Posted on 2000-11-02 21:54:58.0Z
Reply-To: "Rob Verschoor" <rob@sypron.nl>
From: "Rob Verschoor" <rob@sypron.nl>
References: <IG#YjfNRAHA.273@forums.sybase.com> <3A019677.4A99F026@sybase.com>
Subject: Re: Problem with update statistics, ASE 11.5.1.1
Date: Thu, 2 Nov 2000 22:54:58 +0100
Lines: 40
Organization: Sypron B.V.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <QVPpklRRAHA.273@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: i0295.pvu.euronet.nl 194.134.165.40
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1520
Article PK: 1088995


> Fredrik Wallin wrote:
>
> > I´ve tried to create a procedure that uses the update statistics
command.
> > I´ve got syntax problem when I try to pass an argument to update
statistics
> > i.e. UPDATE STATISTICS @tablename. Is it impossible to do this?

"Bret Halford" <bret@sybase.com> wrote in message
news:3A019677.4A99F026@sybase.com...
> Well, it is impossible to do it directly, as UPDATE STATISTICS does
not support
> variable
> substitution. However, there are Dynamic SQL Techniques you can use
to
> accomplish this,
> see Rob's notes at http://www.sypron.nl/dynsql.html

Or rather, try sp_rv_update_statistics from
http://www.sypron.nl/new_ssp_man.html . This one is practically
useable; the one at the page quoted by Bret is more demo thing, which
is not very useful in practice.

HTH,

Rob
----------------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 12.0
Certified Sybase Professional DBA/SQL Developer for ASE 11.5
Certified DBA/Performance & Tuning Specialist for Sybase System 11

email mailto:rob@sypron.nl.*No*Spam*Please*
WWW http://www.sypron.nl
snail Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
----------------------------------------------------------------------


Anonymous Posted on 2000-11-04 17:55:19.0Z
From: Anonymous@sybase.com
Date: Sat, 4 Nov 2000 12:55:19 -0500
Newsgroups: sybase.public.sqlserver.nt
Subject: Re: Problem with update statistics, ASE 11.5.1.1
Message-ID: <D2D42C3367652BA7006272D08525698D.00523E238525698B@webforums>
References: <IG#YjfNRAHA.273@forums.sybase.com>
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:1516
Article PK: 1089007

Another option is to do it in a script. Read the tables from
sysobjects into a file or create a file with table names in
mind, then read tables from file and run update stats on them.