How can we add a column to a table without altering the
same?

Answers were Sorted based on User's Feedback



How can we add a column to a table without altering the same?..

Answer / shoaib

you can add new column by using CAST keyword.

Eg:

Suppose your existing table say #EMP contain the following
Columns:

empid,
empname,
empaddr

you want to add empsal columns.

Query:
select
empid,
empname,
empaddr,
(null as decimal(18,2))empsal
from #EMP
into #EMP1;

Is This Answer Correct ?    18 Yes 10 No

How can we add a column to a table without altering the same?..

Answer / sandip

Thanks Devraj.
But i just mean is their any way of adding colum without
using alter statement?

Is This Answer Correct ?    8 Yes 9 No

How can we add a column to a table without altering the same?..

Answer / sanjay rawat

In oracle,
1. take data in new table from existing table
2. add a new column in new table by using alter command
3. drop existing table
4. rename new table with existing table name
5. Check by select query

Is This Answer Correct ?    1 Yes 3 No

How can we add a column to a table without altering the same?..

Answer / devraj

In Oracle - create nother table with new column
2. insert complete data into this
3. drop orignal table
4. rename the created table to orignal table

Is This Answer Correct ?    12 Yes 26 No

Post New Answer

More Sybase Interview Questions

How would you fix a munged log in sybase ?

1 Answers  


What are triggers? Why do we use them? Diff types of triggers? What are magic tables?

1 Answers  


What is the difference between compression level 0 1nd 9

2 Answers  


List different types of locks in sybase?

1 Answers  


How can I tell the datetime my server started?

1 Answers  


Differences between clustered and non-clustered in sybase?

1 Answers  


What causes re-resolution of a stored procedure in sybase?

1 Answers  


What is the use of sp_helprotect in sybase?

1 Answers  


How to restore sybase database in sap?

1 Answers  


How do I make isql secure in sybase?

1 Answers  


How would you configure burn factor in sybase?

1 Answers  


What is the timestamp datatype in sybase?

1 Answers  


Categories