Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Wednesday, March 28, 2012

RMO On Sql Server 2000

Hi.

I'm using RMO to connect to a MSSQL 2000 Server to manage replication. I've successfully connected to the server, created the distributor, publication, articles and subscriber. However, when i try to manage the agents (ie. TransPublication.StartSnapshotGenerationAgentJob) it says the method is only supported on MSSQL 2005.

Is there any way I can control the agents from RMO on sqlserver 2000?

Tore BirkelandHi again.

After a bit of searching, i found the assembly Microsoft.SqlServer.Replication.dll.
This contains, among other things, the SnapshotGenerationAgent class, which apparently can create snapshot-jobs on MSSQL 2000.

However, the commands created by this class does not seem to work properly: The distribution agent fails with the error 'Invalid distribution command type.'. The failed command is '[ImmediateExecution]ALTER TABLE [dbo] ADD CONSTRAINT [PK_Artikkel] PRIMARY KEY CLUSTERED'.

using sp_browsereplcmds, i can see that this [ImmediateExecution]-command is executed just before the .idx script, which contains the same sql statement. (?!?)

Using enterprisemanager to start the snapshot agent, and sp_browsereplcmds, i see that there is no '[ImmediateExecution]'-command created, but otherwise it looks very much the same.

Is there any way in which i can control which commands are created by the SnapshotGenerationAgent class?

please help!
Tore|||Hi Tore,

The strange-looking commands that you saw are acutally meant for a SQL2005 version of the distribution agent and the SQL20005 version of sp_MSget_repl_commands is supposed to filter them out when a < SQL2005 version of the distribution agent connects. The reason why we have the strange-looking commands as well as the same statements in the .idx files is for interoperability with both SQL2005 and < SQL2005 distribution agents. (SQL2005 distribution agents will use the strange-looking commands while <SQL2005 distribution agents will use the .idx files)

Based on what I said in the previous paragraph, it would appear that you are using the SnapshotGenerationAgent class on a pure SQL2000 environment (Is your distributor SQL2000 as well? Or, is it running an earlier version of the SQL2005 CTP|BETA?) which is not a supported scenario. I am a bit surprised that you were able to generate the snapshot without errors at all so I guess we should probably put in a more explicit check to prevent this in the future.

Unfortunately, there really is no easy way to start a snapshot agent via RMO in a SQL2000 environment (SQL2000 doesn't have the system procedures required for this functionality hence the reason why you hit the error in your original post.) The best way to go about starting the snapshot agent in a SQL2000 environment is to find out the job_id and job_name of the snapshot agent and then use the SMO Job object or simply call sp_start_job to start it.

HTH

-Raymond|||Hi Raymond, thanks for your answer.

Yes, for now, i'm using Sql2000 both at publisher/distributor and subscriber, but at Michiels talk at TechEd Amsterdam, i became a little excited about Smo and I hope i'll be able to use it in my scenario :). Our product will support Sql2005 when it is released, but we'll have to support Sql2000 for quite a few years still.

I wonder, is there any overview of which features of Smo/Rmo are supported on Sql2000? You say that SnapshotGenerationAgent is not supported on a Sql2000 distributor, however, it works splendidly on merge replication, only not for transactional replication. :)

Another problem i run into, is when i try to access the SynchronizationAgent member of the MergeSubscriber class. When i try to access the property, the following exception occurs:

ex.ToString "Microsoft.SqlServer.Replication.ComErrorException (0x80040154): Class not registered
at Microsoft.SqlServer.Replication.MergeSynchronizationAgent..ctor()
at Microsoft.SqlServer.Replication.MergeSubscription.get_SynchronizationAgent()

Is the class not registered in the sense of a com component not registered, or does this relate to my servers running Sql2000? (on my client computer i have only installed the Sql2005 client tools, not the server itself)

Regards,
Tore|||

Hi Torre, I am glad that you are excited about SMO\RMO but at the same time, I feel really bad that what I am about to say is going to considerably dampen that excitement :(

By unsupported, we (as in folks from MS) typically mean that a particular configuration is not tested and\or key decision makers don't feel that it is worth the effort to make it work. Things may "appear" great as you have discovered in the case of running the SnapshotGenerationAgent class against a SQL2000 distributor for a merge publication (although I have just put in a check to disable that scenario) but we really can't provide any guarantee that you won't get yourself into trouble. In hindsight, we should spell out more clearly what we actually support.

To give you a better idea of why we typically don't support downlevel distributors (i.e distributor version < replication agent version), you need to understand that unlike SMO\DMO, replication (and hence RMO) is geared more towards serving DBAs rather than application developers embedding replication components into their applications. And over the years (and the past couple of releases) of basing our upgrade model on being good enough for serving DBAs, we implicitly built in the assumption that when someone upgrade the distributor, all replication agents running at the distributor are upgraded to the same level and vice versa.

In fact, the reasons you hit the "Class not registered" error when you tried running the *SynchronizationAgent class in your SQL2000 distributor environment are that 1) the *SynchronizationAgent classes are nothing more than thin wrappers on top of the SQLMerge and SQLDistribution ActiveX controls, and 2) the binaries for backing those controls are simply absent since you haven't upgraded the SQL2000 distributor yet.

Perhaps we should really try to support downlevel distributors given that at least one customer would like to see such functionality but unfortunately you probably have to wait until the next release before we get our act together. All is not lost, however, despite what I have just said. To support SQL2000 distributor in your application, you need to use the SQLSnapshot, SQLMerge, and SQLDistribution ActiveX controls instead of the SnapshotGenerationAgent, MergeSynchronizationAgent, and TransSynchronizationAgent managed classes for running the replication agents although I can imagine that you would find special- casing for SQL2000 and SQL2005 distributors to be quite undesirable in your application.

-Raymond

|||Thank you for your swift reply, Raymond.
I would really appreciate if you would look into the possibility of supporting downlevel distributors in the future. but for now, I will look into the SQL* ActiveX controls.
And btw, you haven't relly dampened my excitement; i'll just have to push harder for our customers to upgrade to Sql2005 when it ships ;)
again, thank you for your time,
-Tore

Monday, March 26, 2012

Risks of single MSSQL domain account for mult servers?

Greetings:
I am trying to conceive what risks might be created by running
multiple SQL servers within a domain under a single domain account, as
opposed to 1) running under the local service account or 2) multiple
domain service accounts.
In this case, all the SQL servers are SQL2000 running on Win2003. The
service account is assigned only to the "Domain Users" group.
We do use linked server calls, and I have played and suceeded getting
Kereberos up to avoid double hop issues when using Windows Auth. In
fact, this is one of the reasons that sparked the question in my mind
-- in all the MS Kerebos SQL<->SQL examples, the SQL servers run under
a unique service account.
As an aside, most of the servers are "line of business" servers, but
HR runs under a unique server with more sensitive information. I don't
really think that merits a seperate service account, but again, I
could well be missing something.
I mostly looking for food for thought, but concrete examples of
gotchas would be appreciated.
Thanks all.
d.
D (or should I call you d?),
One drawback of using a single service account is that a breach of security
on that account means a breach on all of your SQL Servers.
(Yes, it is easier to only have one account to manage. Also, once upon a
time (a long time ago) it made replication easier.)
Russell Fields
"D Barry" <google@.dcbarry.com> wrote in message
news:6d9b9a07.0405201046.548244c2@.posting.google.c om...
> Greetings:
> I am trying to conceive what risks might be created by running
> multiple SQL servers within a domain under a single domain account, as
> opposed to 1) running under the local service account or 2) multiple
> domain service accounts.
> In this case, all the SQL servers are SQL2000 running on Win2003. The
> service account is assigned only to the "Domain Users" group.
> We do use linked server calls, and I have played and suceeded getting
> Kereberos up to avoid double hop issues when using Windows Auth. In
> fact, this is one of the reasons that sparked the question in my mind
> -- in all the MS Kerebos SQL<->SQL examples, the SQL servers run under
> a unique service account.
>
> As an aside, most of the servers are "line of business" servers, but
> HR runs under a unique server with more sensitive information. I don't
> really think that merits a seperate service account, but again, I
> could well be missing something.
>
> I mostly looking for food for thought, but concrete examples of
> gotchas would be appreciated.
> Thanks all.
> d.
|||It can be problematic, especially if you have to restart all of the SQL Servers to change the password for the SQL Server account.
|||Russell:
It's "d.". "D." is just too pompous... ;-)
I should have stated the breach against one is a breach of all
arugument. (We do use nice long complex passwords.) I'm looking for
other
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message news:<ubmx4TqPEHA.2976@.TK2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> D (or should I call you d?),
> One drawback of using a single service account is that a breach of security
> on that account means a breach on all of your SQL Servers.
> (Yes, it is easier to only have one account to manage. Also, once upon a
> time (a long time ago) it made replication easier.)
> Russell Fields
> "D Barry" <google@.dcbarry.com> wrote in message
> news:6d9b9a07.0405201046.548244c2@.posting.google.c om...
<snip>
[vbcol=seagreen]

Risks of single MSSQL domain account for mult servers?

Greetings:
I am trying to conceive what risks might be created by running
multiple SQL servers within a domain under a single domain account, as
opposed to 1) running under the local service account or 2) multiple
domain service accounts.
In this case, all the SQL servers are SQL2000 running on Win2003. The
service account is assigned only to the "Domain Users" group.
We do use linked server calls, and I have played and suceeded getting
Kereberos up to avoid double hop issues when using Windows Auth. In
fact, this is one of the reasons that sparked the question in my mind
-- in all the MS Kerebos SQL<->SQL examples, the SQL servers run under
a unique service account.
As an aside, most of the servers are "line of business" servers, but
HR runs under a unique server with more sensitive information. I don't
really think that merits a seperate service account, but again, I
could well be missing something.
I mostly looking for food for thought, but concrete examples of
gotchas would be appreciated.
Thanks all.
d.D (or should I call you d?),
One drawback of using a single service account is that a breach of security
on that account means a breach on all of your SQL Servers.
(Yes, it is easier to only have one account to manage. Also, once upon a
time (a long time ago) it made replication easier.)
Russell Fields
"D Barry" <google@.dcbarry.com> wrote in message
news:6d9b9a07.0405201046.548244c2@.posting.google.com...
> Greetings:
> I am trying to conceive what risks might be created by running
> multiple SQL servers within a domain under a single domain account, as
> opposed to 1) running under the local service account or 2) multiple
> domain service accounts.
> In this case, all the SQL servers are SQL2000 running on Win2003. The
> service account is assigned only to the "Domain Users" group.
> We do use linked server calls, and I have played and suceeded getting
> Kereberos up to avoid double hop issues when using Windows Auth. In
> fact, this is one of the reasons that sparked the question in my mind
> -- in all the MS Kerebos SQL<->SQL examples, the SQL servers run under
> a unique service account.
>
> As an aside, most of the servers are "line of business" servers, but
> HR runs under a unique server with more sensitive information. I don't
> really think that merits a seperate service account, but again, I
> could well be missing something.
>
> I mostly looking for food for thought, but concrete examples of
> gotchas would be appreciated.
> Thanks all.
> d.|||It can be problematic, especially if you have to restart all of the SQL Ser
vers to change the password for the SQL Server account.|||Russell:
It's "d.". "D." is just too pompous... ;-)
I should have stated the breach against one is a breach of all
arugument. (We do use nice long complex passwords.) I'm looking for
other
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message news:<ubmx4TqPEHA.2976@.TK
2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> D (or should I call you d?),
> One drawback of using a single service account is that a breach of securit
y
> on that account means a breach on all of your SQL Servers.
> (Yes, it is easier to only have one account to manage. Also, once upon a
> time (a long time ago) it made replication easier.)
> Russell Fields
> "D Barry" <google@.dcbarry.com> wrote in message
> news:6d9b9a07.0405201046.548244c2@.posting.google.com...
<snip>
[vbcol=seagreen]

Risks of single MSSQL domain account for mult servers?

Greetings:
I am trying to conceive what risks might be created by running
multiple SQL servers within a domain under a single domain account, as
opposed to 1) running under the local service account or 2) multiple
domain service accounts.
In this case, all the SQL servers are SQL2000 running on Win2003. The
service account is assigned only to the "Domain Users" group.
We do use linked server calls, and I have played and suceeded getting
Kereberos up to avoid double hop issues when using Windows Auth. In
fact, this is one of the reasons that sparked the question in my mind
-- in all the MS Kerebos SQL<->SQL examples, the SQL servers run under
a unique service account.
As an aside, most of the servers are "line of business" servers, but
HR runs under a unique server with more sensitive information. I don't
really think that merits a seperate service account, but again, I
could well be missing something.
I mostly looking for food for thought, but concrete examples of
gotchas would be appreciated.
Thanks all.
d.D (or should I call you d?),
One drawback of using a single service account is that a breach of security
on that account means a breach on all of your SQL Servers.
(Yes, it is easier to only have one account to manage. Also, once upon a
time (a long time ago) it made replication easier.)
Russell Fields
"D Barry" <google@.dcbarry.com> wrote in message
news:6d9b9a07.0405201046.548244c2@.posting.google.com...
> Greetings:
> I am trying to conceive what risks might be created by running
> multiple SQL servers within a domain under a single domain account, as
> opposed to 1) running under the local service account or 2) multiple
> domain service accounts.
> In this case, all the SQL servers are SQL2000 running on Win2003. The
> service account is assigned only to the "Domain Users" group.
> We do use linked server calls, and I have played and suceeded getting
> Kereberos up to avoid double hop issues when using Windows Auth. In
> fact, this is one of the reasons that sparked the question in my mind
> -- in all the MS Kerebos SQL<->SQL examples, the SQL servers run under
> a unique service account.
>
> As an aside, most of the servers are "line of business" servers, but
> HR runs under a unique server with more sensitive information. I don't
> really think that merits a seperate service account, but again, I
> could well be missing something.
>
> I mostly looking for food for thought, but concrete examples of
> gotchas would be appreciated.
> Thanks all.
> d.|||Russell:
It's "d.". "D." is just too pompous... ;-)
I should have stated the breach against one is a breach of all
arugument. (We do use nice long complex passwords.) I'm looking for
other
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message news:<ubmx4TqPEHA.2976@.TK2MSFTNGP10.phx.gbl>...
> D (or should I call you d?),
> One drawback of using a single service account is that a breach of security
> on that account means a breach on all of your SQL Servers.
> (Yes, it is easier to only have one account to manage. Also, once upon a
> time (a long time ago) it made replication easier.)
> Russell Fields
> "D Barry" <google@.dcbarry.com> wrote in message
> news:6d9b9a07.0405201046.548244c2@.posting.google.com...
> > Greetings:
> >
> > I am trying to conceive what risks might be created by running
> > multiple SQL servers within a domain under a single domain account, as
> > opposed to 1) running under the local service account or 2) multiple
> > domain service accounts.
> >
<snip>
> > Thanks all.
> >
> > d.sql

Risks of single MSSQL domain account for mult servers?

Greetings:

I am trying to conceive what risks might be created by running
multiple SQL servers within a domain under a single domain account, as
opposed to 1) running under the local service account or 2) multiple
domain service accounts.

In this case, all the SQL servers are SQL2000 running on Win2003. The
service account is assigned only to the "Domain Users" group.

We do use linked server calls, and I have played and suceeded getting
Kereberos up to avoid double hop issues when using Windows Auth. In
fact, this is one of the reasons that sparked the question in my mind
-- in all the MS Kerebos SQL<->SQL examples, the SQL servers run under
a unique service account.

As an aside, most of the servers are "line of business" servers, but
HR runs under a unique server with more sensitive information. I don't
really think that merits a seperate service account, but again, I
could well be missing something.

I mostly looking for food for thought, but concrete examples of
gotchas would be appreciated.

Thanks all.

d.D (or should I call you d?),

One drawback of using a single service account is that a breach of security
on that account means a breach on all of your SQL Servers.

(Yes, it is easier to only have one account to manage. Also, once upon a
time (a long time ago) it made replication easier.)

Russell Fields
"D Barry" <google@.dcbarry.com> wrote in message
news:6d9b9a07.0405201046.548244c2@.posting.google.c om...
> Greetings:
> I am trying to conceive what risks might be created by running
> multiple SQL servers within a domain under a single domain account, as
> opposed to 1) running under the local service account or 2) multiple
> domain service accounts.
> In this case, all the SQL servers are SQL2000 running on Win2003. The
> service account is assigned only to the "Domain Users" group.
> We do use linked server calls, and I have played and suceeded getting
> Kereberos up to avoid double hop issues when using Windows Auth. In
> fact, this is one of the reasons that sparked the question in my mind
> -- in all the MS Kerebos SQL<->SQL examples, the SQL servers run under
> a unique service account.
>
> As an aside, most of the servers are "line of business" servers, but
> HR runs under a unique server with more sensitive information. I don't
> really think that merits a seperate service account, but again, I
> could well be missing something.
>
> I mostly looking for food for thought, but concrete examples of
> gotchas would be appreciated.
> Thanks all.
> d.|||Russell:

It's "d.". "D." is just too pompous... ;-)

I should have stated the breach against one is a breach of all
arugument. (We do use nice long complex passwords.) I'm looking for
other

"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message news:<ubmx4TqPEHA.2976@.TK2MSFTNGP10.phx.gbl>...
> D (or should I call you d?),
> One drawback of using a single service account is that a breach of security
> on that account means a breach on all of your SQL Servers.
> (Yes, it is easier to only have one account to manage. Also, once upon a
> time (a long time ago) it made replication easier.)
> Russell Fields
> "D Barry" <google@.dcbarry.com> wrote in message
> news:6d9b9a07.0405201046.548244c2@.posting.google.c om...
> > Greetings:
> > I am trying to conceive what risks might be created by running
> > multiple SQL servers within a domain under a single domain account, as
> > opposed to 1) running under the local service account or 2) multiple
> > domain service accounts.
<snip
> > Thanks all.
> > d.

Wednesday, March 21, 2012

rewriting Oracle trigger to MSSQL

Hello,

I have this trigger :
CREATE OR REPLACE TRIGGER PLN_TEST
BEFORE INSERT
ON
TEST
REFERENCING
New AS MyNew
Old AS MyOld
FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
v_new_syscode TEST.SYSCODE%TYPE;
BEGIN
if :MyNew.Syscode is null then

PLN_GETNEWID('TEST',v_new_syscode);
commit;
:MyNew.SYSCODE :=v_new_syscode;
end if;
END
;
/

How can I rewrite it to MSSQL

ThanksProviding that your table has a unique record identifier field, the following will do the trick:

create trigger PLN_TEST on TEST for INSERT as
update t set syscode = newid()
from inserted i
inner join TEST t
on i.record_id = t.record_id
where t.syscode is null|||The problem is that i can get my id in oracle in a AUTONOMOUS_TRANSACTION, i think that this can not be done in MSSQL
Is this true.|||The entire UPDATE in proposed trigger is autonomous. Of course, it should be followed by this code to meet the basic programming standards:

if @.@.error != 0 begin
raiserror ('Update failed!', 15, 1)
rollback transaction
end

Tuesday, March 20, 2012

Revoke View any database from public in MSSQL 2005

Hello Everyone,
I am running into an issue when I run the following query to revoke access
to all the SQL 2005 users from other DB.s
use master
Revoke View any database from public
Go
When the users logs in with SMSE he/she does not see the db under “databas
es”.
They can only access via QUERY.
Thanks,
-CarlosDoesn't it make sense, after all, you removed (REVOKE) the ability to see
(VIEW) any (that means ALL) database to everyone (PUBLIC).
Perhaps you had a different outcome in mind, and you would like some help.
But you're going to have to be more specific, It's a waste of time to try to
guess what you want as a final outcome.
Your question/request is not clear.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Carlos Caneja" <Carlos Caneja@.discussions.microsoft.com> wrote in message
news:A446C59B-C7BA-4CBF-B158-D3F88BD24434@.microsoft.com...
> Hello Everyone,
> I am running into an issue when I run the following query to revoke access
> to all the SQL 2005 users from other DB.s
> use master
> Revoke View any database from public
> Go
> When the users logs in with SMSE he/she does not see the db under
> "databases".
> They can only access via QUERY.
> Thanks,
> -Carlos
>|||Arnie,
Sorry for not being so clear on this. I will try to explaing in a different
way.
We run a shared hosting enviroment and SQL 2005 out of the box let's users
view all the db's and logins on the server when using SMSE.
By revoking the view command the users should still be able to see their
DB's since their role to each is "DBO".
As I said on the post, they can run queriues against the db using SMSE but
the tool will not graphicaly show you the db as it shows Master and tempdb.
Perhaps this will also help you understand my issue a big better.
http://weblogs.asp.net/hosterposter.../17/443118.aspx
Thanks for the reply,
-Carlos
"Arnie Rowland" wrote:

> Doesn't it make sense, after all, you removed (REVOKE) the ability to see
> (VIEW) any (that means ALL) database to everyone (PUBLIC).
> Perhaps you had a different outcome in mind, and you would like some help.
> But you're going to have to be more specific, It's a waste of time to try
to
> guess what you want as a final outcome.
> Your question/request is not clear.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "Carlos Caneja" <Carlos Caneja@.discussions.microsoft.com> wrote in message
> news:A446C59B-C7BA-4CBF-B158-D3F88BD24434@.microsoft.com...
>
>|||You mention they should see the databases "since their role
to each is "DBO".
The behavior will work as the article describes but I'm not
sure what you mean by their role to each is dbo. If you mean
adding the user to db_owner role, that won't do it. The user
needs to be mapped to dbo - as in be the owner of the
database. There is a difference.
Look at who the owner of the database is by executing
sp_helpdb 'YourDatabase'
or execute
sp_helpuser 'dbo'
-Sue
On Tue, 26 Sep 2006 13:36:02 -0700, Carlos Caneja
<CarlosCaneja@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Arnie,
>Sorry for not being so clear on this. I will try to explaing in a differen
t
>way.
>We run a shared hosting enviroment and SQL 2005 out of the box let's users
>view all the db's and logins on the server when using SMSE.
>By revoking the view command the users should still be able to see their
>DB's since their role to each is "DBO".
>As I said on the post, they can run queriues against the db using SMSE but
>the tool will not graphicaly show you the db as it shows Master and tempdb.
>Perhaps this will also help you understand my issue a big better.
>http://weblogs.asp.net/hosterposter.../17/443118.aspx
>Thanks for the reply,
>-Carlos
>"Arnie Rowland" wrote:
>|||Sue,
Each user is the dbo to each database.
-Carlos
"Sue Hoegemeier" wrote:

> You mention they should see the databases "since their role
> to each is "DBO".
> The behavior will work as the article describes but I'm not
> sure what you mean by their role to each is dbo. If you mean
> adding the user to db_owner role, that won't do it. The user
> needs to be mapped to dbo - as in be the owner of the
> database. There is a difference.
> Look at who the owner of the database is by executing
> sp_helpdb 'YourDatabase'
> or execute
> sp_helpuser 'dbo'
> -Sue
> On Tue, 26 Sep 2006 13:36:02 -0700, Carlos Caneja
> <CarlosCaneja@.discussions.microsoft.com> wrote:
>
>|||Lines: 1
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: c-24-8-112-204.hsd1.co.comcast.net 24.8.112.204
Xref: leafnode.mcse.ms microsoft.public.sqlserver.security:1263
DBO gets misunderstood sometimes so that's why I'm wondering
if that's not the issue. I just did a few tests and it works
fine on two instances I just tested in on. As long as the
logins were database owners, they could see the database.
Anything else, and they could not see the database.
If SomeUser is the login and user in question, the results
for sp_helpuser 'dbo' in that database are:
UserName: dbo
GroupName: db_owner
LoginName: SomeUser
The results for sp_helpdb 'YourDatabase list the owner as
SomeUser.
If that's your results, try changing the database owner
using sp_changedbowner and try changing it back to the user
you need to have own the database.
-Sue
On Wed, 27 Sep 2006 11:01:02 -0700, Carlos Caneja
<CarlosCaneja@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Sue,
>Each user is the dbo to each database.
>-Carlos
>"Sue Hoegemeier" wrote:
>

Reverting From MSSQL 2005 to 2000-Help please....

I have installed MSSQL 2005 on my D: drive of my windows 2003 server, but now need to install MSSQL version 2000 b/c I realized I have one less license than I thought I had. I have build no databases, only the default information. Can I install another instance (being the 2000 instance) on the same drive? If I can't, can I install it on the CBig Smilerive without a lot of issues? Or would it be easier to remove 2005 and just start from scratch? The sql version is 9.0. Any help or comments would be greatly appreciated.!!!!!

It 'should' be OK to have both versions.

However, if you are not planning to use the SQL 2005 because of licensing issues, it may prove easier to just remove it. (My attitude is that if there is no license for it, then it shouldn't be on a computer (who knows when the licenising 'police' may show up...)

|||There are no problems running SQL 2005 and SQL 2000 on the same machine and the same drive.

Friday, March 9, 2012

Reusing connections

Every time my asp.net app needs to open a connection, it tries to establish a new connection with the mssql server. I′ve already set the max pool size property in the connection string. After that, my app raises an "time out"error saying it couldn′t obtain a connection from the pool. The problem is that I have a lot of iddle connections. With the Enterprise Manager I can see the status of the connections. They′re all the same "awaiting command". How can I reuse this connections? I know that the connection string must be the same for all connections and it is. I′ve set it in the web.config file. If I remove the max pool size property from the connection string I get a lot, I mean A LOT of connections with the sql server. Any ideas?

You should be ensuring that all connections get closed using a try/catch/finally block. Also, take a look at the following articles:

Tuning Up ADO.NET Connection Pooling With ASP.NET Applications
ASP.NET and SQL Server Performance Tips
The .NET Connection Pool Lifeguard

HTH

Saturday, February 25, 2012

Returning range of records in MSSQL

Hi guys, I need to know if there is a way to select a range of records from a database. Kind of like using SELECT TOP 1000, but I need to be able to specify which records to return. So I imagine it would look like this:

SELECT TOP 2000-5000 * FROM customers WHERE groupid=2 ORDER BY FirstName DESC

Where this statement would return only records 2000 to 5000 of the returned results.Did you try reading the manual?

Not found it?

Reason: no, there is no way to do this.

Sorry.|||Well, you *could* do something like this, although I suggest you check the performance.


SELECT
*
FROM
(
SELECT TOP 3001
*
FROM
(
SELECT TOP 5000
*
FROM
customers
WHERE
groupid = 2
ORDER BY
FirstName DESC
) AS S1
ORDER BY
FirstName ASC
) AS S2
ORDER BY
FirstName DESC

Terri