Showing posts with label smo. Show all posts
Showing posts with label smo. Show all posts

Monday, March 12, 2012

Retrieving data types is slow

Hello,

i'm using SMO to retrieve information from various databases. It works
well except for one thing. When I call the Column.DataType property to
get the SQL type of a column it takes a very long tine. I have a few
databases, each with some tables. There are about 75 columns I think.
If I just browse all columns with SMO and write each name if it not a
system one, it takes about 15 seconds (pretty much anyway). If I also retrieve the data type
it takes about one minute. Any ideas why? The server is a local one.

Thanksstarted reading Michiel's articles. The issue will be fixed shortly I think. Thanks anyway.

Wednesday, March 7, 2012

retrieve SQL Server version using SMO

How can I retrieve SQL Server version (SQL Server 2000 or 2005) using SMO ?, same manner as SERVERPROPERTY('ProductVersion')

ServerConnection object has a property ServerVersion, which can be used to determine the version of server connected.

|||Also take a look at the Server.Information class. This also carries a few properties, such as Version and VersionString, but also ProductLevel, and Edition.