Sybase Question: Download Questions PDF
How To Change varchar(m) to varchar(n) in Sybase?
Answer:
Before you start:
select max(datalength(column_name))
from affected_table
In other words, please be sure you're going into this with your head on straight.
How To Change System Catalogs
This information is Critical To The Defense Of The Free World, and you would be Well Advised To Do It Exactly As Specified:
use master
go
sp_configure "allow updates", 1
go
reconfigure with override /* System 10 and below */
go
use victim_database
go
select name, colid
from syscolumns
where id = object_id("affected_table")
go
begin tran
go
update syscolumns
set length = new_value
where id = object_id("affected_table")
and colid = value_from_above
go
update sysindexes
set maxlen = maxlen + increase/decrease?
where id=object_id("affected_table")
and indid = 0
go
select max(datalength(column_name))
from affected_table
In other words, please be sure you're going into this with your head on straight.
How To Change System Catalogs
This information is Critical To The Defense Of The Free World, and you would be Well Advised To Do It Exactly As Specified:
use master
go
sp_configure "allow updates", 1
go
reconfigure with override /* System 10 and below */
go
use victim_database
go
select name, colid
from syscolumns
where id = object_id("affected_table")
go
begin tran
go
update syscolumns
set length = new_value
where id = object_id("affected_table")
and colid = value_from_above
go
update sysindexes
set maxlen = maxlen + increase/decrease?
where id=object_id("affected_table")
and indid = 0
go
Download Sybase Interview Questions And Answers
PDF
Previous Question | Next Question |
How can you change to get the decimal separator as comma instead of the decimal point (.)? | Does Sybase support Row Level Locking? |