Sunday, February 12, 2012

Changing Datatypes

Hi All,

I have a database that contains 25 tables. In these tables the character data was stored as nvarchar datatype. Since i am not using any unicode data and the space occupied by nvarchar is more , i want to change the datatype from nvarchar to varchar. I cannot do one by one since there are 25 tables and each table has atleast 10 columns of datatype nvarchar.

How can i change the datatype from nvarchar to varchar in all the tables. Should i use any cursors or is there any other way. I am newbie to SQL server i dont know how to use cursors.

Can u please guide me the steps to be followed to convert to varchar datatype.

Thank you.Hi All,

I have a database that contains 25 tables. In these tables the character data was stored as nvarchar datatype. Since i am not using any unicode data and the space occupied by nvarchar is more , i want to change the datatype from nvarchar to varchar. I cannot do one by one since there are 25 tables and each table has atleast 10 columns of datatype nvarchar.

How can i change the datatype from nvarchar to varchar in all the tables. Should i use any cursors or is there any other way. I am newbie to SQL server i dont know how to use cursors.

Can u please guide me the steps to be followed to convert to varchar datatype.

Thank you.|||Hi All,

I have a database that contains 25 tables. In these tables the character data was stored as nvarchar datatype. Since i am not using any unicode data and the space occupied by nvarchar is more , i want to change the datatype from nvarchar to varchar. I cannot do one by one since there are 25 tables and each table has atleast 10 columns of datatype nvarchar.

How can i change the datatype from nvarchar to varchar in all the tables. Should i use any cursors or is there any other way. I am newbie to SQL server i dont know how to use cursors.

Can u please guide me the steps to be followed to convert to varchar datatype.

Thank you.

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

Reply|||Create a cursor that goes through all the tables in the databases, looking at the table structure, and altering as necessary.|||

Quote:

Originally Posted by sandyboy

Should i use any cursors or is there any other way. I am newbie to SQL server i dont know how to use cursors.


You are saying to be a newbie to SQL server and dont know how to use cursors. and again u want to write cursors.

U should know the fundaments first of all .

And please don;t post the same question repeatedly.

Please follow the posting guidelines before posting.

consider it as first warning to you.

No comments:

Post a Comment