2

I am using SMO to compare one database against another.

This compare utility is NOT using drop and replace type of logic, It's using ALTER statements.

So, when I compare one column against another and they are not equal, I need to generate an Alter statement.

In order to generate that Alter statement, I need to convert the Column.DataType to something in the realm of SQL.

I've been looking but haven't found anything that will convert a DataType into an SQL DataType string. Can someone help me out here?

1

1 Answer 1

0
DataType p = new DataType() ;
p.SqlDataType = SqlDataType.NVarChar;
p.MaximumLength = 200 ;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.