Showing posts with label window. Show all posts
Showing posts with label window. Show all posts

Monday, March 19, 2012

Database server connection

I am trying to using sqlserver as back-end for an application(web) running
on the window 2X, one thing I am not sure is that once I establish the
connection between database server and application, should I keep this
connection open while application is running, or only open it when
there is a requet to qury records from database?

Thanks for your help."Leon" <penghao98@.hotmail.com> wrote in message
news:89a0a7de.0409221926.6c394129@.posting.google.c om...
>I am trying to using sqlserver as back-end for an application(web) running
> on the window 2X, one thing I am not sure is that once I establish the
> connection between database server and application, should I keep this
> connection open while application is running, or only open it when
> there is a requet to qury records from database?
> Thanks for your help.

I believe the usual approach is to leave the connection open, to avoid the
overhead associated with opening and closing the connection again and again.
This is one reason for using connection pooling, for example.

You might want to post in a forum for your client library (eg ADO, JDBC) or
development environment (eg ASP, PHP) to see if there are any specific
considerations for your application.

Simon|||penghao98@.hotmail.com (Leon) wrote in message news:<89a0a7de.0409221926.6c394129@.posting.google.com>...
> I am trying to using sqlserver as back-end for an application(web) running
> on the window 2X, one thing I am not sure is that once I establish the
> connection between database server and application, should I keep this
> connection open while application is running, or only open it when
> there is a requet to qury records from database?
> Thanks for your help.

Hi,
This is question basically regarding connection pooling.
Which technology you are using for database acess? like ADO,JDO, JDBc
etc..?
In all these you can create a pool of connections and maintain it. So
the best thing which I feel is ,during boot up of your application
create a pool of connections, store it and use the connection when
needed.
This is purely dependent on your application also.

Some technologies like ADO and JDBC now support disconnected rowsets
also like CachedRowset in Java where internally it will(means
driver/proider) handle reconnecting to the server when a request
comes.

But from performance point of view, better to create connections
during start up.

How many connections? etc depending on the usage of your application
Regards
Zunil
Cordys

database security

i a the user of sql server 2005 on window server 2003. i want to know
that how can i prevent my database from other user logins because all
of them are sysadmin type.
and i am also looking for database concurrency control methods.

if any one know about this plz mail me answer on this mail id
mahendersingh_be@.yahoo.co.in
thanx in advanceOn 11 juin, 13:00, Mandy <mahendersing...@.gmail.comwrote:

Quote:

Originally Posted by

i a the user of sql server 2005 on window server 2003. i want to know
that how can i prevent my database from other user logins because all
of them are sysadmin type.
and i am also looking for database concurrency control methods.
>
if any one know about this plz mail me answer on this mail id
mahendersingh...@.yahoo.co.in
>
thanx in advance


Hi,
You can use SQL Server authentification, open MS SQL manager then
change the connection of the current server
Omar Abid|||Mandy (mahendersinghbe@.gmail.com) writes:

Quote:

Originally Posted by

i a the user of sql server 2005 on window server 2003. i want to know
that how can i prevent my database from other user logins because all
of them are sysadmin type.


In that case you would need to move the database to a different
instance where the other people can't get in. No protection from other
sysadmin on a aserver.

--
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

Friday, February 17, 2012

Database Partitioning - Partition switching

Hi,

I need replies immediately...

This is with regard to switching of partitions in a sliding window scenario.

I wrote a stored procedure which does the partition switching in a sliding window scenario. During one switching, if the stored procedure is half executed, if I re-execute the same procedure it throws errors like

'Filegroup is in a different partition switching failed'

So how to rollback all the transactions in the stored procedure that does switching of partitions? If it is not possible, then how to identify whether a file group is in its original partition before the stored procedure is part executed? How to bring it back to its original partition before executing the stored procedure again switching?

Can any one help me immediately...

Thanks

Sekharpc

Moving thread to appropriate forum.|||

hi sek,

you have to enclose your sp scripts in a begin transaction.... end transaction clause..

create sp swtichpartion

(

)

as

begin transaction

partition switch... code1

partition switch code 2.

partition switch code 3.

commit transaction

in this way all switch task must commit as a unit. a failure in one job

fails the entire operation.

for a more comprehensive solution you can also incorporate the 2005

error handling feature try.. catch block for more information

you can consult my blogs look for the topic

The SQL SERVER 2005 Try Catch Block look for sub topic

"try catch with transaction"

or BOL

regards,

joey

Tuesday, February 14, 2012

Database Output Problem for a SQL Server 2000 stored procedure

Hi,

I have a problem with "database output" window in executing a select-sp in vs 2005 standard. The db is a sql server 2000 one.

When I execute the sp within VS, the database output correctly displays the execution information:

No rows affected.
(1 row(s) returned)
@.RETURN_VALUE = 3

but I can't see the returned rows (3 rows are returned); I only see the column names and no data.

Running [dbo].[spBkm_GetList] ( @.IDUser = <DEFAULT>, [.......]).

IDBkm UIBkm IDUser
------- ------------ ---No rows affected.

If I run the same sp in Sql Server Manager Studio Express it correctly shows the data of the 3 rows returned.

The sp uses

EXECsp_executesql @.Sql, @.ParamList, .....

for executing the sql statement and the last line of sp is
RETURN@.@.ROWCOUNT

I've tried removing the "RETURN @.@.ROWCOUNT" with no success.

The problem affects only one sp, the others, which are absolutely similar, work properly .

I don't know what is the problem...

Any idea?

Thanks in advance

Ive' resolved the problem in a strange way, it seems to me a bug...

If I exclude from the select statement a field of type uniqueidentifier, alla data are correctly displayed!

I've tried on other sp and the behaviour is the same.

Hope this may help someone else with the same problem...