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

Tuesday, March 27, 2012

Db2 Connection Problems SSIS (OLEDB)

Hello,

I'm trying to connect to a DB2 database via SSIS and I'm getting some problems:

I'm creating a new OLE DB Connection Manager and I'm getting two distinct errors:

1) When I try to use "IBM OLEDB Provider for DB2 Servers" I can create the connection manager and the connection is tested successfully.

But when I try to use the connection in OLE DB Source when I will list the tables I get this error:

Could not retrieve the table information for the connection manager 'MyDataSource'.
truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004

ADDITIONAL INFORMATION:

truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004 (IBM OLE DB Provider for DB2 Servers)

2) When I try to use "Microsoft OLE DB Provider for DB2" when I try to test the connection I get this error:

Test connection failed because of an error in initializing provider. The parameter is incorrect.

Anyone had these problems ?

Thanks,

Guber

i have been working on DTS/SSIS using DB2OLEDB. I do not have the error of using "Microsoft OLE DB Provider for DB2", which you described.

I guess that your connection manager was perhaps not correctly configured. Create a UDL file first to figure out the correct connection string and then create DB2 connection manager inside SSIS.

If you can post your connection string here, I should be able to tell you what went wrong.

Steve

|||Hi,

I am also getting the same problem. what is configuration you are using?
|||

I met the same problem yesteday. I found a solution to it.

My source table in db2 had a column defined decimal(20,2),but the length of numeric in SSIS is 16.

So the data will bu truncated .

When i had used a script component to read data from db2,the problem did not appear.

Db2 Connection Problems SSIS (OLEDB)

Hello,

I'm trying to connect to a DB2 database via SSIS and I'm getting some problems:

I'm creating a new OLE DB Connection Manager and I'm getting two distinct errors:

1) When I try to use "IBM OLEDB Provider for DB2 Servers" I can create the connection manager and the connection is tested successfully.

But when I try to use the connection in OLE DB Source when I will list the tables I get this error:

Could not retrieve the table information for the connection manager 'MyDataSource'.
truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004

ADDITIONAL INFORMATION:

truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004 (IBM OLE DB Provider for DB2 Servers)

2) When I try to use "Microsoft OLE DB Provider for DB2" when I try to test the connection I get this error:

Test connection failed because of an error in initializing provider. The parameter is incorrect.

Anyone had these problems ?

Thanks,

Guber

i have been working on DTS/SSIS using DB2OLEDB. I do not have the error of using "Microsoft OLE DB Provider for DB2", which you described.

I guess that your connection manager was perhaps not correctly configured. Create a UDL file first to figure out the correct connection string and then create DB2 connection manager inside SSIS.

If you can post your connection string here, I should be able to tell you what went wrong.

Steve

|||Hi,

I am also getting the same problem. what is configuration you are using?
|||

I met the same problem yesteday. I found a solution to it.

My source table in db2 had a column defined decimal(20,2),but the length of numeric in SSIS is 16.

So the data will bu truncated .

When i had used a script component to read data from db2,the problem did not appear.

Db2 Connection Problems SSIS (OLEDB)

Hello,

I'm trying to connect to a DB2 database via SSIS and I'm getting some problems:

I'm creating a new OLE DB Connection Manager and I'm getting two distinct errors:

1) When I try to use "IBM OLEDB Provider for DB2 Servers" I can create the connection manager and the connection is tested successfully.

But when I try to use the connection in OLE DB Source when I will list the tables I get this error:

Could not retrieve the table information for the connection manager 'MyDataSource'.
truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004

ADDITIONAL INFORMATION:

truncated. SQLSTATE=01004
CLI0002W Data truncated. SQLSTATE=01004 (IBM OLE DB Provider for DB2 Servers)

2) When I try to use "Microsoft OLE DB Provider for DB2" when I try to test the connection I get this error:

Test connection failed because of an error in initializing provider. The parameter is incorrect.

Anyone had these problems ?

Thanks,

Guber

i have been working on DTS/SSIS using DB2OLEDB. I do not have the error of using "Microsoft OLE DB Provider for DB2", which you described.

I guess that your connection manager was perhaps not correctly configured. Create a UDL file first to figure out the correct connection string and then create DB2 connection manager inside SSIS.

If you can post your connection string here, I should be able to tell you what went wrong.

Steve

|||Hi,

I am also getting the same problem. what is configuration you are using?
|||

I met the same problem yesteday. I found a solution to it.

My source table in db2 had a column defined decimal(20,2),but the length of numeric in SSIS is 16.

So the data will bu truncated .

When i had used a script component to read data from db2,the problem did not appear.

DB2 Connect and SSIS | Error in OLE DB Source Task

Hi All,

I am trying to connect to DB2 database via OLE DB connection manager in SSIS. But when I enter the SQL Query and press OK it gives following error

"Error at Data Flow Task - Header Load [OlE DB Source - Header_Load[1]]": An OLE DB Error has occured. Error Code: 0x80040E21

Additional Information:

Exception from HRESULT: 0xC0202009(Microsoft.SqlServer.DTSPipelineWrap)"

I followed following steps: -

1. I created OLE DB provider and tested the connection, it was successful(with give username and password)

2. Created query in Build query as following and tried executing it. It worked! Query used was

SELECT SRC_ID, ORG_ID FROM DB123.DEAL_HEADER

3. But when, in OLE DB Source Provider Task, when I press preview, It thorws the above error!

Kindly let me know, Because I am stuck at that point.

Thanks

Sid

What happens if you don't preview the results? Just run the package normally after building the query.|||In that case; when I press "OK" in OLE DB Source Task, the same Error appears. In short, I am not able to save the task and move futher with my implementation.|||What driver are you using to connect to DB2? IBM's DB2Connect?|||Yes I am using IBM's DB2 Connect|||

sidzone123 wrote:

Yes I am using IBM's DB2 Connect

Well, if you are on SQL Server Developer or Enterprise edition, you can download the Microsoft OLE DB for DB2 driver. That works really well for me.

Never-the-less, you can try some of the techniques in here to see if they'll help your situation, even though it doesn't deal with DB2 directly:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=142282&SiteID=1|||

Hi Phil,

I am using SQL Server Standard Edition.

However, I tried all methods suggested by the link suggested by you.

But unfortunately nothing work!

Thanks

Sid

|||

Hi,

I found the workaround for this!

1) In OLE DB Source, Open the Advance Editor and in the Custom property, set the Access Mode to "OpenRowset"

2) In the OpenRowset property, write the table that you want to access i.e. say "CZ123"."DEAL_HEADER"

Thats it and press OK!

To my surpise it worked great. I was able to connect to DB2 and transfer the data.

However I am not sure about why I was getting the errors that I mentioned earlier and why the above solution worked. Still trying to find the aswer to this.

Hope the same works for all.

Thanks

Sid

Monday, March 19, 2012

db restoration via shared folder

I was reading the article on the subject above at the
http://examnotes.net/arch/178/2002/3/329543
The question here is:-
Testing was done and I was able to restore db using EM on
a Standard Edition (SP3) and mapped drive to another
server. Unlike I was unable to do that from a Enterprise
Edtion (SP3). Why is that so?
Thanks.So, you made certain that the SQL Server service has permissions on the
share and it still didn't work? What error message did you get?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"NG" <angiecmf@.hotmail.com> wrote in message
news:1101001c40fc1$4ab1af40$a501280a@.phx
.gbl...
> I was reading the article on the subject above at the
> http://examnotes.net/arch/178/2002/3/329543
> The question here is:-
> Testing was done and I was able to restore db using EM on
> a Standard Edition (SP3) and mapped drive to another
> server. Unlike I was unable to do that from a Enterprise
> Edtion (SP3). Why is that so?
> Thanks.|||Let me rephrase my question here, Sorry if my explaination
was not clear earlier.
Based on the article, I was able to backup/restore db
without any problem in MSSQL standard/enterprise edition.
The point here is the article stated that backup/restore
can't be done using Enterprise Manager. But I was able to
backup/restore db using Enterprise Manager in Standard
Edition but NOT Enterprise Edition. I was able to see the
mapped drive in the Standard Edition. Why I unable to
view the mapped drive in Enterprise Edition using the
Enterprise Manager? Is this a special feature in Standard
Edition or other setting need to be done here in order to
do so in the Enterprise Edition? Currently I am using
MSSQL 7 with sp(3) on NT4 (sp6).
Your help is much appreciated.

>--Original Message--
>So, you made certain that the SQL Server service has
permissions on the
>share and it still didn't work? What error message did
you get?
>--
>Tibor Karaszi, SQL Server MVP
>http://www.karaszi.com/sqlserver/default.asp
>
>"NG" <angiecmf@.hotmail.com> wrote in message
> news:1101001c40fc1$4ab1af40$a501280a@.phx
.gbl...
on
Enterprise
>
>.
>|||> Based on the article, I was able to backup/restore db
> without any problem in MSSQL standard/enterprise edition.
I assume that you used Query Analyzer for this, is that what you mean?

> The point here is the article stated that backup/restore
> can't be done using Enterprise Manager. But I was able to
> backup/restore db using Enterprise Manager in Standard
> Edition but NOT Enterprise Edition. I was able to see the
> mapped drive in the Standard Edition. Why I unable to
> view the mapped drive in Enterprise Edition using the
> Enterprise Manager? Is this a special feature in Standard
> Edition or other setting need to be done here in order to
> do so in the Enterprise Edition?
I won't read the article, but just be aware that it might be incorrect. Back
to the problem. Here's what I think is going on:
On one installation, the service account is the same as the one you are
logged in as. Hence, the mapped drives are the same. On the other, you are
using different accounts. The key point here is that mapped drives are per
user. And typically, you are not logged in using the same account as the SQL
Server service account. So what you perceive as a mapped drive is different
to what SQL Server does.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"NG" <angiecmf@.hotmail.com> wrote in message
news:11e7e01c4107a$848e7680$a101280a@.phx
.gbl...
> Let me rephrase my question here, Sorry if my explaination
> was not clear earlier.
> Based on the article, I was able to backup/restore db
> without any problem in MSSQL standard/enterprise edition.
> The point here is the article stated that backup/restore
> can't be done using Enterprise Manager. But I was able to
> backup/restore db using Enterprise Manager in Standard
> Edition but NOT Enterprise Edition. I was able to see the
> mapped drive in the Standard Edition. Why I unable to
> view the mapped drive in Enterprise Edition using the
> Enterprise Manager? Is this a special feature in Standard
> Edition or other setting need to be done here in order to
> do so in the Enterprise Edition? Currently I am using
> MSSQL 7 with sp(3) on NT4 (sp6).
> Your help is much appreciated.
>
> permissions on the
> you get?
> on
> Enterprise

Sunday, March 11, 2012

DB Replication or Table Replication via triggers?

Hello everyone,

I am involved in a scenario where there is a huge (SQL Server 2005)
production database containing tables that are updated multiple times
per second. End-user reports need to be generated against the data in
this database, and so the powers-that-be came to the conclusion that a
reporting database is necessary in order to offload report processing
from production; of course, this means that data will have to be
replicated to the reporting database. However, we do not need all of
the data in the production database, and perhaps a filtering criteria
can be established where only certain rows are replicated over to the
reporting database as they're inserted (and possibly updated/deleted).
The current though process is that the programmers designing the
queries/reports will know exactly what data they need from production
and be able to modify the replication criteria as needed. For example,
programmer A might write a report where the data he needs can be
expressed in a simple replication criteria for table T where column X
= "WOOD" and column Y = "MAHOGANY". Programmer B might come along a
month later and write a report whose relies on the same table T where
column X = "METAL" and column Z in (12, 24, 36). Programmer B will
have to modify Programmer A's replication criteria in such a way as to
accomodate both reports, in this case something like "Copy rows from
table T where (col X = "WOOD" and col Y = "MAHOGANY") or (col X =
"METAL" and col Z in (12, 24, 36))". The example I gave is really
trivial of course but is sufficient to give you an idea of what the
current thought-process is.

I assume that this is a requirement that many of you may have
encountered in the past and I am wondering what solutions you were
able to come up with. Personally, I believe that the above method is
prone to error (in this case the use of triggers to specify
replication criteria) and I'd much rather use replication services to
copy tables in their entirety. However, this does not seem to be an
option in my case due to the sheer size of certain tables. Is there
anything out there that performs replication based on complex
programmer defined criteria? Are triggers a viable alternative? Any
alternative out-of-the-box solutions?

Any feedback would be appreciated.

Regards!

AnthonyI'd recommend transactional replication with a nosync initialization. This
is where the initial setup on the reporting server is achieved by using a
restore of the database and after that, only subsequent changes are sent
down. If you are using SQL Server 2005, greater concurrency can be achieved
by using the read committed snapshot isolation level.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||Hello Paul,

Thank you for your response. I will look into SQL Server 2005's
replication and static row level filtering; are there any books or web-
sites you might recommend? I will need to be able to set up and modify
the row-filter criteria programatically, and the reviews @. Barnes and
Noble on "Pro SQL Server 2005 Replication" are pretty dismal.

Regards,

Anthony

On Apr 17, 3:09 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Comwrote:

Quote:

Originally Posted by

I'd recommend transactional replication with a nosync initialization. This
is where the initial setup on the reporting server is achieved by using a
restore of the database and after that, only subsequent changes are sent
down. If you are using SQL Server 2005, greater concurrency can be achieved
by using the read committed snapshot isolation level.
Cheers,
Paul Ibison SQL Server MVP,www.replicationanswers.com

|||Have a look at Hilary's book for snapshot and transactional, but if you're
after more merge info and don't like the Pro book then it's really BOL that
you need and then doing some scenarios for yourself to gain experience. As
for websites, I have some useful info on the site below and there are other
articles out on the various SQL Server sites you can get by googling, but
nothing I think specific to your requirements.
BTW this doesn't really lend itself to modifying the filters dynamically. At
least this is not as straightforward as you might think. Normally the
partitions are well designed to start with. If you want something more
dynamic, then I'd not filter at all in replication and I'd use filters on
the client application instead.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||Hello Paul,

On Apr 17, 6:26 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Comwrote:

Quote:

Originally Posted by

Have a look at Hilary's book for snapshot and transactional, but if you're
after more merge info and don't like the Pro book then it's really BOL that
you need and then doing some scenarios for yourself to gain experience. As
for websites, I have some useful info on the site below and there are other
articles out on the various SQL Server sites you can get by googling, but
nothing I think specific to your requirements.


Will do.

Quote:

Originally Posted by

BTW this doesn't really lend itself to modifying the filters dynamically. At
least this is not as straightforward as you might think. Normally the
partitions are well designed to start with. If you want something more
dynamic, then I'd not filter at all in replication and I'd use filters on
the client application instead.
Cheers,
Paul Ibison SQL Server MVP,www.replicationanswers.com


Ahhh... then that's a problem, I'd definitely need the ability to be
able to programatically and dynamically change the filtering criteria
as the need arises, in this case every time a new report is requested
that needs a subset of data not being captured by the replication
process. You would think that this is such a common scenario... Also,
filtering on the client side is not an option either since that would
mean that all of the data would get replicated to the reporting db. I
could have sworn that I read in msdn that the filters could be changed
via stored procs though... I'll have to look that up.

Thanks for your help Paul!

Anthony|||Anthony Paul wrote:

Quote:

Originally Posted by

I am involved in a scenario where there is a huge (SQL Server 2005)
production database containing tables that are updated multiple times
per second. End-user reports need to be generated against the data in
this database, and so the powers-that-be came to the conclusion that a
reporting database is necessary in order to offload report processing
from production; of course, this means that data will have to be
replicated to the reporting database. However, we do not need all of
the data in the production database, and perhaps a filtering criteria
can be established where only certain rows are replicated over to the
reporting database as they're inserted (and possibly updated/deleted).
The current though process is that the programmers designing the
queries/reports will know exactly what data they need from production
and be able to modify the replication criteria as needed. For example,
programmer A might write a report where the data he needs can be
expressed in a simple replication criteria for table T where column X
= "WOOD" and column Y = "MAHOGANY". Programmer B might come along a
month later and write a report whose relies on the same table T where
column X = "METAL" and column Z in (12, 24, 36). Programmer B will
have to modify Programmer A's replication criteria in such a way as to
accomodate both reports, in this case something like "Copy rows from
table T where (col X = "WOOD" and col Y = "MAHOGANY") or (col X =
"METAL" and col Z in (12, 24, 36))". The example I gave is really
trivial of course but is sufficient to give you an idea of what the
current thought-process is.
>
I assume that this is a requirement that many of you may have
encountered in the past and I am wondering what solutions you were
able to come up with. Personally, I believe that the above method is
prone to error (in this case the use of triggers to specify
replication criteria) and I'd much rather use replication services to
copy tables in their entirety. However, this does not seem to be an
option in my case due to the sheer size of certain tables. Is there
anything out there that performs replication based on complex
programmer defined criteria? Are triggers a viable alternative? Any
alternative out-of-the-box solutions?


Is it possible to create views, then configure things so that just
those views are replicated as tables on the second server?|||Hello Ed,

That's a very good idea, if it turns out that the filter isn't
dynamically configurable then perhaps using a view as a filter and
replicating the view can compensate since views can be modified at any
time. However, I doubt that replication can be done on a view rather
than on a table. I'll have to check it out!

Regards,

Anthony

On Apr 17, 9:46 pm, Ed Murphy <emurph...@.socal.rr.comwrote:

Quote:

Originally Posted by

Anthony Paul wrote:

Quote:

Originally Posted by

I am involved in a scenario where there is a huge (SQL Server 2005)
production database containing tables that are updated multiple times
per second. End-user reports need to be generated against the data in
this database, and so the powers-that-be came to the conclusion that a
reporting database is necessary in order to offload report processing
from production; of course, this means that data will have to be
replicated to the reporting database. However, we do not need all of
the data in the production database, and perhaps a filtering criteria
can be established where only certain rows are replicated over to the
reporting database as they're inserted (and possibly updated/deleted).
The current though process is that the programmers designing the
queries/reports will know exactly what data they need from production
and be able to modify the replication criteria as needed. For example,
programmer A might write a report where the data he needs can be
expressed in a simple replication criteria for table T where column X
= "WOOD" and column Y = "MAHOGANY". Programmer B might come along a
month later and write a report whose relies on the same table T where
column X = "METAL" and column Z in (12, 24, 36). Programmer B will
have to modify Programmer A's replication criteria in such a way as to
accomodate both reports, in this case something like "Copy rows from
table T where (col X = "WOOD" and col Y = "MAHOGANY") or (col X =
"METAL" and col Z in (12, 24, 36))". The example I gave is really
trivial of course but is sufficient to give you an idea of what the
current thought-process is.


>

Quote:

Originally Posted by

I assume that this is a requirement that many of you may have
encountered in the past and I am wondering what solutions you were
able to come up with. Personally, I believe that the above method is
prone to error (in this case the use of triggers to specify
replication criteria) and I'd much rather use replication services to
copy tables in their entirety. However, this does not seem to be an
option in my case due to the sheer size of certain tables. Is there
anything out there that performs replication based on complex
programmer defined criteria? Are triggers a viable alternative? Any
alternative out-of-the-box solutions?


>
Is it possible to create views, then configure things so that just
those views are replicated as tables on the second server?- Hide quoted text -
>
- Show quoted text -

|||I just finished looking up using indexed views versus a filter for
replication and it turns out that the view is much slower than a
filter (about 3x as slow) because the log reader has to log each
transaction twice, once for the view and once for the table. In my
case performance is of utmost concern so the overhead involved in this
is not something they can live with. Sigh...

Quote:

Originally Posted by

Quote:

Originally Posted by

Is it possible to create views, then configure things so that just
those views are replicated as tables on the second server?- Hide quoted text -


>

Quote:

Originally Posted by

- Show quoted text -- Hide quoted text -


>
- Show quoted text -

|||On Apr 18, 12:24 am, Anthony Paul <anthonypa...@.gmail.comwrote:

Quote:

Originally Posted by

Hello Paul,
>
On Apr 17, 6:26 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Comwrote:
>

Quote:

Originally Posted by

Have a look at Hilary's book for snapshot and transactional, but if you're
after more merge info and don't like the Pro book then it's really BOL that
you need and then doing some scenarios for yourself to gain experience. As
for websites, I have some useful info on the site below and there are other
articles out on the various SQL Server sites you can get by googling, but
nothing I think specific to your requirements.


>
Will do.
>

Quote:

Originally Posted by

BTW this doesn't really lend itself to modifying the filters dynamically. At
least this is not as straightforward as you might think. Normally the
partitions are well designed to start with. If you want something more
dynamic, then I'd not filter at all in replication and I'd use filters on
the client application instead.
Cheers,
Paul Ibison SQL Server MVP,www.replicationanswers.com


>
Ahhh... then that's a problem, I'd definitely need the ability to be
able to programatically and dynamically change the filtering criteria
as the need arises, in this case every time a new report is requested
that needs a subset of data not being captured by the replication
process. You would think that this is such a common scenario... Also,
filtering on the client side is not an option either since that would
mean that all of the data would get replicated to the reporting db. I
could have sworn that I read in msdn that the filters could be changed
via stored procs though... I'll have to look that up.
>
Thanks for your help Paul!
>
Anthony


This may sound like a stupid question, but are you sure replicating
the whole database isn't an option? I know you've described the
database as huge, but one mans huge is another mans insignificant (or
the other way around).

It just sounds like you're putting in a lot of work when you may be
able to keep it simple. Apologies if this is a path you've already
worn smooth, just wondering what has made you sure that bog standard
replication isn't the way to go.

Damien|||Hello Damien,

I would *love* to have a full replication going and not have to worry
about the added complexity of creating dynamic filters or triggers,
but the powers that be simply do not consider it an option. Since I'm
not the one that makes the decisions, I can only go by whatever
options are available. They want ONLY a subset of data to be captured,
nothing more. That would be fine with me if the filter was static (ie.
not subject to change every time a new report is requested) but given
the requirements I am in the same camp as you that a full replication
would be best.

Regards,

Anthony

Quote:

Originally Posted by

This may sound like a stupid question, but are you sure replicating
the whole database isn't an option? I know you've described the
database as huge, but one mans huge is another mans insignificant (or
the other way around).
>
It just sounds like you're putting in a lot of work when you may be
able to keep it simple. Apologies if this is a path you've already
worn smooth, just wondering what has made you sure that bog standard
replication isn't the way to go.
>
Damien- Hide quoted text -
>
- Show quoted text -

|||Anthony Paul wrote:

Quote:

Originally Posted by

I would *love* to have a full replication going and not have to worry
about the added complexity of creating dynamic filters or triggers,
but the powers that be simply do not consider it an option. Since I'm
not the one that makes the decisions, I can only go by whatever
options are available. They want ONLY a subset of data to be captured,
nothing more. That would be fine with me if the filter was static (ie.
not subject to change every time a new report is requested) but given
the requirements I am in the same camp as you that a full replication
would be best.


TPTB may start considering it an option if you give them a cost
analysis, depending on whether their previous motivation was "wouldn't
it be nice if" (yes, but) or "we think this is cheaper" (no it isn't)
or "this is required for security reasons" (ugh, okay) or whatever.|||Anthony Paul (anthonypaulo@.gmail.com) writes:

Quote:

Originally Posted by

I would *love* to have a full replication going and not have to worry
about the added complexity of creating dynamic filters or triggers,
but the powers that be simply do not consider it an option. Since I'm
not the one that makes the decisions, I can only go by whatever
options are available. They want ONLY a subset of data to be captured,
nothing more. That would be fine with me if the filter was static (ie.
not subject to change every time a new report is requested) but given
the requirements I am in the same camp as you that a full replication
would be best.


From my meager experience of replication, it seems clear that the database
has to be really huge - several terabytes - to make a dynamic filtering
defensible from a cost perspective. It would be difficult to develop,
difficult to maintain and manage.

The only serious option I see to full replication is a static subset.
That is define what will be supported in replication V1. If a new reqiure-
ment that is not covered, it would have to wait to V2. The idea would
of course to only strip really big stuff with low proability to be included.

And this is what you should tell the powers that be: replicating the entire
database will be far less expensive than changing what is replicated
dynamically.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

DB Replication or Table Replication via triggers?

Hello everyone,
I am involved in a scenario where there is a huge (SQL Server 2005)
production database containing tables that are updated multiple times
per second. End-user reports need to be generated against the data in
this database, and so the powers-that-be came to the conclusion that a
reporting database is necessary in order to offload report processing
from production; of course, this means that data will have to be
replicated to the reporting database. However, we do not need all of
the data in the production database, and perhaps a filtering criteria
can be established where only certain rows are replicated over to the
reporting database as they're inserted (and possibly updated/deleted).
The current though process is that the programmers designing the
queries/reports will know exactly what data they need from production
and be able to modify the replication criteria as needed. For example,
programmer A might write a report where the data he needs can be
expressed in a simple replication criteria for table T where column X
= "WOOD" and column Y = "MAHOGANY". Programmer B might come along a
month later and write a report whose relies on the same table T where
column X = "METAL" and column Z in (12, 24, 36). Programmer B will
have to modify Programmer A's replication criteria in such a way as to
accomodate both reports, in this case something like "Copy rows from
table T where (col X = "WOOD" and col Y = "MAHOGANY") or (col X =
"METAL" and col Z in (12, 24, 36))". The example I gave is really
trivial of course but is sufficient to give you an idea of what the
current thought-process is.
I assume that this is a requirement that many of you may have
encountered in the past and I am wondering what solutions you were
able to come up with. Personally, I believe that the above method is
prone to error (in this case the use of triggers to specify
replication criteria) and I'd much rather use replication services to
copy tables in their entirety. However, this does not seem to be an
option in my case due to the sheer size of certain tables. Is there
anything out there that performs replication based on complex
programmer defined criteria? Are triggers a viable alternative? Any
alternative out-of-the-box solutions?
Any feedback would be appreciated.
Regards!
Anthony
Hello Paul,
Thank you for your response. I will look into SQL Server 2005's
replication and static row level filtering; are there any books or web-
sites you might recommend? I will need to be able to set up and modify
the row-filter criteria programatically, and the reviews @. Barnes and
Noble on "Pro SQL Server 2005 Replication" are pretty dismal.
Regards,
Anthony
On Apr 17, 3:09 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
> I'd recommend transactional replication with a nosync initialization. This
> is where the initial setup on the reporting server is achieved by using a
> restore of the database and after that, only subsequent changes are sent
> down. If you are using SQL Server 2005, greater concurrency can be achieved
> by using the read committed snapshot isolation level.
> Cheers,
> Paul Ibison SQL Server MVP,www.replicationanswers.com
|||Hello Paul,
On Apr 17, 6:26 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
> Have a look at Hilary's book for snapshot and transactional, but if you're
> after more merge info and don't like the Pro book then it's really BOL that
> you need and then doing some scenarios for yourself to gain experience. As
> for websites, I have some useful info on the site below and there are other
> articles out on the various SQL Server sites you can get by googling, but
> nothing I think specific to your requirements.
Will do.

> BTW this doesn't really lend itself to modifying the filters dynamically. At
> least this is not as straightforward as you might think. Normally the
> partitions are well designed to start with. If you want something more
> dynamic, then I'd not filter at all in replication and I'd use filters on
> the client application instead.
> Cheers,
> Paul Ibison SQL Server MVP,www.replicationanswers.com
Ahhh... then that's a problem, I'd definitely need the ability to be
able to programatically and dynamically change the filtering criteria
as the need arises, in this case every time a new report is requested
that needs a subset of data not being captured by the replication
process. You would think that this is such a common scenario... Also,
filtering on the client side is not an option either since that would
mean that all of the data would get replicated to the reporting db. I
could have sworn that I read in msdn that the filters could be changed
via stored procs though... I'll have to look that up.
Thanks for your help Paul!
Anthony
|||Anthony Paul wrote:

> I am involved in a scenario where there is a huge (SQL Server 2005)
> production database containing tables that are updated multiple times
> per second. End-user reports need to be generated against the data in
> this database, and so the powers-that-be came to the conclusion that a
> reporting database is necessary in order to offload report processing
> from production; of course, this means that data will have to be
> replicated to the reporting database. However, we do not need all of
> the data in the production database, and perhaps a filtering criteria
> can be established where only certain rows are replicated over to the
> reporting database as they're inserted (and possibly updated/deleted).
> The current though process is that the programmers designing the
> queries/reports will know exactly what data they need from production
> and be able to modify the replication criteria as needed. For example,
> programmer A might write a report where the data he needs can be
> expressed in a simple replication criteria for table T where column X
> = "WOOD" and column Y = "MAHOGANY". Programmer B might come along a
> month later and write a report whose relies on the same table T where
> column X = "METAL" and column Z in (12, 24, 36). Programmer B will
> have to modify Programmer A's replication criteria in such a way as to
> accomodate both reports, in this case something like "Copy rows from
> table T where (col X = "WOOD" and col Y = "MAHOGANY") or (col X =
> "METAL" and col Z in (12, 24, 36))". The example I gave is really
> trivial of course but is sufficient to give you an idea of what the
> current thought-process is.
> I assume that this is a requirement that many of you may have
> encountered in the past and I am wondering what solutions you were
> able to come up with. Personally, I believe that the above method is
> prone to error (in this case the use of triggers to specify
> replication criteria) and I'd much rather use replication services to
> copy tables in their entirety. However, this does not seem to be an
> option in my case due to the sheer size of certain tables. Is there
> anything out there that performs replication based on complex
> programmer defined criteria? Are triggers a viable alternative? Any
> alternative out-of-the-box solutions?
Is it possible to create views, then configure things so that just
those views are replicated as tables on the second server?
|||Hello Ed,
That's a very good idea, if it turns out that the filter isn't
dynamically configurable then perhaps using a view as a filter and
replicating the view can compensate since views can be modified at any
time. However, I doubt that replication can be done on a view rather
than on a table. I'll have to check it out!
Regards,
Anthony
On Apr 17, 9:46 pm, Ed Murphy <emurph...@.socal.rr.com> wrote:
> Anthony Paul wrote:
>
> Is it possible to create views, then configure things so that just
> those views are replicated as tables on the second server... Hide quoted text -
> - Show quoted text -
|||I just finished looking up using indexed views versus a filter for
replication and it turns out that the view is much slower than a
filter (about 3x as slow) because the log reader has to log each
transaction twice, once for the view and once for the table. In my
case performance is of utmost concern so the overhead involved in this
is not something they can live with. Sigh...

>
> - Show quoted text -
|||On Apr 18, 12:24 am, Anthony Paul <anthonypa...@.gmail.com> wrote:
> Hello Paul,
> On Apr 17, 6:26 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
>
> Will do.
>
> Ahhh... then that's a problem, I'd definitely need the ability to be
> able to programatically and dynamically change the filtering criteria
> as the need arises, in this case every time a new report is requested
> that needs a subset of data not being captured by the replication
> process. You would think that this is such a common scenario... Also,
> filtering on the client side is not an option either since that would
> mean that all of the data would get replicated to the reporting db. I
> could have sworn that I read in msdn that the filters could be changed
> via stored procs though... I'll have to look that up.
> Thanks for your help Paul!
> Anthony
This may sound like a stupid question, but are you sure replicating
the whole database isn't an option? I know you've described the
database as huge, but one mans huge is another mans insignificant (or
the other way around).
It just sounds like you're putting in a lot of work when you may be
able to keep it simple. Apologies if this is a path you've already
worn smooth, just wondering what has made you sure that bog standard
replication isn't the way to go.
Damien
|||Hello Damien,
I would *love* to have a full replication going and not have to worry
about the added complexity of creating dynamic filters or triggers,
but the powers that be simply do not consider it an option. Since I'm
not the one that makes the decisions, I can only go by whatever
options are available. They want ONLY a subset of data to be captured,
nothing more. That would be fine with me if the filter was static (ie.
not subject to change every time a new report is requested) but given
the requirements I am in the same camp as you that a full replication
would be best.
Regards,
Anthony

> This may sound like a stupid question, but are you sure replicating
> the whole database isn't an option? I know you've described the
> database as huge, but one mans huge is another mans insignificant (or
> the other way around).
> It just sounds like you're putting in a lot of work when you may be
> able to keep it simple. Apologies if this is a path you've already
> worn smooth, just wondering what has made you sure that bog standard
> replication isn't the way to go.
> Damien- Hide quoted text -
> - Show quoted text -
|||Anthony Paul wrote:

> I would *love* to have a full replication going and not have to worry
> about the added complexity of creating dynamic filters or triggers,
> but the powers that be simply do not consider it an option. Since I'm
> not the one that makes the decisions, I can only go by whatever
> options are available. They want ONLY a subset of data to be captured,
> nothing more. That would be fine with me if the filter was static (ie.
> not subject to change every time a new report is requested) but given
> the requirements I am in the same camp as you that a full replication
> would be best.
TPTB may start considering it an option if you give them a cost
analysis, depending on whether their previous motivation was "wouldn't
it be nice if" (yes, but) or "we think this is cheaper" (no it isn't)
or "this is required for security reasons" (ugh, okay) or whatever.
|||Anthony Paul (anthonypaulo@.gmail.com) writes:
> I would *love* to have a full replication going and not have to worry
> about the added complexity of creating dynamic filters or triggers,
> but the powers that be simply do not consider it an option. Since I'm
> not the one that makes the decisions, I can only go by whatever
> options are available. They want ONLY a subset of data to be captured,
> nothing more. That would be fine with me if the filter was static (ie.
> not subject to change every time a new report is requested) but given
> the requirements I am in the same camp as you that a full replication
> would be best.
From my meager experience of replication, it seems clear that the database
has to be really huge - several terabytes - to make a dynamic filtering
defensible from a cost perspective. It would be difficult to develop,
difficult to maintain and manage.
The only serious option I see to full replication is a static subset.
That is define what will be supported in replication V1. If a new reqiure-
ment that is not covered, it would have to wait to V2. The idea would
of course to only strip really big stuff with low proability to be included.
And this is what you should tell the powers that be: replicating the entire
database will be far less expensive than changing what is replicated
dynamically.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

DB question: Copying ID

Hi,

I'm trying to insert one value (an order) into the table Order and (via a for-loop) all the products in that order in the table Product, hence, one order can have multiple products (and must have at least one). I have an automatically increased value for the OrderID as the primary key for Order, and I have a foreign key named OrderID in the Product table. So far, I _think_ everything's logically correct.

However, I don't understand how to retrieve the OrderID to be able to insert it in the Product table upon insertion. I guess this is done all the time, but the only solution I can think of is to make a new SQL Command, asking for the just created OrderID to use it in the SQL Command for the products' for-loop. I'm sure that's a bad idea. :-)

Can I use relationships or so to make this automatically updated (that is, to have the Product table "check for" the OrderID and insert the OrderID upon insertion of the Product row(s))?

I hope this is clear to you. Thanks in advance for all help!

Pettrer

If you want to get the last ID after insertion then use the Scope_Identity() to get that.

Regards

Thursday, March 8, 2012

db owner

I created a new db under sql 2000. I created an ASP page to access the db, I
can access the database via the asp from my machine but others cannot. They
get a NT logon error.
I noticed that the db I created the owner has my network logon id and domain
name.
example: db owner: domain/logonid
and all the other db system generated have owner od SA.
What should the owner name be?
If its SA how can i change that?
If not, how can I allow others to access the DB via the asp page?
thanksMike
See sp_changeobjectowner in books on line. Generally it is
best for all database object to be owned by dbo.
Regards
John|||use sp_changedbowner
--
BR,
Mark Broadbent mcse+i, mcdba
_________________________
"Mike" <csharpcoder@.sbcglobal.net> wrote in message
news:OBlBsQfUDHA.212@.TK2MSFTNGP12.phx.gbl...
> I created a new db under sql 2000. I created an ASP page to access the db,
I
> can access the database via the asp from my machine but others cannot.
They
> get a NT logon error.
> I noticed that the db I created the owner has my network logon id and
domain
> name.
> example: db owner: domain/logonid
> and all the other db system generated have owner od SA.
> What should the owner name be?
> If its SA how can i change that?
> If not, how can I allow others to access the DB via the asp page?
>
> thanks
>|||Mike
Oops read the post without reading it properly, Mark is of
course right. Still now you know what to do if you do the
same with an object.
Regards
John|||I changed the db owner, but I still can't access the db via asp from a
remote machine.
Do i have to change IIS settings or something to be able to do this?
Its currenlty set up to allow anonymous access, but i'm not allowing IIS to
control the password, should I?
"John Bandettini" <johnbandettini@.yahoo.co.uk> wrote in message
news:0ff201c351f9$3d40a860$a001280a@.phx.gbl...
> Mike
> Oops read the post without reading it properly, Mark is of
> course right. Still now you know what to do if you do the
> same with an object.
> Regards
> John|||Hi Mike, does the account that you are using to connect to the remote data
source (specified in your asp pages) have access permissions to the
database.
If you are using integrated security when forming the connection I would
expect that the account used would be the iis service one (in this case
would need access), I would be very suprised if security of each user was
delegated to the sql server (a-la kerberos style).
Also look at your DSN, cos if you have configured it to connect to the data
source using sql server authentication then I would expect that this user is
the one which would need the db rights.
Its been a while since I've done this but you should get there in the end
thru trial and error. The first thing you need to get working is getting the
asp pages to run (and connect) successfully from the web server itself. Then
try getting a remote client to work (connecting and running the asp).
First
--
BR,
Mark Broadbent mcdba,mcse+i
_________________________
"Mike" <csharpcoder@.sbcglobal.net> wrote in message
news:%23nhcm2fUDHA.2316@.TK2MSFTNGP09.phx.gbl...
> I changed the db owner, but I still can't access the db via asp from a
> remote machine.
> Do i have to change IIS settings or something to be able to do this?
> Its currenlty set up to allow anonymous access, but i'm not allowing IIS
to
> control the password, should I?
> "John Bandettini" <johnbandettini@.yahoo.co.uk> wrote in message
> news:0ff201c351f9$3d40a860$a001280a@.phx.gbl...
> > Mike
> >
> > Oops read the post without reading it properly, Mark is of
> > course right. Still now you know what to do if you do the
> > same with an object.
> >
> > Regards
> >
> > John
>

Wednesday, March 7, 2012

DB Null, Dates and datatables

VS05

How are dates removed / nullified?

I have a SQL datetime field that is being editted via a datatable / adapter - The table structure defines the datetime as a date.

From here I want to remove the date - i.e. write DBNull back to the database. Setting the Date to Nothing or .minvalue results in a min date exception and DBNull cannot be cast to the datetime either.

R

um...i dont have problem to have null in date type field.

do you set allow null to true in table schema?

|||

aye, the db field is set to allow nulls.. I can set the date field to null be SQL server them chucks it out saying its out of range - needs DBnull which the date type doesnt allow..

|||

RobC00:

aye, the db field is set to allow nulls.. I can set the date field to null be SQL server them chucks it out saying its out of range - needs DBnull which the date type doesnt allow..

To write Null Value into the database use the code in the link below by passing the Null value with IF/ELSE block to the Static method DateTime.Parse. Hope this helps.

http://www.c-sharpcorner.com/Code/2003/Sept/EnterNullValuesForDateTime.asp

Friday, February 17, 2012

db in Single User mode yet can be accessed via odbc

Hi ,
How does the SINGLE USER actually works ,
i have used the follwing commands :
sp_dboption 'acb' , 'single user' 'true' and refresh
which it shows the the db : abc is now single user.
However , i can still access that db via odbc.
Is this how a single user shld works ? Not as wat in
the Books Online :
SINGLE_USER allows one user at a time to connect to the
database. All other user connections are broken. The
timeframe for breaking the connection is controlled by the
termination clause of the ALTER DATABASE statement. New
connection attempts are refused. The database remains in
SINGLE_USER mode even if the user who set the option logs
off. At that point, a different user (but only one) can
connect to the database
thkz
Single user means one user. That one user can connect through any interface,
including an odbc connection.
Are you possible confusing single user mode of a database with single user
mode of the whole SQL Server. This option you've described refers to a
single database. Maybe other connections are to other databases.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:272501c47061$cad93e30$a601280a@.phx.gbl...
> Hi ,
> How does the SINGLE USER actually works ,
> i have used the follwing commands :
> sp_dboption 'acb' , 'single user' 'true' and refresh
> which it shows the the db : abc is now single user.
> However , i can still access that db via odbc.
> Is this how a single user shld works ? Not as wat in
> the Books Online :
> SINGLE_USER allows one user at a time to connect to the
> database. All other user connections are broken. The
> timeframe for breaking the connection is controlled by the
> termination clause of the ALTER DATABASE statement. New
> connection attempts are refused. The database remains in
> SINGLE_USER mode even if the user who set the option logs
> off. At that point, a different user (but only one) can
> connect to the database
>
> thkz
>
|||Hi,
You cannot set the database to single user mode usng the below comamnd if
any user is connected to that partcular database.
sp_dboption 'northwind','single user',true
There are 2 options to make the database single user:-
1. Kill all the connected users
2. Alter database with rollback options
For SQL 2000 , the recommended option is ALTER database.
To make the database immediately single user with all the user disconnected
ALTER database <dbname> set single_user with rollback immediate
To make the database single user after n seconds then ( Here it is 120
seconds)
ALTER database <dbname> set single_user with rollback after 120
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:272501c47061$cad93e30$a601280a@.phx.gbl...
> Hi ,
> How does the SINGLE USER actually works ,
> i have used the follwing commands :
> sp_dboption 'acb' , 'single user' 'true' and refresh
> which it shows the the db : abc is now single user.
> However , i can still access that db via odbc.
> Is this how a single user shld works ? Not as wat in
> the Books Online :
> SINGLE_USER allows one user at a time to connect to the
> database. All other user connections are broken. The
> timeframe for breaking the connection is controlled by the
> termination clause of the ALTER DATABASE statement. New
> connection attempts are refused. The database remains in
> SINGLE_USER mode even if the user who set the option logs
> off. At that point, a different user (but only one) can
> connect to the database
>
> thkz
>
|||Hi,
you r right i am referring the the single user on
database level.
i have tried from my client pc to have 2 odbc
connection to the same database and it allows me to do
so. is this possible under single user ?
thks & rdgs

>--Original Message--
>Single user means one user. That one user can connect
through any interface,
>including an odbc connection.
>Are you possible confusing single user mode of a database
with single user
>mode of the whole SQL Server. This option you've
described refers to a
>single database. Maybe other connections are to other
databases.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"maxz" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:272501c47061$cad93e30$a601280a@.phx.gbl...
the[vbcol=seagreen]
logs
>
>.
>
|||Hi Maxz,
If you mention "SINGLE_USER with ROLLBACK IMMEDIATE" you cant make 2
connections to sql server.
See my previous post on how to set the single_user at database level.
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:270901c47067$f18e3e30$a401280a@.phx.gbl...[vbcol=seagreen]
> Hi,
> you r right i am referring the the single user on
> database level.
> i have tried from my client pc to have 2 odbc
> connection to the same database and it allows me to do
> so. is this possible under single user ?
> thks & rdgs
>
> through any interface,
> with single user
> described refers to a
> databases.
> message
> the
> logs
|||Hi ,
i hope i am doing it correct. This is how i do it.
first i opened 2 ms access and connect to the db via
odbc connection
at the server end , i used the query analyzer and
execute the alter database with rollback immediate
i still find that the connections are still there , and
even when i closed the access and re-open i could still
open the links
rdgs
>--Original Message--
>Hi,
>You cannot set the database to single user mode usng the
below comamnd if
>any user is connected to that partcular database.
>sp_dboption 'northwind','single user',true
>There are 2 options to make the database single user:-
>1. Kill all the connected users
>2. Alter database with rollback options
>For SQL 2000 , the recommended option is ALTER database.
>----
--
>To make the database immediately single user with all the
user disconnected
>ALTER database <dbname> set single_user with rollback
immediate
>To make the database single user after n seconds then (
Here it is 120
>seconds)
>ALTER database <dbname> set single_user with rollback
after 120
>Thanks
>Hari
>MCDBA
>
>
>"maxz" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:272501c47061$cad93e30$a601280a@.phx.gbl...
the[vbcol=seagreen]
logs
>
>.
>
|||Hi,
Can you login to Query Analyzer and execute SP_WHO and see whether there are
any connection made to that database (see the dbname column). Because I feel
that you are connecting to a different database , might be "MASTER" database
will be the default dabase when user connects in.
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:27c301c4706f$43c9dcc0$a601280a@.phx.gbl...[vbcol=seagreen]
> Hi ,
> i hope i am doing it correct. This is how i do it.
> first i opened 2 ms access and connect to the db via
> odbc connection
> at the server end , i used the query analyzer and
> execute the alter database with rollback immediate
> i still find that the connections are still there , and
> even when i closed the access and re-open i could still
> open the links
> rdgs
> below comamnd if
> --
> user disconnected
> immediate
> Here it is 120
> after 120
> message
> the
> logs
|||You should verify that you really have gotten into single user mode.
SELECT databasepropertyex('name of db', 'UserAcccess')
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:27c301c4706f$43c9dcc0$a601280a@.phx.gbl...[vbcol=seagreen]
> Hi ,
> i hope i am doing it correct. This is how i do it.
> first i opened 2 ms access and connect to the db via
> odbc connection
> at the server end , i used the query analyzer and
> execute the alter database with rollback immediate
> i still find that the connections are still there , and
> even when i closed the access and re-open i could still
> open the links
> rdgs
> below comamnd if
> --
> user disconnected
> immediate
> Here it is 120
> after 120
> message
> the
> logs

db in Single User mode yet can be accessed via odbc

Hi ,
How does the SINGLE USER actually works ,
i have used the follwing commands :
sp_dboption 'acb' , 'single user' 'true' and refresh
which it shows the the db : abc is now single user.
However , i can still access that db via odbc.
Is this how a single user shld works ? Not as wat in
the Books Online :
SINGLE_USER allows one user at a time to connect to the
database. All other user connections are broken. The
timeframe for breaking the connection is controlled by the
termination clause of the ALTER DATABASE statement. New
connection attempts are refused. The database remains in
SINGLE_USER mode even if the user who set the option logs
off. At that point, a different user (but only one) can
connect to the database
thkzSingle user means one user. That one user can connect through any interface,
including an odbc connection.
Are you possible confusing single user mode of a database with single user
mode of the whole SQL Server. This option you've described refers to a
single database. Maybe other connections are to other databases.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:272501c47061$cad93e30$a601280a@.phx.gbl...
> Hi ,
> How does the SINGLE USER actually works ,
> i have used the follwing commands :
> sp_dboption 'acb' , 'single user' 'true' and refresh
> which it shows the the db : abc is now single user.
> However , i can still access that db via odbc.
> Is this how a single user shld works ? Not as wat in
> the Books Online :
> SINGLE_USER allows one user at a time to connect to the
> database. All other user connections are broken. The
> timeframe for breaking the connection is controlled by the
> termination clause of the ALTER DATABASE statement. New
> connection attempts are refused. The database remains in
> SINGLE_USER mode even if the user who set the option logs
> off. At that point, a different user (but only one) can
> connect to the database
>
> thkz
>|||Hi,
You cannot set the database to single user mode usng the below comamnd if
any user is connected to that partcular database.
sp_dboption 'northwind','single user',true
There are 2 options to make the database single user:-
1. Kill all the connected users
2. Alter database with rollback options
For SQL 2000 , the recommended option is ALTER database.
---
To make the database immediately single user with all the user disconnected
ALTER database <dbname> set single_user with rollback immediate
To make the database single user after n seconds then ( Here it is 120
seconds)
ALTER database <dbname> set single_user with rollback after 120
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:272501c47061$cad93e30$a601280a@.phx.gbl...
> Hi ,
> How does the SINGLE USER actually works ,
> i have used the follwing commands :
> sp_dboption 'acb' , 'single user' 'true' and refresh
> which it shows the the db : abc is now single user.
> However , i can still access that db via odbc.
> Is this how a single user shld works ? Not as wat in
> the Books Online :
> SINGLE_USER allows one user at a time to connect to the
> database. All other user connections are broken. The
> timeframe for breaking the connection is controlled by the
> termination clause of the ALTER DATABASE statement. New
> connection attempts are refused. The database remains in
> SINGLE_USER mode even if the user who set the option logs
> off. At that point, a different user (but only one) can
> connect to the database
>
> thkz
>|||Hi,
you r right i am referring the the single user on
database level.
i have tried from my client pc to have 2 odbc
connection to the same database and it allows me to do
so. is this possible under single user ?
thks & rdgs

>--Original Message--
>Single user means one user. That one user can connect
through any interface,
>including an odbc connection.
>Are you possible confusing single user mode of a database
with single user
>mode of the whole SQL Server. This option you've
described refers to a
>single database. Maybe other connections are to other
databases.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"maxz" <anonymous@.discussions.microsoft.com> wrote in
message
>news:272501c47061$cad93e30$a601280a@.phx.gbl...
the[vbcol=seagreen]
logs[vbcol=seagreen]
>
>.
>|||Hi Maxz,
If you mention "SINGLE_USER with ROLLBACK IMMEDIATE" you cant make 2
connections to sql server.
See my previous post on how to set the single_user at database level.
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:270901c47067$f18e3e30$a401280a@.phx.gbl...[vbcol=seagreen]
> Hi,
> you r right i am referring the the single user on
> database level.
> i have tried from my client pc to have 2 odbc
> connection to the same database and it allows me to do
> so. is this possible under single user ?
> thks & rdgs
>
> through any interface,
> with single user
> described refers to a
> databases.
> message
> the
> logs|||Hi ,
i hope i am doing it correct. This is how i do it.
first i opened 2 ms access and connect to the db via
odbc connection
at the server end , i used the query analyzer and
execute the alter database with rollback immediate
i still find that the connections are still there , and
even when i closed the access and re-open i could still
open the links
rdgs
>--Original Message--
>Hi,
>You cannot set the database to single user mode usng the
below comamnd if
>any user is connected to that partcular database.
>sp_dboption 'northwind','single user',true
>There are 2 options to make the database single user:-
>1. Kill all the connected users
>2. Alter database with rollback options
>For SQL 2000 , the recommended option is ALTER database.
>----
--
>To make the database immediately single user with all the
user disconnected
>ALTER database <dbname> set single_user with rollback
immediate
>To make the database single user after n seconds then (
Here it is 120
>seconds)
>ALTER database <dbname> set single_user with rollback
after 120
>Thanks
>Hari
>MCDBA
>
>
>"maxz" <anonymous@.discussions.microsoft.com> wrote in
message
>news:272501c47061$cad93e30$a601280a@.phx.gbl...
the[vbcol=seagreen]
logs[vbcol=seagreen]
>
>.
>|||Hi,
Can you login to Query Analyzer and execute SP_WHO and see whether there are
any connection made to that database (see the dbname column). Because I feel
that you are connecting to a different database , might be "MASTER" database
will be the default dabase when user connects in.
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:27c301c4706f$43c9dcc0$a601280a@.phx.gbl...[vbcol=seagreen]
> Hi ,
> i hope i am doing it correct. This is how i do it.
> first i opened 2 ms access and connect to the db via
> odbc connection
> at the server end , i used the query analyzer and
> execute the alter database with rollback immediate
> i still find that the connections are still there , and
> even when i closed the access and re-open i could still
> open the links
> rdgs
> below comamnd if
> --
> user disconnected
> immediate
> Here it is 120
> after 120
> message
> the
> logs|||You should verify that you really have gotten into single user mode.
SELECT databasepropertyex('name of db', 'UserAcccess')
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:27c301c4706f$43c9dcc0$a601280a@.phx.gbl...[vbcol=seagreen]
> Hi ,
> i hope i am doing it correct. This is how i do it.
> first i opened 2 ms access and connect to the db via
> odbc connection
> at the server end , i used the query analyzer and
> execute the alter database with rollback immediate
> i still find that the connections are still there , and
> even when i closed the access and re-open i could still
> open the links
> rdgs
> below comamnd if
> --
> user disconnected
> immediate
> Here it is 120
> after 120
> message
> the
> logs

db in Single User mode yet can be accessed via odbc

Hi ,
How does the SINGLE USER actually works ,
i have used the follwing commands :
sp_dboption 'acb' , 'single user' 'true' and refresh
which it shows the the db : abc is now single user.
However , i can still access that db via odbc.
Is this how a single user shld works ? Not as wat in
the Books Online :
SINGLE_USER allows one user at a time to connect to the
database. All other user connections are broken. The
timeframe for breaking the connection is controlled by the
termination clause of the ALTER DATABASE statement. New
connection attempts are refused. The database remains in
SINGLE_USER mode even if the user who set the option logs
off. At that point, a different user (but only one) can
connect to the database
thkzSingle user means one user. That one user can connect through any interface,
including an odbc connection.
Are you possible confusing single user mode of a database with single user
mode of the whole SQL Server. This option you've described refers to a
single database. Maybe other connections are to other databases.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:272501c47061$cad93e30$a601280a@.phx.gbl...
> Hi ,
> How does the SINGLE USER actually works ,
> i have used the follwing commands :
> sp_dboption 'acb' , 'single user' 'true' and refresh
> which it shows the the db : abc is now single user.
> However , i can still access that db via odbc.
> Is this how a single user shld works ? Not as wat in
> the Books Online :
> SINGLE_USER allows one user at a time to connect to the
> database. All other user connections are broken. The
> timeframe for breaking the connection is controlled by the
> termination clause of the ALTER DATABASE statement. New
> connection attempts are refused. The database remains in
> SINGLE_USER mode even if the user who set the option logs
> off. At that point, a different user (but only one) can
> connect to the database
>
> thkz
>|||Hi,
You cannot set the database to single user mode usng the below comamnd if
any user is connected to that partcular database.
sp_dboption 'northwind','single user',true
There are 2 options to make the database single user:-
1. Kill all the connected users
2. Alter database with rollback options
For SQL 2000 , the recommended option is ALTER database.
---
To make the database immediately single user with all the user disconnected
ALTER database <dbname> set single_user with rollback immediate
To make the database single user after n seconds then ( Here it is 120
seconds)
ALTER database <dbname> set single_user with rollback after 120
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:272501c47061$cad93e30$a601280a@.phx.gbl...
> Hi ,
> How does the SINGLE USER actually works ,
> i have used the follwing commands :
> sp_dboption 'acb' , 'single user' 'true' and refresh
> which it shows the the db : abc is now single user.
> However , i can still access that db via odbc.
> Is this how a single user shld works ? Not as wat in
> the Books Online :
> SINGLE_USER allows one user at a time to connect to the
> database. All other user connections are broken. The
> timeframe for breaking the connection is controlled by the
> termination clause of the ALTER DATABASE statement. New
> connection attempts are refused. The database remains in
> SINGLE_USER mode even if the user who set the option logs
> off. At that point, a different user (but only one) can
> connect to the database
>
> thkz
>|||Hi,
you r right i am referring the the single user on
database level.
i have tried from my client pc to have 2 odbc
connection to the same database and it allows me to do
so. is this possible under single user ?
thks & rdgs
>--Original Message--
>Single user means one user. That one user can connect
through any interface,
>including an odbc connection.
>Are you possible confusing single user mode of a database
with single user
>mode of the whole SQL Server. This option you've
described refers to a
>single database. Maybe other connections are to other
databases.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"maxz" <anonymous@.discussions.microsoft.com> wrote in
message
>news:272501c47061$cad93e30$a601280a@.phx.gbl...
>> Hi ,
>> How does the SINGLE USER actually works ,
>> i have used the follwing commands :
>> sp_dboption 'acb' , 'single user' 'true' and refresh
>> which it shows the the db : abc is now single user.
>> However , i can still access that db via odbc.
>> Is this how a single user shld works ? Not as wat in
>> the Books Online :
>> SINGLE_USER allows one user at a time to connect to the
>> database. All other user connections are broken. The
>> timeframe for breaking the connection is controlled by
the
>> termination clause of the ALTER DATABASE statement. New
>> connection attempts are refused. The database remains in
>> SINGLE_USER mode even if the user who set the option
logs
>> off. At that point, a different user (but only one) can
>> connect to the database
>>
>> thkz
>
>.
>|||Hi Maxz,
If you mention "SINGLE_USER with ROLLBACK IMMEDIATE" you cant make 2
connections to sql server.
See my previous post on how to set the single_user at database level.
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:270901c47067$f18e3e30$a401280a@.phx.gbl...
> Hi,
> you r right i am referring the the single user on
> database level.
> i have tried from my client pc to have 2 odbc
> connection to the same database and it allows me to do
> so. is this possible under single user ?
> thks & rdgs
>
> >--Original Message--
> >Single user means one user. That one user can connect
> through any interface,
> >including an odbc connection.
> >
> >Are you possible confusing single user mode of a database
> with single user
> >mode of the whole SQL Server. This option you've
> described refers to a
> >single database. Maybe other connections are to other
> databases.
> >
> >--
> >HTH
> >--
> >Kalen Delaney
> >SQL Server MVP
> >www.SolidQualityLearning.com
> >
> >
> >"maxz" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:272501c47061$cad93e30$a601280a@.phx.gbl...
> >> Hi ,
> >>
> >> How does the SINGLE USER actually works ,
> >> i have used the follwing commands :
> >> sp_dboption 'acb' , 'single user' 'true' and refresh
> >> which it shows the the db : abc is now single user.
> >>
> >> However , i can still access that db via odbc.
> >>
> >> Is this how a single user shld works ? Not as wat in
> >> the Books Online :
> >>
> >> SINGLE_USER allows one user at a time to connect to the
> >> database. All other user connections are broken. The
> >> timeframe for breaking the connection is controlled by
> the
> >> termination clause of the ALTER DATABASE statement. New
> >> connection attempts are refused. The database remains in
> >> SINGLE_USER mode even if the user who set the option
> logs
> >> off. At that point, a different user (but only one) can
> >> connect to the database
> >>
> >>
> >> thkz
> >>
> >
> >
> >.
> >|||Hi ,
i hope i am doing it correct. This is how i do it.
first i opened 2 ms access and connect to the db via
odbc connection
at the server end , i used the query analyzer and
execute the alter database with rollback immediate
i still find that the connections are still there , and
even when i closed the access and re-open i could still
open the links
rdgs
>--Original Message--
>Hi,
>You cannot set the database to single user mode usng the
below comamnd if
>any user is connected to that partcular database.
>sp_dboption 'northwind','single user',true
>There are 2 options to make the database single user:-
>1. Kill all the connected users
>2. Alter database with rollback options
>For SQL 2000 , the recommended option is ALTER database.
>----
--
>To make the database immediately single user with all the
user disconnected
>ALTER database <dbname> set single_user with rollback
immediate
>To make the database single user after n seconds then (
Here it is 120
>seconds)
>ALTER database <dbname> set single_user with rollback
after 120
>Thanks
>Hari
>MCDBA
>
>
>"maxz" <anonymous@.discussions.microsoft.com> wrote in
message
>news:272501c47061$cad93e30$a601280a@.phx.gbl...
>> Hi ,
>> How does the SINGLE USER actually works ,
>> i have used the follwing commands :
>> sp_dboption 'acb' , 'single user' 'true' and refresh
>> which it shows the the db : abc is now single user.
>> However , i can still access that db via odbc.
>> Is this how a single user shld works ? Not as wat in
>> the Books Online :
>> SINGLE_USER allows one user at a time to connect to the
>> database. All other user connections are broken. The
>> timeframe for breaking the connection is controlled by
the
>> termination clause of the ALTER DATABASE statement. New
>> connection attempts are refused. The database remains in
>> SINGLE_USER mode even if the user who set the option
logs
>> off. At that point, a different user (but only one) can
>> connect to the database
>>
>> thkz
>
>.
>|||Hi,
Can you login to Query Analyzer and execute SP_WHO and see whether there are
any connection made to that database (see the dbname column). Because I feel
that you are connecting to a different database , might be "MASTER" database
will be the default dabase when user connects in.
Thanks
Hari
MCDBA
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:27c301c4706f$43c9dcc0$a601280a@.phx.gbl...
> Hi ,
> i hope i am doing it correct. This is how i do it.
> first i opened 2 ms access and connect to the db via
> odbc connection
> at the server end , i used the query analyzer and
> execute the alter database with rollback immediate
> i still find that the connections are still there , and
> even when i closed the access and re-open i could still
> open the links
> rdgs
> >--Original Message--
> >Hi,
> >
> >You cannot set the database to single user mode usng the
> below comamnd if
> >any user is connected to that partcular database.
> >
> >sp_dboption 'northwind','single user',true
> >
> >There are 2 options to make the database single user:-
> >
> >1. Kill all the connected users
> >2. Alter database with rollback options
> >
> >For SQL 2000 , the recommended option is ALTER database.
> >----
> --
> >
> >To make the database immediately single user with all the
> user disconnected
> >
> >ALTER database <dbname> set single_user with rollback
> immediate
> >
> >To make the database single user after n seconds then (
> Here it is 120
> >seconds)
> >
> >ALTER database <dbname> set single_user with rollback
> after 120
> >
> >Thanks
> >Hari
> >MCDBA
> >
> >
> >
> >
> >
> >"maxz" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:272501c47061$cad93e30$a601280a@.phx.gbl...
> >> Hi ,
> >>
> >> How does the SINGLE USER actually works ,
> >> i have used the follwing commands :
> >> sp_dboption 'acb' , 'single user' 'true' and refresh
> >> which it shows the the db : abc is now single user.
> >>
> >> However , i can still access that db via odbc.
> >>
> >> Is this how a single user shld works ? Not as wat in
> >> the Books Online :
> >>
> >> SINGLE_USER allows one user at a time to connect to the
> >> database. All other user connections are broken. The
> >> timeframe for breaking the connection is controlled by
> the
> >> termination clause of the ALTER DATABASE statement. New
> >> connection attempts are refused. The database remains in
> >> SINGLE_USER mode even if the user who set the option
> logs
> >> off. At that point, a different user (but only one) can
> >> connect to the database
> >>
> >>
> >> thkz
> >>
> >
> >
> >.
> >|||You should verify that you really have gotten into single user mode.
SELECT databasepropertyex('name of db', 'UserAcccess')
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"maxz" <anonymous@.discussions.microsoft.com> wrote in message
news:27c301c4706f$43c9dcc0$a601280a@.phx.gbl...
> Hi ,
> i hope i am doing it correct. This is how i do it.
> first i opened 2 ms access and connect to the db via
> odbc connection
> at the server end , i used the query analyzer and
> execute the alter database with rollback immediate
> i still find that the connections are still there , and
> even when i closed the access and re-open i could still
> open the links
> rdgs
> >--Original Message--
> >Hi,
> >
> >You cannot set the database to single user mode usng the
> below comamnd if
> >any user is connected to that partcular database.
> >
> >sp_dboption 'northwind','single user',true
> >
> >There are 2 options to make the database single user:-
> >
> >1. Kill all the connected users
> >2. Alter database with rollback options
> >
> >For SQL 2000 , the recommended option is ALTER database.
> >----
> --
> >
> >To make the database immediately single user with all the
> user disconnected
> >
> >ALTER database <dbname> set single_user with rollback
> immediate
> >
> >To make the database single user after n seconds then (
> Here it is 120
> >seconds)
> >
> >ALTER database <dbname> set single_user with rollback
> after 120
> >
> >Thanks
> >Hari
> >MCDBA
> >
> >
> >
> >
> >
> >"maxz" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:272501c47061$cad93e30$a601280a@.phx.gbl...
> >> Hi ,
> >>
> >> How does the SINGLE USER actually works ,
> >> i have used the follwing commands :
> >> sp_dboption 'acb' , 'single user' 'true' and refresh
> >> which it shows the the db : abc is now single user.
> >>
> >> However , i can still access that db via odbc.
> >>
> >> Is this how a single user shld works ? Not as wat in
> >> the Books Online :
> >>
> >> SINGLE_USER allows one user at a time to connect to the
> >> database. All other user connections are broken. The
> >> timeframe for breaking the connection is controlled by
> the
> >> termination clause of the ALTER DATABASE statement. New
> >> connection attempts are refused. The database remains in
> >> SINGLE_USER mode even if the user who set the option
> logs
> >> off. At that point, a different user (but only one) can
> >> connect to the database
> >>
> >>
> >> thkz
> >>
> >
> >
> >.
> >