Sybase ADDICT

Sybase tips, howto and technical informations – All in a blog !
  • Home
  • Sybase Downloads
  • Sybase Related Links
  • Sybase Jobs


  


  • List tables with allpages or datarows locking scheme

    February 4th, 2011 @ 2:26 PM by Jean-Francois LEBON | Be the 1st to comment

    To list the tables that use datapages or datarows locking scheme, use:

    select name,sysstat2
    from sysobjects
    where type = 'U'
    and (sysstat2 & 16384 = 16384 or sysstat2 & 32768 =32768)

    To list tables that use allpages locking scheme, use:

    select name,sysstat2
    from sysobjects
    where type = 'U'
    and sysstat2 & 8192 = 8192

    Tags: sybase, Sybase Adaptive Server Enterprise, transact-sql

  • Find and delete duplicates records

    August 29th, 2010 @ 5:07 PM by Jean-Francois LEBON | Be the 1st to comment

    Wonder how to display or delete duplicate records ? Sometimes, under certain circumstances duplicate data may occur. Then it should be deleted.

    In this example, we are going to create a dummy table with an identity column as a unique key, and with two varchar columns. Then we are going to insert data and duplicates manually. The script for the test comes as follow:

    create table dummytable(
    keycolumn   numeric(5,0) identity,
    column1     varchar(10),
    column2     varchar(10)
    )
    go
    
    insert dummytable(column1,column2) values("AAA","AAA")
    go 10
    (1 row affected)
    10 xacts:
    
    insert dummytable(column1,column2) values("AAA","BBB")
    go
    (1 row affected)
    
    insert dummytable(column1,column2) values("BBB","BBB")
    go
    (1 row affected)
    
    insert dummytable(column1,column2) values("BBB","AAA")
    go
    (1 row affected)

    Read more…


    Tags: ase, howto, sql, sybase, Sybase Adaptive Server Enterprise, tips, transact-sql

  • Sybase sql stored procedures to use MDA tables

    May 1st, 2010 @ 11:56 PM by Jean-Francois LEBON | Be the 1st to comment

    MDA tables are very useful to understand what’s going on within your dataserver, so you can carry out accurate and successful performance and tuning campaigns. In this post I publish few basic Sybase stored procedures to use with MDA tables that focus on databases objects activity only (but I may release more MDA stored procedures in the future).

    If you haven’t installed yet MDA tables in your Sybase Adaptive Server, you can refer to my previous post HowTo install MonTables to install them. Read more…


    Tags: sql, sybase, Sybase Adaptive Server Enterprise, transact-sql

  • Is DIRECT IO supported for Sybase ASE v15 on your platform ?

    April 2nd, 2010 @ 3:39 PM by Jean-Francois LEBON | Be the 1st to comment

    This sql query tells you if Direct IO is supported on your platform:

    select low from spt_values
    where  type='io'

    A value of 1 means “Yes, direct io is supported on this platform”.
    A value of 0 means “No, direct io is NOT supported on this platform”.

    Read this nice post from David Wein about Direct I/O device option.


    Tags: ase, howto, sql, sybase, Sybase Adaptive Server Enterprise, tips, transact-sql

  • Tell what platform Sybase ASE is running on, with a sql query

    March 31st, 2010 @ 8:17 PM by Jean-Francois LEBON | 1 Comment

    Want to know what platform your Sybase Adaptive Server is running on ? No need to connect to the machine to find out, just run this little query:

    select name from master..spt_values
    where type = 'E' and number = 1
    go

    For me it shows:

    name
    --------------------------------------------------------
    linux

    Nice…


    Tags: ase, howto, sql, sybase, Sybase Adaptive Server Enterprise, tips, transact-sql

« Previous Entries



Categories:

  • Review
  • Sybase Adaptive Server Enterprise
  • Sybase Adaptive Server IQ
  • Sybase Articles
  • Sybase HowTo
  • Sybase News
    • End of Life Notice
    • General News
  • Sybase Replication Server
  • Sybase Tips & Tricks
  • Sybase Transact-SQL Code
  • Videos/Podcasts/Webcasts

Quick Links:

  • Sybase quick refence
  • Sybase Bookmarks
  • Sybase Team Forums
  • Sybase Inc
  • International Sybase User Group
  • CodeXchange
  • SQL Anywhere question and answer
  • Sybase Jobs [US]
  • You need a Sybase DBA

Archives:

  • February 2011
  • January 2011
  • October 2010
  • August 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • January 2009
  • December 2008
  • October 2008
  • September 2008
  • May 2008
© Sybase-ADDICT.com - All Rights Reserved. Entries RSS Comments RSS sybase addict