Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Column adding and its postioning

Author  Topic 

aravindt77
Posting Yak Master

120 Posts

Posted - 2008-07-09 : 11:15:02

Hi,


My Table structure is like this

zookie
------
RolNo INT
Name NVARCHAR(100)
State NVARCHAR(100)
Country NVARCHAR(100)

-----------------------

I want to add a new column " Place NVARCHAR(100) "
through T-SQL Query

and after that the new colum will apend the existing columns
like this while opening the design view

instead of this i want this new column addition and
design view should like this

zookie
------
RolNo INT
Name NVARCHAR(100)
Place NVARCHAR(100)
State NVARCHAR(100)
Country NVARCHAR(100)
-----------------------

Means thru the SQL Query i want to add a new column and should have to specify its column order into order make it in the order

If anyone could know how to work out this ...
plz help me

Thanks & Regards

Arv

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-09 : 11:17:35
Why do you want to manipulate its ordinal position? You can very easily select data in the order you want while retrieving in SELECT statement.
Go to Top of Page

aravindt77
Posting Yak Master

120 Posts

Posted - 2008-07-09 : 11:20:33
Hi .. thanks for ur repsonse

actually i want to send the alter statements to the client site
so that i couldnt able to fetch the design phase .. only running the SQL Statements

Thanks

Arv
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-09 : 11:37:38
quote:
Originally posted by aravindt77

Hi .. thanks for ur repsonse

actually i want to send the alter statements to the client site
so that i couldnt able to fetch the design phase .. only running the SQL Statements

Thanks

Arv


didnt get that. fetch design phase?
Go to Top of Page

aravindt77
Posting Yak Master

120 Posts

Posted - 2008-07-09 : 11:41:31

Hi...
sorry for the mistake ... what i mean is that i cant access the design view of the table ... can only send the script for alter table which adds a new column .

so i want to make the script to change the column order position also

Hop you get me

Thanks

Arv
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-09 : 11:51:23
quote:
Originally posted by aravindt77


Hi...
sorry for the mistake ... what i mean is that i cant access the design view of the table ... can only send the script for alter table which adds a new column .

so i want to make the script to change the column order position also

Hop you get me

Thanks

Arv


nope...not fully. why do you want to change column position also. Its only during fetching of data that you need to be worried on order in which fields are retrieved and this can done by specifying the fields in whatever order you want them.
Go to Top of Page
   

- Advertisement -