Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Friday, March 23, 2012

Interface-less SMO?

One of the typical uses of DMO was to instantiate COM objects via t-sql either via stored procedures or ad-hoc submissions through Query Anaylzer/OSQL/ISQL. This allows me to construct helper scripts that have access to objects outside the SQL Server process space, and I don't have to create any application (console or gui) to do what I need.

It seems that SMO is not meant to be 'interface-less' as we could do with DMO, is this true? If this is the case, can we plan on either SMO being able to instantiate objects without an interface, or can we depend on DMO hanging around for a little while longer, while SMO "ramps up"?

Or, should I just start planning on learning how to create my own 'interface-less' objects via CLR, which seems to be the only choice (sofar)?

You should really consider using SMO in your own applications or via the new WIndows PowerShell. This will give you much more control, easier maintainance and coding compared to DMO.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Some tutorials on using SMO with PowerShell...

http://www.simple-talk.com/sql/database-administration/managing-sql-server-using-powersmo/

Dan

|||

The main reason I prefer DMO is that it's much easier to encapsulate it into t-sql and have it run from within sql server (job/sp/batchfile). I don't want to have to start writing applications to do what I used to be able to do with DMO.

As an example, I have an sp that gets executed via job; the sp uses DMO in it's body to determine the drive space information on the server and the job emails the resultset as an attachment. Very easy and tidy, one job and one sp.

Now that DMO is being deprecated, I have to get rid of my sp code and create an application, or invoke a powershell script instead of just running an sp and emailing the results as a text file. Can I do this same exact operation with SMO, and not require an application interface?

It just seems a bit odd, that something as core as the way DMO can be used without an interface isn't part of SMO... I can't be the only one out here who does things in this manner.

|||

Jens K. Suessmeyer wrote:

You should really consider using SMO in your own applications or via the new WIndows PowerShell. This will give you much more control, easier maintainance and coding compared to DMO.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

I'm a DBA looking to manage my servers without any more applications than neccessary, not a developer writing software...

|||

Powershell is designed for admins and by building T-SQl that calls DMO you are actually developing software.

Pause and think about what is happening in your scenario and why it will negatively impact the reliability of you server.

You are using T-SQL code to call the SQL Server oa(I presume) extended procedures, that provide a COM interface.

You are using that COM interface to call a large complex COM library whos primary function is to

Generate T-SQL and call SPs in the server through ODBC, performing T-SQL tasks.

If you are going to do this why not write it in T-SQL as SPs in the server in the first place, or if you want an easier API then use PowerShell or VB.Net to call SMO from outside the server.

|||

Euan Garden wrote:

Powershell is designed for admins and by building T-SQl that calls DMO you are actually developing software.

Pause and think about what is happening in your scenario and why it will negatively impact the reliability of you server.

You are using T-SQL code to call the SQL Server oa(I presume) extended procedures, that provide a COM interface.

You are using that COM interface to call a large complex COM library whos primary function is to

Generate T-SQL and call SPs in the server through ODBC, performing T-SQL tasks.

If you are going to do this why not write it in T-SQL as SPs in the server in the first place, or if you want an easier API then use PowerShell or VB.Net to call SMO from outside the server.

It is "tough" to re-write in TSQL what SMO *already* have. We (DBAs with large number of server / databases) used DMO out-of-the box and yes sp_OA* to automate "EASILY" across servers. Now you are asking to deploy PowerShell (another add-on) in order to use SMO from TSQL. Not easy to deploy it all over the place.

|||

Actually no I am not saying that, sorry I was not clear. I am saying why call from SMO or DMO from inside SQL Server at all. If you are inside SQL Server use T-SQL, if you are outside use DMO or better yet us SMO, either directly or via powershell(which be included in the OS at some point and hence no need to deploy).

Neither SMO nor DMO was designed to be called inside the server, there is at least one memory leak in DMO that can not be fixed and there are lots of threading issues. I strongly encourage you not to do it until there is a version desiged to be called inside the server.

|||

Euan Garden wrote:

Actually no I am not saying that, sorry I was not clear. I am saying why call from SMO or DMO from inside SQL Server at all. If you are inside SQL Server use T-SQL, if you are outside use DMO or better yet us SMO, either directly or via powershell(which be included in the OS at some point and hence no need to deploy).

I have to side with Noeld still on this. Most DBA's are aware that there are potential issues with using the sp_OA* procedures internally. However, most of us are not creating large DMO objects internally. Most of us are going after configuration values (like, say, BackupDirectory) which is extremely difficult to get to via t-sql without DMO (it can be done, but it's a LOT more code). Myself, I've been using a custom set of routines that I've written over the years on several hundred servers and only once have I had an issue with DMO causing an error on the server.

Being able to query for configuration values internally means that I only have to deploy my code to the server and it is 'self-contained' at that point. Why not use what we run (SQL Servers) to get the information we need? Why provide the sp_OA* procedures in the first place if they weren't meant to be used (just being rhetorical)?

I'm very glad to see that this topic got a few more replies, this is a topic I think is quite mis-understood.

|||

sp_Oa was provided as a technology solution and it still provides a solution today, thats not to say that I would recomend it. A couple of other examples, SQLMail, in its time was a really cool feature, but on reflection calling MAPI(a non thread safe client focussed API) from inside an Extended Stored Procedure is not going to increase the reliability of your server. SQL Server still supports XPs, I would always look to do something in SQLCLR before an XP however.

Yes getting config information out of the server should be easier and hopefully it will get better, for me what I would do is use profiler to sniff the T-SQL from DMO and then write some utility procs of my own that wrap the functionality, thus easing the risks on the server

|||

Euan Garden wrote:

Yes getting config information out of the server should be easier and hopefully it will get better, for me what I would do is use profiler to sniff the T-SQL from DMO and then write some utility procs of my own that wrap the functionality, thus easing the risks on the server

That's mostly how I came up wtih the DMO scripts I use today, sniffing EM and whatnot... I'll have to look into sniffing the DMO itself though, that I haven't tried.

Interface-less SMO?

One of the typical uses of DMO was to instantiate COM objects via t-sql either via stored procedures or ad-hoc submissions through Query Anaylzer/OSQL/ISQL. This allows me to construct helper scripts that have access to objects outside the SQL Server process space, and I don't have to create any application (console or gui) to do what I need.

It seems that SMO is not meant to be 'interface-less' as we could do with DMO, is this true? If this is the case, can we plan on either SMO being able to instantiate objects without an interface, or can we depend on DMO hanging around for a little while longer, while SMO "ramps up"?

Or, should I just start planning on learning how to create my own 'interface-less' objects via CLR, which seems to be the only choice (sofar)?

You should really consider using SMO in your own applications or via the new WIndows PowerShell. This will give you much more control, easier maintainance and coding compared to DMO.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Some tutorials on using SMO with PowerShell...

http://www.simple-talk.com/sql/database-administration/managing-sql-server-using-powersmo/

Dan

|||

The main reason I prefer DMO is that it's much easier to encapsulate it into t-sql and have it run from within sql server (job/sp/batchfile). I don't want to have to start writing applications to do what I used to be able to do with DMO.

As an example, I have an sp that gets executed via job; the sp uses DMO in it's body to determine the drive space information on the server and the job emails the resultset as an attachment. Very easy and tidy, one job and one sp.

Now that DMO is being deprecated, I have to get rid of my sp code and create an application, or invoke a powershell script instead of just running an sp and emailing the results as a text file. Can I do this same exact operation with SMO, and not require an application interface?

It just seems a bit odd, that something as core as the way DMO can be used without an interface isn't part of SMO... I can't be the only one out here who does things in this manner.

|||

Jens K. Suessmeyer wrote:

You should really consider using SMO in your own applications or via the new WIndows PowerShell. This will give you much more control, easier maintainance and coding compared to DMO.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

I'm a DBA looking to manage my servers without any more applications than neccessary, not a developer writing software...

|||

Powershell is designed for admins and by building T-SQl that calls DMO you are actually developing software.

Pause and think about what is happening in your scenario and why it will negatively impact the reliability of you server.

You are using T-SQL code to call the SQL Server oa(I presume) extended procedures, that provide a COM interface.

You are using that COM interface to call a large complex COM library whos primary function is to

Generate T-SQL and call SPs in the server through ODBC, performing T-SQL tasks.

If you are going to do this why not write it in T-SQL as SPs in the server in the first place, or if you want an easier API then use PowerShell or VB.Net to call SMO from outside the server.

|||

Euan Garden wrote:

Powershell is designed for admins and by building T-SQl that calls DMO you are actually developing software.

Pause and think about what is happening in your scenario and why it will negatively impact the reliability of you server.

You are using T-SQL code to call the SQL Server oa(I presume) extended procedures, that provide a COM interface.

You are using that COM interface to call a large complex COM library whos primary function is to

Generate T-SQL and call SPs in the server through ODBC, performing T-SQL tasks.

If you are going to do this why not write it in T-SQL as SPs in the server in the first place, or if you want an easier API then use PowerShell or VB.Net to call SMO from outside the server.

It is "tough" to re-write in TSQL what SMO *already* have. We (DBAs with large number of server / databases) used DMO out-of-the box and yes sp_OA* to automate "EASILY" across servers. Now you are asking to deploy PowerShell (another add-on) in order to use SMO from TSQL. Not easy to deploy it all over the place.

|||

Actually no I am not saying that, sorry I was not clear. I am saying why call from SMO or DMO from inside SQL Server at all. If you are inside SQL Server use T-SQL, if you are outside use DMO or better yet us SMO, either directly or via powershell(which be included in the OS at some point and hence no need to deploy).

Neither SMO nor DMO was designed to be called inside the server, there is at least one memory leak in DMO that can not be fixed and there are lots of threading issues. I strongly encourage you not to do it until there is a version desiged to be called inside the server.

|||

Euan Garden wrote:

Actually no I am not saying that, sorry I was not clear. I am saying why call from SMO or DMO from inside SQL Server at all. If you are inside SQL Server use T-SQL, if you are outside use DMO or better yet us SMO, either directly or via powershell(which be included in the OS at some point and hence no need to deploy).

I have to side with Noeld still on this. Most DBA's are aware that there are potential issues with using the sp_OA* procedures internally. However, most of us are not creating large DMO objects internally. Most of us are going after configuration values (like, say, BackupDirectory) which is extremely difficult to get to via t-sql without DMO (it can be done, but it's a LOT more code). Myself, I've been using a custom set of routines that I've written over the years on several hundred servers and only once have I had an issue with DMO causing an error on the server.

Being able to query for configuration values internally means that I only have to deploy my code to the server and it is 'self-contained' at that point. Why not use what we run (SQL Servers) to get the information we need? Why provide the sp_OA* procedures in the first place if they weren't meant to be used (just being rhetorical)?

I'm very glad to see that this topic got a few more replies, this is a topic I think is quite mis-understood.

|||

sp_Oa was provided as a technology solution and it still provides a solution today, thats not to say that I would recomend it. A couple of other examples, SQLMail, in its time was a really cool feature, but on reflection calling MAPI(a non thread safe client focussed API) from inside an Extended Stored Procedure is not going to increase the reliability of your server. SQL Server still supports XPs, I would always look to do something in SQLCLR before an XP however.

Yes getting config information out of the server should be easier and hopefully it will get better, for me what I would do is use profiler to sniff the T-SQL from DMO and then write some utility procs of my own that wrap the functionality, thus easing the risks on the server

|||

Euan Garden wrote:

Yes getting config information out of the server should be easier and hopefully it will get better, for me what I would do is use profiler to sniff the T-SQL from DMO and then write some utility procs of my own that wrap the functionality, thus easing the risks on the server

That's mostly how I came up wtih the DMO scripts I use today, sniffing EM and whatnot... I'll have to look into sniffing the DMO itself though, that I haven't tried.

Interface-less SMO?

One of the typical uses of DMO was to instantiate COM objects via t-sql either via stored procedures or ad-hoc submissions through Query Anaylzer/OSQL/ISQL. This allows me to construct helper scripts that have access to objects outside the SQL Server process space, and I don't have to create any application (console or gui) to do what I need.

It seems that SMO is not meant to be 'interface-less' as we could do with DMO, is this true? If this is the case, can we plan on either SMO being able to instantiate objects without an interface, or can we depend on DMO hanging around for a little while longer, while SMO "ramps up"?

Or, should I just start planning on learning how to create my own 'interface-less' objects via CLR, which seems to be the only choice (sofar)?

You should really consider using SMO in your own applications or via the new WIndows PowerShell. This will give you much more control, easier maintainance and coding compared to DMO.

Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Some tutorials on using SMO with PowerShell...

http://www.simple-talk.com/sql/database-administration/managing-sql-server-using-powersmo/

Dan

|||

The main reason I prefer DMO is that it's much easier to encapsulate it into t-sql and have it run from within sql server (job/sp/batchfile). I don't want to have to start writing applications to do what I used to be able to do with DMO.

As an example, I have an sp that gets executed via job; the sp uses DMO in it's body to determine the drive space information on the server and the job emails the resultset as an attachment. Very easy and tidy, one job and one sp.

Now that DMO is being deprecated, I have to get rid of my sp code and create an application, or invoke a powershell script instead of just running an sp and emailing the results as a text file. Can I do this same exact operation with SMO, and not require an application interface?

It just seems a bit odd, that something as core as the way DMO can be used without an interface isn't part of SMO... I can't be the only one out here who does things in this manner.

|||

Jens K. Suessmeyer wrote:

You should really consider using SMO in your own applications or via the new WIndows PowerShell. This will give you much more control, easier maintainance and coding compared to DMO.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

I'm a DBA looking to manage my servers without any more applications than neccessary, not a developer writing software...

|||

Powershell is designed for admins and by building T-SQl that calls DMO you are actually developing software.

Pause and think about what is happening in your scenario and why it will negatively impact the reliability of you server.

You are using T-SQL code to call the SQL Server oa(I presume) extended procedures, that provide a COM interface.

You are using that COM interface to call a large complex COM library whos primary function is to

Generate T-SQL and call SPs in the server through ODBC, performing T-SQL tasks.

If you are going to do this why not write it in T-SQL as SPs in the server in the first place, or if you want an easier API then use PowerShell or VB.Net to call SMO from outside the server.

|||

Euan Garden wrote:

Powershell is designed for admins and by building T-SQl that calls DMO you are actually developing software.

Pause and think about what is happening in your scenario and why it will negatively impact the reliability of you server.

You are using T-SQL code to call the SQL Server oa(I presume) extended procedures, that provide a COM interface.

You are using that COM interface to call a large complex COM library whos primary function is to

Generate T-SQL and call SPs in the server through ODBC, performing T-SQL tasks.

If you are going to do this why not write it in T-SQL as SPs in the server in the first place, or if you want an easier API then use PowerShell or VB.Net to call SMO from outside the server.

It is "tough" to re-write in TSQL what SMO *already* have. We (DBAs with large number of server / databases) used DMO out-of-the box and yes sp_OA* to automate "EASILY" across servers. Now you are asking to deploy PowerShell (another add-on) in order to use SMO from TSQL. Not easy to deploy it all over the place.|||

Actually no I am not saying that, sorry I was not clear. I am saying why call from SMO or DMO from inside SQL Server at all. If you are inside SQL Server use T-SQL, if you are outside use DMO or better yet us SMO, either directly or via powershell(which be included in the OS at some point and hence no need to deploy).

Neither SMO nor DMO was designed to be called inside the server, there is at least one memory leak in DMO that can not be fixed and there are lots of threading issues. I strongly encourage you not to do it until there is a version desiged to be called inside the server.

|||

Euan Garden wrote:

Actually no I am not saying that, sorry I was not clear. I am saying why call from SMO or DMO from inside SQL Server at all. If you are inside SQL Server use T-SQL, if you are outside use DMO or better yet us SMO, either directly or via powershell(which be included in the OS at some point and hence no need to deploy).

I have to side with Noeld still on this. Most DBA's are aware that there are potential issues with using the sp_OA* procedures internally. However, most of us are not creating large DMO objects internally. Most of us are going after configuration values (like, say, BackupDirectory) which is extremely difficult to get to via t-sql without DMO (it can be done, but it's a LOT more code). Myself, I've been using a custom set of routines that I've written over the years on several hundred servers and only once have I had an issue with DMO causing an error on the server.

Being able to query for configuration values internally means that I only have to deploy my code to the server and it is 'self-contained' at that point. Why not use what we run (SQL Servers) to get the information we need? Why provide the sp_OA* procedures in the first place if they weren't meant to be used (just being rhetorical)?

I'm very glad to see that this topic got a few more replies, this is a topic I think is quite mis-understood.

|||

sp_Oa was provided as a technology solution and it still provides a solution today, thats not to say that I would recomend it. A couple of other examples, SQLMail, in its time was a really cool feature, but on reflection calling MAPI(a non thread safe client focussed API) from inside an Extended Stored Procedure is not going to increase the reliability of your server. SQL Server still supports XPs, I would always look to do something in SQLCLR before an XP however.

Yes getting config information out of the server should be easier and hopefully it will get better, for me what I would do is use profiler to sniff the T-SQL from DMO and then write some utility procs of my own that wrap the functionality, thus easing the risks on the server

|||

Euan Garden wrote:

Yes getting config information out of the server should be easier and hopefully it will get better, for me what I would do is use profiler to sniff the T-SQL from DMO and then write some utility procs of my own that wrap the functionality, thus easing the risks on the server

That's mostly how I came up wtih the DMO scripts I use today, sniffing EM and whatnot... I'll have to look into sniffing the DMO itself though, that I haven't tried.

Interesting subscription question...I could use some brainstorming help

I have a report that needs to be emailed to 40 diffferent technicians.
Each tehnician handles a different US region so the report will be
driven via a parameter (most likely a technician ID). We don't want
other technicians seeing data for someone elses region. This all has
to be automated, no user interaction with this report other than each
technician getting an email with his/her data (based on his/her
results).
What would be the best way to handle this with a subscription?I do know that this will have to be a data-driven subscription. Is it
possible for the value in a data driven query be used as a parameter in
the report'
kimcheebowl wrote:
> I have a report that needs to be emailed to 40 diffferent technicians.
> Each tehnician handles a different US region so the report will be
> driven via a parameter (most likely a technician ID). We don't want
> other technicians seeing data for someone elses region. This all has
> to be automated, no user interaction with this report other than each
> technician getting an email with his/her data (based on his/her
> results).
> What would be the best way to handle this with a subscription?|||Absolutely - DDS will be just what the doctor ordered. You will need
to feed the parameter values into a table for the DDS to pull from. I
use both Access DB and Excel spreadsheet uploads to upload subscription
parameters into a SQL Server table, which is then used by the DDS.
Matt A
kimcheebowl wrote:
> I do know that this will have to be a data-driven subscription. Is it
> possible for the value in a data driven query be used as a parameter in
> the report'
>
> kimcheebowl wrote:
> > I have a report that needs to be emailed to 40 diffferent technicians.
> > Each tehnician handles a different US region so the report will be
> > driven via a parameter (most likely a technician ID). We don't want
> > other technicians seeing data for someone elses region. This all has
> > to be automated, no user interaction with this report other than each
> > technician getting an email with his/her data (based on his/her
> > results).
> >
> > What would be the best way to handle this with a subscription?sql

Interesting SQL Server behaviour

Hi,
The following code describes a problem I'm having when I'm selecting
data via a Case statement.
The data I'm selecting is from a table with 2 varchar columns and 1
int column. When I select this data I get the following error:
Server: Msg245, Level 16,State 1, Line 1
Syntax error converting the varchar values 'A' to a column of datatype
int.
If I cast the int to a varchar it works, but I would prefer not to
cast if possible. SQL server seems to look at all the datatypes in the
case statement and if a int data type appears, it seems to be trying
to insert into a int column. Is this some sort of temp table? Anyone
know why it assigned an int column here?
Any ideas what I can do
Thanks,
Tom
- --
- -- Set up the table
- --
create table Tom
(charcol1 varchar(2)
,charcol2 varchar(2)
,intcol1 int
)
insert into tom
(charcol1
,intcol1
,charcol2
)
values
('A',1,'C')
- ---
- -- Code
- ---
SELECT
CASE numlist.list
WHEN 1 THEN
Tom.charcol1
WHEN 2 THEN
--cast (Tom.intcol1 as varchar(5))
Tom.intcol1
WHEN 3 THEN
Tom.charcol2
END AS result
FROM Tom
CROSS JOIN (select 1 as list
union all
select 2 as list
union all
select 3 as list
) as numlistThis is how CASE work, result from CASE expression is of the same datatype.
Output is determined as
per "datatype precedence" documented in Books Online.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Staggly" <tomstagg@.gmail.com> wrote in message
news:e646e15f.0502090622.8a26408@.posting.google.com...
> Hi,
> The following code describes a problem I'm having when I'm selecting
> data via a Case statement.
> The data I'm selecting is from a table with 2 varchar columns and 1
> int column. When I select this data I get the following error:
> Server: Msg245, Level 16,State 1, Line 1
> Syntax error converting the varchar values 'A' to a column of datatype
> int.
> If I cast the int to a varchar it works, but I would prefer not to
> cast if possible. SQL server seems to look at all the datatypes in the
> case statement and if a int data type appears, it seems to be trying
> to insert into a int column. Is this some sort of temp table? Anyone
> know why it assigned an int column here?
> Any ideas what I can do
> Thanks,
> Tom
> - --
> - -- Set up the table
> - --
> create table Tom
> (charcol1 varchar(2)
> ,charcol2 varchar(2)
> ,intcol1 int
> )
> insert into tom
> (charcol1
> ,intcol1
> ,charcol2
> )
> values
> ('A',1,'C')
> - ---
> - -- Code
> - ---
> SELECT
> CASE numlist.list
> WHEN 1 THEN
> Tom.charcol1
> WHEN 2 THEN
> --cast (Tom.intcol1 as varchar(5))
> Tom.intcol1
> WHEN 3 THEN
> Tom.charcol2
> END AS result
> FROM Tom
> CROSS JOIN (select 1 as list
> union all
> select 2 as list
> union all
> select 3 as list
> ) as numlist

Monday, March 19, 2012

interested in wombats

Can someone tell me whether Wombats live only in Australia,
or also on other continents?
Apart from zoos, of course.
23
--
Posted via a free Usenet account from http://www.teranews.comThey are also found in Bass Strait and Flinders Islands.
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<wombat@.fancier.net> wrote in message news:m06102800431062@.4ax.com...
> Can someone tell me whether Wombats live only in Australia,
> or also on other continents?
> Apart from zoos, of course.
> 23
>
> --
> Posted via a free Usenet account from http://www.teranews.com
>

Monday, March 12, 2012

Interactive sort changes time field values to 0

Hello all, I have a report which connects to a Pervasive database via an ODBC connection on the reporting server (RS2005). When I initially bring the report up, a time field (OdbcType.Time) shows the correct format: hh:mm:ss. When I sort any of the sortable columns on the report, the time field (which is not sortable) values all change to 0. Backing out of the report and re-running it restores the correct time values. Any ideas?
Thanks, KenThis issue could be related to the data type of the field. There is a fixed set of data types RS supports: string, boolean, numeric, datetime, timespan. When you sort, we have to use the data we temporarily store (so that we don't have to query the data source) to process the report. If it's not one of the types supported, it might cause the loss of the value. Can you check what CLR type the time field is of?|||Hi Fang, Please forgive my ignorance, but I'm not sure what the 'clr' type is. VS2005 says the table field type is OdbcType.Time. If I try to convert it to something silly, VS2005 complains that type 'TimeSpan' cannot be converted to the silly type. So I guess the CLR type is TimeSpan?|||Can you check your RDL file? Look under the <Field> element of that field, what's the value for <rd:TypeName>?|||Thanks for your time Fang, I've pasted the snippet for the field in question:
<Field Name="TIME_RECEIVED">
<rd:TypeName>System.TimeSpan</rd:TypeName>
<DataField>TIME_RECEIVED</DataField>
</Field>|||Hmm, we have not seen this problem before. Can you submit it along with your .rdl and .rdl.data files at https://connect.microsoft.com/SQLServer? We'll investigate it. Thanks.|||Thank you Fang. I have submitted a bug report and uploaded the files.|||Thanks. We have investigated the issue and the fix will hopefully be included in the next service pack.

Interactive sort changes time field values to 0

Hello all, I have a report which connects to a Pervasive database via an ODBC connection on the reporting server (RS2005). When I initially bring the report up, a time field (OdbcType.Time) shows the correct format: hh:mm:ss. When I sort any of the sortable columns on the report, the time field (which is not sortable) values all change to 0. Backing out of the report and re-running it restores the correct time values. Any ideas?
Thanks, KenThis issue could be related to the data type of the field. There is a fixed set of data types RS supports: string, boolean, numeric, datetime, timespan. When you sort, we have to use the data we temporarily store (so that we don't have to query the data source) to process the report. If it's not one of the types supported, it might cause the loss of the value. Can you check what CLR type the time field is of?|||Hi Fang, Please forgive my ignorance, but I'm not sure what the 'clr' type is. VS2005 says the table field type is OdbcType.Time. If I try to convert it to something silly, VS2005 complains that type 'TimeSpan' cannot be converted to the silly type. So I guess the CLR type is TimeSpan?|||Can you check your RDL file? Look under the <Field> element of that field, what's the value for <rd:TypeName>?|||Thanks for your time Fang, I've pasted the snippet for the field in question:
<Field Name="TIME_RECEIVED">
<rd:TypeName>System.TimeSpan</rd:TypeName>
<DataField>TIME_RECEIVED</DataField>
</Field>|||Hmm, we have not seen this problem before. Can you submit it along with your .rdl and .rdl.data files at https://connect.microsoft.com/SQLServer? We'll investigate it. Thanks.|||Thank you Fang. I have submitted a bug report and uploaded the files.|||Thanks. We have investigated the issue and the fix will hopefully be included in the next service pack.