Showing posts with label closed. Show all posts
Showing posts with label closed. Show all posts

Friday, March 16, 2012

"System.InvalidOperationException: Invalid attempt to MetaData when reader is closed"

I am getting this exception sporadically in a certain block of code (it usually works):

"System.InvalidOperationException: Invalid attempt to MetaData when reader is closed"

The code is below: cmd.CommandText ="[dbo].CountryGetList"; cmd.CommandType = CommandType.StoredProcedure; IDataReader rdr = cmd.ExecuteReader(); List countries =new List(); ...while (rdr.Read()) {//do stuff                  

CountryID = (

Guid)rdr["CountryID"];

//blows up on the next line

cty.Name = (string)rdr["Name"];

}

} rdr.Close();

Any ideas!?

I guess thecmd.Connection has been closed before you finish reading data from IDataReader rdr

Monday, February 13, 2012

"dynamic" partitioning in SQL 2005 - possibility/speed?

Hi.
We have a workflow system that has tasks (tickets, whatever).
As of today, we have several hundred thousand closed tasks and about
5-7k open tasks.
The majority of operations work on open tasks, and the majority of
reports are also for open tasks; open tasks eventually become closed,
closed tasks can become open too but that's rare.
Is it possible to partition the tasks' table by the IsClosed bit
field, and have SQL server move rows back and forth automatically?
Will it be slow?
Also, for the reports that aggregate data from both small active
partition and big "closed" partition, will there be a big performance
hit compared to a single, non-partitioned table?
Articles on partitioning I have googled are kind of one sided and
mostly deal with static partitions of archived sales data etc that are
maintained manually or using scripts on regular basis.Hmm.. any ideas?

"dynamic" partitioning in SQL 2005 - possibility/speed?

Hi.
We have a workflow system that has tasks (tickets, whatever).
As of today, we have several hundred thousand closed tasks and about
5-7k open tasks.
The majority of operations work on open tasks, and the majority of
reports are also for open tasks; open tasks eventually become closed,
closed tasks can become open too but that's rare.
Is it possible to partition the tasks' table by the IsClosed bit
field, and have SQL server move rows back and forth automatically?
Will it be slow? :)
Also, for the reports that aggregate data from both small active
partition and big "closed" partition, will there be a big performance
hit compared to a single, non-partitioned table?
Articles on partitioning I have googled are kind of one sided and
mostly deal with static partitions of archived sales data etc that are
maintained manually or using scripts on regular basis.Hmm.. any ideas?

"dynamic" partitioning in SQL 2005 - possibility/speed?

Hi.
We have a workflow system that has tasks (tickets, whatever).
As of today, we have several hundred thousand closed tasks and about
5-7k open tasks.
The majority of operations work on open tasks, and the majority of
reports are also for open tasks; open tasks eventually become closed,
closed tasks can become open too but that's rare.
Is it possible to partition the tasks' table by the IsClosed bit
field, and have SQL server move rows back and forth automatically?
Will it be slow?
Also, for the reports that aggregate data from both small active
partition and big "closed" partition, will there be a big performance
hit compared to a single, non-partitioned table?
Articles on partitioning I have googled are kind of one sided and
mostly deal with static partitions of archived sales data etc that are
maintained manually or using scripts on regular basis.
Hmm.. any ideas?

Thursday, February 9, 2012

"Closed" database

Hello,
I was wondering if it is possible to create a database that can be
accessed only using a username password combination, even when being
accessed from the Enterprise Manager.
It seems EM can always access all data, however when I distribute the
database, I don't want some tables to be viewed by my users.
Is this possible in SQL Server?
Thanks for any answer.
Best regards,H
i> database, I don't want some tables to be viewed by my users.
> Is this possible in SQL Server?
You cannot hide them, however if the user has EM on his box so register
the sql server with an appropiate permissions , I mean first of all DENY to
view /SELECT... to the specific user
<poostwoud@.gmail.com> wrote in message
news:1149755500.564173.157240@.u72g2000cwu.googlegroups.com...
> Hello,
> I was wondering if it is possible to create a database that can be
> accessed only using a username password combination, even when being
> accessed from the Enterprise Manager.
> It seems EM can always access all data, however when I distribute the
> database, I don't want some tables to be viewed by my users.
> Is this possible in SQL Server?
> Thanks for any answer.
> Best regards,
>|||Thanks for your answer,
However, when the user wants me to use an existing server, the user
already has sa rights most of the time.
Any member of the sysadmin role cannot be denied select rights as far
as I know?
Best regards,
Uri Dimant wrote:[vbcol=seagreen]
> H
> i> database, I don't want some tables to be viewed by my users.
> You cannot hide them, however if the user has EM on his box so register
> the sql server with an appropiate permissions , I mean first of all DENY t
o
> view /SELECT... to the specific user
> <poostwoud@.gmail.com> wrote in message
> news:1149755500.564173.157240@.u72g2000cwu.googlegroups.com...|||> Any member of the sysadmin role cannot be denied select rights as far
> as I know?
True
<poostwoud@.gmail.com> wrote in message
news:1149759179.371876.206990@.i40g2000cwc.googlegroups.com...
> Thanks for your answer,
> However, when the user wants me to use an existing server, the user
> already has sa rights most of the time.
> Any member of the sysadmin role cannot be denied select rights as far
> as I know?
> Best regards,
> Uri Dimant wrote:
>|||In SQL Server 2000, if you need to "hide" data from an sa,
you would need to use some type of third party encryption.
Check the links under field level encryption in the
following FAQ:
http://www.sqlsecurity.com/FAQs/SQL...55/Default.aspx
-Sue
On 8 Jun 2006 02:32:59 -0700, poostwoud@.gmail.com wrote:
[vbcol=seagreen]
>Thanks for your answer,
>However, when the user wants me to use an existing server, the user
>already has sa rights most of the time.
>Any member of the sysadmin role cannot be denied select rights as far
>as I know?
>Best regards,
>Uri Dimant wrote:|||In SQL Server 2000, if you need to "hide" data from an sa,
you would need to use some type of third party encryption.
Check the links under field level encryption in the
following FAQ:
http://www.sqlsecurity.com/FAQs/SQL...55/Default.aspx
-Sue
On 8 Jun 2006 02:32:59 -0700, poostwoud@.gmail.com wrote:
[vbcol=seagreen]
>Thanks for your answer,
>However, when the user wants me to use an existing server, the user
>already has sa rights most of the time.
>Any member of the sysadmin role cannot be denied select rights as far
>as I know?
>Best regards,
>Uri Dimant wrote: