0

Anyone can explain , query for sybase database state ?

for this

am tried below query , but its not working..

select name from sysdatabases where status2='..'

selvackp
  • 1
  • 2
  • 9

1 Answers1

0

status2 is an smallint datatype, so using quotes to find a value will give you a syntax error. You need to specify either a number, or range of numbers (without quotes) to get the query to return.

select name from sysdatabases where status2 = 1

or

select name from sysdatabases where status2 in (0,1)

More information on sysdatabases can be found here: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36274.1550/html/tables/X42615.htm

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34
  • status2='..' i represents 1,2,4,8,16 .. values only i have to conform if there any other quries is for find sybase state ? – selvackp Jun 13 '13 at 12:48
  • `status` is also used to denote the database state. I'm updating the my answer to include a link to the `sysdatabases` table information. – Mike Gardner Jun 13 '13 at 12:56