|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to check whether column exist or not in a table?
Hi,
I want to check whether a particular column exist or not in a given table. This i want to check before dropping the column so no error comes if column is not present. So please can anybody tell me how i do this? Exmple: --How to do: check if column exist -- if exist ALTER table table_name DROP COLUMN column_name Thanks Umesh Sharma |
|
#2
|
|||
|
|||
|
Depends on which DBMS you are using but I question the rationale for having this type of functionality. Changing the data model should not be done in run time.
|
|
#3
|
|||
|
|||
|
I want it for MS-Access Database
Hi:
I need an sql query/statement to check whether a specific column exists or not in MS-Access Database's Table. Thanks, Sriram. |
|
#4
|
|||
|
|||
|
Query to check whether column exists in a table
Hi,
I think, this is the query which you are searching SELECT c.name FROM syscolumns c, sysobjects t WHERE c.id = t.id AND t.name = 'table_name' AND c.name = 'column_name' Cheers Disha Quote:
|
|
#5
|
||||
|
||||
|
disha, that's sql server, yes? sriram is using microsoft access
however, sriram may not need it any more, since the question is 6 months old by the way, you quoted umesh, but umesh asked the original question over 5 years ago nice try anyway, though ![]() |
|
#6
|
|||
|
|||
|
This is nice to this thread active for so long
![]() Quote:
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > How to check whether column exist or not in a table? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|