Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Friday, March 30, 2012

OutOfMemoryException with SQL Server Mobile

Hi,

I'm getting always an OutOfMemoryException after my program runs for a while. It's a smartphone application running on .NET 2.0 CF and using the SQL Server Mobile 2005. Sometimes it's even not a OutOfMemoryException but a SqlCeException. But it's always when the phone is having little free memory left.

I have also created a few custom controls (I even implemented the Disposable interface) to dispose all resources (Fonts, Bitmaps). I'm using all Pens and Brushes always in "using" blocks, to have them disposed immediately after having used them. The program does not have any static objects or lists of objects that are hold in memory for a long time.

I really don't understand why I get this exception. I see it always happen after doing a lot queries on the SQL Server Mobile. Is this tool using a lot memory? Can I flush somehow the memory of the SQL Server? Should I run also manually sometimes the GarbageCollector? Does this thing not run automatically?

Can anybody, perhaps of MSFT help me? I'm also willing to share the full source code with MSFT, if required.

You will probably get a faster answer on the Sql Server Mobile forum.

Moving this thread to that forum.

|||

Here are a few suggestions (from an earlier thread)

1) Try to use SqlCeResultSet than DataSet

2) Please dispose the managed objects explicitly instead of waiting for garbage collector to pick them up. Please also note that SqlCeCommand object can be reused and they need to be disposed explicitly

In addtion you can email me your project and I'll be glad to look into this issue for you.

Mark dot Ihimoyan at microsoft dot com

Wednesday, March 28, 2012

Outer joins fail since adding replication

I have an application that has been using a right outer join that worked as I
expected until I added merge replication. On the replicated database the
result is the same as an inner join. I could be doing something odd but it's
a pretty plain use and it still works on instances of the database without
replication. I thought I'd first ask if this is a known issue before creating
small standalone files for posting.
Thanks
Kohn,
I see no reason how this could possibly be an issue. Please can you post up
your files and I'll try to repro.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Friday, March 23, 2012

Out of Order Object ID's

While trying to run an application install that needs to write to
master, it fails b/ c it cant create a new object id. So I followed the
instructions in article 827448 for this error:
Server: Msg 2714, Level 16, State 6, Line 1
There is already an object named 'TableName' in the database.
No matter how many times I run the recommended script and increment "i",
I cant seem to create a new object. My object id's are very sporadic.
Only the first 98 objects are in order. The next number jumps to
1,000,000 and the last object (object#1012) ends in 2,145,442,717.
Questions:
1. What can I do to create a new object?
2. What causes the object id's to be out of order like this? I don't
recall any huge deletes of objects. Certainly not 1,000,000 of them,
unless temp tables are given object ids?
3. Having object ids out of wack like this... does it cause any kind of
performance hit?
Thanks much!
Chris
> While trying to run an application install that needs to write to master,
> it fails b/ c it cant create a new object id. So I followed the
> instructions in article 827448 for this error:
> Server: Msg 2714, Level 16, State 6, Line 1
> There is already an object named 'TableName' in the database.
> No matter how many times I run the recommended script and increment "i", I
> cant seem to create a new object.
The error seems to be that the table already exists. Why are you
incrementing "i"?

> 2. What causes the object id's to be out of order like this? I don't
> recall any huge deletes of objects.
An object_id is assigned arbitrarily by SQL Server. They are not
incremented linearly.
USE TempDB
GO
CREATE TABLE dbo.foo(id INT);
CREATE TABLE dbo.bar(id INT);
SELECT OBJECT_ID('dbo.bar'),OBJECT_ID('dbo.foo');
GO
DROP TABLE dbo.foo,dbo.bar;
GO
On my system, I get:
1870720859, 1854720802
When I run it again, I get:
59238408, 43238351

> Certainly not 1,000,000 of them, unless temp tables are given object ids?
I thought you were "writing to master"? Are you creating permanent tables
in master, or temp tables, or something else?
And yes, temp tables get Object_ids. Run this multiple times:
USE TempDB;
GO
CREATE TABLE #foo(id INT);
SELECT OBJECT_ID('#foo');
DROP TABLE #foo;

> 3. Having object ids out of wack like this... does it cause any kind of
> performance hit?
No, why would it? It's just an arbitrary lookup number. This is like
saying there would be a change in performance if your first name was Wanda
instead of Chris.
Maybe you could explain exactly what you are doing, why you are using a
counter like i and incrementing it, and what the actual failure is.
Aaron
|||Hi Aaron,
I was following the instructions from this article:
http://support.microsoft.com/kb/827448/en-us
I thought object id's were assigned arbitrar numbers. I should have done
a simple test to confirm it (duh) ... but I was taking the word of a
developer. So I second guessed myself.
Aaron Bertrand [SQL Server MVP] wrote:
>
> The error seems to be that the table already exists. Why are you
> incrementing "i"?
>
>
> An object_id is assigned arbitrarily by SQL Server. They are not
> incremented linearly.
> USE TempDB
> GO
> CREATE TABLE dbo.foo(id INT);
> CREATE TABLE dbo.bar(id INT);
> SELECT OBJECT_ID('dbo.bar'),OBJECT_ID('dbo.foo');
> GO
> DROP TABLE dbo.foo,dbo.bar;
> GO
> On my system, I get:
> 1870720859, 1854720802
> When I run it again, I get:
> 59238408, 43238351
>
>
> I thought you were "writing to master"? Are you creating permanent tables
> in master, or temp tables, or something else?
> And yes, temp tables get Object_ids. Run this multiple times:
> USE TempDB;
> GO
> CREATE TABLE #foo(id INT);
> SELECT OBJECT_ID('#foo');
> DROP TABLE #foo;
>
>
> No, why would it? It's just an arbitrary lookup number. This is like
> saying there would be a change in performance if your first name was Wanda
> instead of Chris.
> Maybe you could explain exactly what you are doing, why you are using a
> counter like i and incrementing it, and what the actual failure is.
> Aaron
>
sql

Out of Order Object ID's

While trying to run an application install that needs to write to
master, it fails b/ c it cant create a new object id. So I followed the
instructions in article 827448 for this error:
Server: Msg 2714, Level 16, State 6, Line 1
There is already an object named 'TableName' in the database.
No matter how many times I run the recommended script and increment "i",
I cant seem to create a new object. My object id's are very sporadic.
Only the first 98 objects are in order. The next number jumps to
1,000,000 and the last object (object#1012) ends in 2,145,442,717.
Questions:
1. What can I do to create a new object?
2. What causes the object id's to be out of order like this? I don't
recall any huge deletes of objects. Certainly not 1,000,000 of them,
unless temp tables are given object ids?
3. Having object ids out of wack like this... does it cause any kind of
performance hit?
Thanks much!
Chris> While trying to run an application install that needs to write to master,
> it fails b/ c it cant create a new object id. So I followed the
> instructions in article 827448 for this error:
> Server: Msg 2714, Level 16, State 6, Line 1
> There is already an object named 'TableName' in the database.
> No matter how many times I run the recommended script and increment "i", I
> cant seem to create a new object.
The error seems to be that the table already exists. Why are you
incrementing "i"?

> 2. What causes the object id's to be out of order like this? I don't
> recall any huge deletes of objects.
An object_id is assigned arbitrarily by SQL Server. They are not
incremented linearly.
USE TempDB
GO
CREATE TABLE dbo.foo(id INT);
CREATE TABLE dbo.bar(id INT);
SELECT OBJECT_ID('dbo.bar'),OBJECT_ID('dbo.foo');
GO
DROP TABLE dbo.foo,dbo.bar;
GO
On my system, I get:
1870720859, 1854720802
When I run it again, I get:
59238408, 43238351

> Certainly not 1,000,000 of them, unless temp tables are given object ids?
I thought you were "writing to master"? Are you creating permanent tables
in master, or temp tables, or something else?
And yes, temp tables get Object_ids. Run this multiple times:
USE TempDB;
GO
CREATE TABLE #foo(id INT);
SELECT OBJECT_ID('#foo');
DROP TABLE #foo;

> 3. Having object ids out of wack like this... does it cause any kind of
> performance hit?
No, why would it? It's just an arbitrary lookup number. This is like
saying there would be a change in performance if your first name was Wanda
instead of Chris.
Maybe you could explain exactly what you are doing, why you are using a
counter like i and incrementing it, and what the actual failure is.
Aaron|||Hi Aaron,
I was following the instructions from this article:
http://support.microsoft.com/kb/827448/en-us
I thought object id's were assigned arbitrar numbers. I should have done
a simple test to confirm it (duh) ... but I was taking the word of a
developer. So I second guessed myself.
Aaron Bertrand [SQL Server MVP] wrote:
>
> The error seems to be that the table already exists. Why are you
> incrementing "i"?
>
>
> An object_id is assigned arbitrarily by SQL Server. They are not
> incremented linearly.
> USE TempDB
> GO
> CREATE TABLE dbo.foo(id INT);
> CREATE TABLE dbo.bar(id INT);
> SELECT OBJECT_ID('dbo.bar'),OBJECT_ID('dbo.foo');
> GO
> DROP TABLE dbo.foo,dbo.bar;
> GO
> On my system, I get:
> 1870720859, 1854720802
> When I run it again, I get:
> 59238408, 43238351
>
>
> I thought you were "writing to master"? Are you creating permanent tables
> in master, or temp tables, or something else?
> And yes, temp tables get Object_ids. Run this multiple times:
> USE TempDB;
> GO
> CREATE TABLE #foo(id INT);
> SELECT OBJECT_ID('#foo');
> DROP TABLE #foo;
>
>
> No, why would it? It's just an arbitrary lookup number. This is like
> saying there would be a change in performance if your first name was Wanda
> instead of Chris.
> Maybe you could explain exactly what you are doing, why you are using a
> counter like i and incrementing it, and what the actual failure is.
> Aaron
>

Wednesday, March 21, 2012

Out of Order Object ID's

While trying to run an application install that needs to write to
master, it fails b/ c it cant create a new object id. So I followed the
instructions in article 827448 for this error:
Server: Msg 2714, Level 16, State 6, Line 1
There is already an object named 'TableName' in the database.
No matter how many times I run the recommended script and increment "i",
I cant seem to create a new object. My object id's are very sporadic.
Only the first 98 objects are in order. The next number jumps to
1,000,000 and the last object (object#1012) ends in 2,145,442,717.
Questions:
1. What can I do to create a new object?
2. What causes the object id's to be out of order like this? I don't
recall any huge deletes of objects. Certainly not 1,000,000 of them,
unless temp tables are given object ids?
3. Having object ids out of wack like this... does it cause any kind of
performance hit?
Thanks much!
Chris> While trying to run an application install that needs to write to master,
> it fails b/ c it cant create a new object id. So I followed the
> instructions in article 827448 for this error:
> Server: Msg 2714, Level 16, State 6, Line 1
> There is already an object named 'TableName' in the database.
> No matter how many times I run the recommended script and increment "i", I
> cant seem to create a new object.
The error seems to be that the table already exists. Why are you
incrementing "i"?
> 2. What causes the object id's to be out of order like this? I don't
> recall any huge deletes of objects.
An object_id is assigned arbitrarily by SQL Server. They are not
incremented linearly.
USE TempDB
GO
CREATE TABLE dbo.foo(id INT);
CREATE TABLE dbo.bar(id INT);
SELECT OBJECT_ID('dbo.bar'),OBJECT_ID('dbo.foo');
GO
DROP TABLE dbo.foo,dbo.bar;
GO
On my system, I get:
1870720859, 1854720802
When I run it again, I get:
59238408, 43238351
> Certainly not 1,000,000 of them, unless temp tables are given object ids?
I thought you were "writing to master"? Are you creating permanent tables
in master, or temp tables, or something else?
And yes, temp tables get Object_ids. Run this multiple times:
USE TempDB;
GO
CREATE TABLE #foo(id INT);
SELECT OBJECT_ID('#foo');
DROP TABLE #foo;
> 3. Having object ids out of wack like this... does it cause any kind of
> performance hit?
No, why would it? It's just an arbitrary lookup number. This is like
saying there would be a change in performance if your first name was Wanda
instead of Chris.
Maybe you could explain exactly what you are doing, why you are using a
counter like i and incrementing it, and what the actual failure is.
Aaron|||Hi Aaron,
I was following the instructions from this article:
http://support.microsoft.com/kb/827448/en-us
I thought object id's were assigned arbitrar numbers. I should have done
a simple test to confirm it (duh) ... but I was taking the word of a
developer. So I second guessed myself.
Aaron Bertrand [SQL Server MVP] wrote:
>>While trying to run an application install that needs to write to master,
>>it fails b/ c it cant create a new object id. So I followed the
>>instructions in article 827448 for this error:
>>Server: Msg 2714, Level 16, State 6, Line 1
>>There is already an object named 'TableName' in the database.
>>No matter how many times I run the recommended script and increment "i", I
>>cant seem to create a new object.
>
> The error seems to be that the table already exists. Why are you
> incrementing "i"?
>
>>2. What causes the object id's to be out of order like this? I don't
>>recall any huge deletes of objects.
>
> An object_id is assigned arbitrarily by SQL Server. They are not
> incremented linearly.
> USE TempDB
> GO
> CREATE TABLE dbo.foo(id INT);
> CREATE TABLE dbo.bar(id INT);
> SELECT OBJECT_ID('dbo.bar'),OBJECT_ID('dbo.foo');
> GO
> DROP TABLE dbo.foo,dbo.bar;
> GO
> On my system, I get:
> 1870720859, 1854720802
> When I run it again, I get:
> 59238408, 43238351
>
>>Certainly not 1,000,000 of them, unless temp tables are given object ids?
>
> I thought you were "writing to master"? Are you creating permanent tables
> in master, or temp tables, or something else?
> And yes, temp tables get Object_ids. Run this multiple times:
> USE TempDB;
> GO
> CREATE TABLE #foo(id INT);
> SELECT OBJECT_ID('#foo');
> DROP TABLE #foo;
>
>>3. Having object ids out of wack like this... does it cause any kind of
>>performance hit?
>
> No, why would it? It's just an arbitrary lookup number. This is like
> saying there would be a change in performance if your first name was Wanda
> instead of Chris.
> Maybe you could explain exactly what you are doing, why you are using a
> counter like i and incrementing it, and what the actual failure is.
> Aaron
>

Tuesday, March 20, 2012

Our Application dosn't work with Sql Service pack 3

Hi , My name is Tomas
I work for a Software Developing Company ,
Our applications has been written and developed by
Power Builder 5.0 , and they can work with Sql Server 2000
normally , but when I install service pack 3.0 on our sql
server after that our application can't work with sql
server correctly , for example some queries doesn't run
and there is no result for them after installing service
pack 3,,
Please Help MeHi
First thing you need to do is run profiler on the server to see what queries
are being submitted. then pick some of those queries and run them in Query
Analyzer. In that situation, you will be able to tell if your code is
running with errors.
If your application is using more than 1 database at the same time, look at
the "Cross-Database Ownership Chaining" in books online. This was a change
introduced by SP3.
--
--
Mike Epprecht, Microsoft SQL Server MVP
Epprecht Consulting (PTY) LTD
Johannesburg, South Africa
Mobile: +27-82-552-0268
IM: mike@.NOSPAMepprecht.net
Specialist SQL Server Solutions and Consulting
"Tomas" <anonymous@.discussions.microsoft.com> wrote in message
news:01a101c3d429$41ba6c70$a001280a@.phx.gbl...
> Hi , My name is Tomas
> I work for a Software Developing Company ,
> Our applications has been written and developed by
> Power Builder 5.0 , and they can work with Sql Server 2000
> normally , but when I install service pack 3.0 on our sql
> server after that our application can't work with sql
> server correctly , for example some queries doesn't run
> and there is no result for them after installing service
> pack 3,,
> Please Help Me
>|||you should really consider upgrading powerbuilder. when did 5.0 come
out, the mid 90's?
Tomas wrote:
> Hi , My name is Tomas
> I work for a Software Developing Company ,
> Our applications has been written and developed by
> Power Builder 5.0 , and they can work with Sql Server 2000
> normally , but when I install service pack 3.0 on our sql
> server after that our application can't work with sql
> server correctly , for example some queries doesn't run
> and there is no result for them after installing service
> pack 3,,
> Please Help Me|||Especially since PB5 is no longer supported much less supported for use with
SQL2000. We're using PB9 and it works great with SQL2K.
Mike Kruchten
"ch" <ch@.dontemailme.com> wrote in message
news:3FFB0C2E.A65CF347@.dontemailme.com...
> you should really consider upgrading powerbuilder. when did 5.0 come
> out, the mid 90's?
>
> Tomas wrote:
> > Hi , My name is Tomas
> > I work for a Software Developing Company ,
> > Our applications has been written and developed by
> > Power Builder 5.0 , and they can work with Sql Server 2000
> > normally , but when I install service pack 3.0 on our sql
> > server after that our application can't work with sql
> > server correctly , for example some queries doesn't run
> > and there is no result for them after installing service
> > pack 3,,
> > Please Help Me
>

OTP: Accessing RDL Reports from Visual Basic 6.0 Application

Hai! I don't know is this a silly question. Is it possible to execute and display the rdl (Sql server 2005 reporting services) report from visual basic 6.0 application.

I have a full fledged Visual basic windows application and using crystal reports. I want to create the reports using SQL server 2005 reporting services and access it from my Visual Basic 6.0 Windows application.

Thanks in advance

I'm afraid VB6 support has ended, and so VB6 questions are off topic here. Try www.vbcity.com instead.|||I'm trying to do the same and wondered whether you have found a solution.

Thanks

Other ways to replicate ?

We have an application that we need to replicate but the suppliers say that
their application does not support SQL replication. Can anyone recommend a
good third party replication tool ? Also if the application does not support
SQL replication would this mean that a 3rd party tool couldn`t be used as
well ?
Si
You could take a look at RedGate's Datacompare which won't modify the
schemas at all. As to whether it'll work, it depends on how your app is set
up as to whether it'll work - eg the tables must have PKs and the data must
be started from a consistent state.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Press them to find out what they mean by it their application does support
replication. I find it hard to believe that an application can't use
snapshot replication. If it doesn't support transactional replication it is
very poorly designed as transactional replication requires pk's.
Consider log shipping or database mirroring.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:FABCE84E-51AB-49A4-8E1D-3392FBB22E04@.microsoft.com...
> We have an application that we need to replicate but the suppliers say
> that
> their application does not support SQL replication. Can anyone recommend a
> good third party replication tool ? Also if the application does not
> support
> SQL replication would this mean that a 3rd party tool couldn`t be used as
> well ?
> Si
|||What in an application can stop SQL replication working ?
"Hilary Cotter" wrote:

> Press them to find out what they mean by it their application does support
> replication. I find it hard to believe that an application can't use
> snapshot replication. If it doesn't support transactional replication it is
> very poorly designed as transactional replication requires pk's.
> Consider log shipping or database mirroring.
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Simon" <Simon@.discussions.microsoft.com> wrote in message
> news:FABCE84E-51AB-49A4-8E1D-3392FBB22E04@.microsoft.com...
>
>
|||It's more likely to be the other way round. If you require updatable
subscribers, the schema will be altered to add a column, and if your app
uses select * from articlename queries, it might break. There could also be
issues with triggers and cascading referential integrity. Difficult to say
exactly what they think the problem might be.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||The main problem is that they just updated a fox database into SQL and then
expected the application to work with no problems. The amount of things they
try and do in the application that SQL does out of the box is ridiculous.
Plus they don`t do any processing on the SQL server, everything is done on
the local machine.
I love it when people with no techincal knowledge make decisions on software
for my company without any guidance !
"Paul Ibison" wrote:

> It's more likely to be the other way round. If you require updatable
> subscribers, the schema will be altered to add a column, and if your app
> uses select * from articlename queries, it might break. There could also be
> issues with triggers and cascading referential integrity. Difficult to say
> exactly what they think the problem might be.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>

Monday, March 12, 2012

OT: Help with a database/application

Hello all,
I am looking for more ideas on bullet proof style Data Bases and or
applications for my site. I possibly could do some barter trading with some
advertizing.
I need to following for the application and it should be ablet o cross
reference with other applications too.
User Name
Auto generated PW- then can be changed later if wnated to be
What is being posted
Where the sale is-URL or active link
What the price is
Who posted it
When it is posted
The data base should contain this info
Name, address, age, gender, email, and user name..
If you could email it would be great. I did have a guy helping me, but he
got too busy with his work and I am very niave in this area. Any help would
be greatly appreciated..Hi
Have a look at the data models on:
http://www.databaseanswers.org/data_models/index.htm
Regards
Mike
"CPS" wrote:

> Hello all,
> I am looking for more ideas on bullet proof style Data Bases and or
> applications for my site. I possibly could do some barter trading with som
e
> advertizing.
> I need to following for the application and it should be ablet o cross
> reference with other applications too.
> User Name
> Auto generated PW- then can be changed later if wnated to be
> What is being posted
> Where the sale is-URL or active link
> What the price is
> Who posted it
> When it is posted
>
> The data base should contain this info
> Name, address, age, gender, email, and user name..
> If you could email it would be great. I did have a guy helping me, but he
> got too busy with his work and I am very niave in this area. Any help woul
d
> be greatly appreciated..
>
>

OT: Help with a database/application

Hello all,
I am looking for more ideas on bullet proof style Data Bases and or
applications for my site. I possibly could do some barter trading with some
advertizing.
I need to following for the application and it should be ablet o cross
reference with other applications too.
User Name
Auto generated PW- then can be changed later if wnated to be
What is being posted
Where the sale is-URL or active link
What the price is
Who posted it
When it is posted
The data base should contain this info
Name, address, age, gender, email, and user name..
If you could email it would be great. I did have a guy helping me, but he
got too busy with his work and I am very niave in this area. Any help would
be greatly appreciated..
Hi
Have a look at the data models on:
http://www.databaseanswers.org/data_models/index.htm
Regards
Mike
"CPS" wrote:

> Hello all,
> I am looking for more ideas on bullet proof style Data Bases and or
> applications for my site. I possibly could do some barter trading with some
> advertizing.
> I need to following for the application and it should be ablet o cross
> reference with other applications too.
> User Name
> Auto generated PW- then can be changed later if wnated to be
> What is being posted
> Where the sale is-URL or active link
> What the price is
> Who posted it
> When it is posted
>
> The data base should contain this info
> Name, address, age, gender, email, and user name..
> If you could email it would be great. I did have a guy helping me, but he
> got too busy with his work and I am very niave in this area. Any help would
> be greatly appreciated..
>
>

OT: Help with a database/application

Hello all,
I am looking for more ideas on bullet proof style Data Bases and or
applications for my site. I possibly could do some barter trading with some
advertizing.
I need to following for the application and it should be ablet o cross
reference with other applications too.
User Name
Auto generated PW- then can be changed later if wnated to be
What is being posted
Where the sale is-URL or active link
What the price is
Who posted it
When it is posted
The data base should contain this info
Name, address, age, gender, email, and user name..
If you could email it would be great. I did have a guy helping me, but he
got too busy with his work and I am very niave in this area. Any help would
be greatly appreciated..Hi
Have a look at the data models on:
http://www.databaseanswers.org/data_models/index.htm
Regards
Mike
"CPS" wrote:

> Hello all,
> I am looking for more ideas on bullet proof style Data Bases and or
> applications for my site. I possibly could do some barter trading with som
e
> advertizing.
> I need to following for the application and it should be ablet o cross
> reference with other applications too.
> User Name
> Auto generated PW- then can be changed later if wnated to be
> What is being posted
> Where the sale is-URL or active link
> What the price is
> Who posted it
> When it is posted
>
> The data base should contain this info
> Name, address, age, gender, email, and user name..
> If you could email it would be great. I did have a guy helping me, but he
> got too busy with his work and I am very niave in this area. Any help woul
d
> be greatly appreciated..
>
>

OT: Help with a database/application

Hello all,
I am looking for more ideas on bullet proof style Data Bases and or
applications for my site. I possibly could do some barter trading with some
advertizing.
I need to following for the application and it should be ablet o cross
reference with other applications too.
User Name
Auto generated PW- then can be changed later if wnated to be
What is being posted
Where the sale is-URL or active link
What the price is
Who posted it
When it is posted
The data base should contain this info
Name, address, age, gender, email, and user name..
If you could email it would be great. I did have a guy helping me, but he
got too busy with his work and I am very niave in this area. Any help would
be greatly appreciated..Hi
Have a look at the data models on:
http://www.databaseanswers.org/data_models/index.htm
Regards
Mike
"CPS" wrote:
> Hello all,
> I am looking for more ideas on bullet proof style Data Bases and or
> applications for my site. I possibly could do some barter trading with some
> advertizing.
> I need to following for the application and it should be ablet o cross
> reference with other applications too.
> User Name
> Auto generated PW- then can be changed later if wnated to be
> What is being posted
> Where the sale is-URL or active link
> What the price is
> Who posted it
> When it is posted
>
> The data base should contain this info
> Name, address, age, gender, email, and user name..
> If you could email it would be great. I did have a guy helping me, but he
> got too busy with his work and I am very niave in this area. Any help would
> be greatly appreciated..
>
>

Saturday, February 25, 2012

os_oa* run exe written in vb6

I need to launch an exe application written in VB6 from stored procedure or
trigger. I know I have to use os_oa* but I cannot find any document to help
me build one. Many examples that I found have something to do with com but I
only have exe. I know this is not the way to go but I was told to do it. Can
any one help me by pointing me in the right directions? I know nothing about
this so I am learning from scratch for os_oa*.
The exe was developed to run silent in the background with no user
interface.Search for xp_cmdshell in BOL, it may be useful.
Francesco Anti
"UGH" <nospam@.noSPam.com> wrote in message
news:eRxL9tFaFHA.1368@.tk2msftngp13.phx.gbl...
>I need to launch an exe application written in VB6 from stored procedure or
>trigger. I know I have to use os_oa* but I cannot find any document to help
>me build one. Many examples that I found have something to do with com but
>I only have exe. I know this is not the way to go but I was told to do it.
>Can any one help me by pointing me in the right directions? I know nothing
>about this so I am learning from scratch for os_oa*.
>
> The exe was developed to run silent in the background with no user
> interface.
>|||Do you mean sp_oa* ' If so, here is everything you need:
1. Compile your VB6 class into a DLL. You better have good error handling in
it otherwise you risk crashing your SQL Server.
2. Place that DLL into the WIN32 directory on your SQL Server, and REGISTER
it on your SQL Server by using RegSvr32.exe
3. Call methods of your VB6 class/dll from any stored procedure, using
something like the following (some of the names have been changed to protect
the innocent):
BEGIN
blah blah blah
DECLARE @.Object int -- holds a reference to your object instantiated
from the vb6 class.
SET @.MethodToCall = 'CalculatePayment(' + @.RatePercent + ', ' +
@.RateIncrease + ', ' + @.Months + ', ' + @.Fees + ')'
--Instantiate an instance of our DataConversion class and put it's
reference in @.object
EXEC sp_OACreate 'Your_VB_Class.DataConversion', @.object OUT
--Run the CalculatePayment method of our DataConversion class - and
place it's output into @.Return
EXEC sp_OAMethod @.object, @.MethodToCall, @.return OUT
-- Destroy the instance of our DataConversion class now that we're
done with it.
EXEC sp_OADestroy @.object
blah blah blah
END
4. Any time you need to upgrade your VB6 DLL, be sure to Unregister the old
one (using RegSvr32.exe... -U), then replace the old DLL with the new one,
and then register the new one like in step 2 above. No need to restart your
SQL Server.
That's it - really quite straight-forward, actually.
-HTH
"UGH" <nospam@.noSPam.com> wrote in message
news:eRxL9tFaFHA.1368@.tk2msftngp13.phx.gbl...
>I need to launch an exe application written in VB6 from stored procedure or
>trigger. I know I have to use os_oa* but I cannot find any document to help
>me build one. Many examples that I found have something to do with com but
>I only have exe. I know this is not the way to go but I was told to do it.
>Can any one help me by pointing me in the right directions? I know nothing
>about this so I am learning from scratch for os_oa*.
>
> The exe was developed to run silent in the background with no user
> interface.
>|||Hi,
Use the following :
EXEC xp_cmdshell 'your vb program.exe'
you want to grant the right to execute xp_cmdshell to the SQL login
LimitedUser.
You'll need an NT account to execute the program. Here's the script:
use master
go
xp_sqlagent_proxy_account N'SET'
, N'<mydomain>'
, N'<ntuser>'
, N'<ntuser's password>'
go
-- retrieve the proxy account to check that it's correct.
xp_sqlagent_proxy_account N'GET'
go
-- grant database access in master
sp_grantdbaccess 'LimitedUser'
go
grant exec on xp_cmdshell to LimitedUser
go
Thanks,
Tarek ghazali
"UGH" <nospam@.noSPam.com> wrote in message
news:eRxL9tFaFHA.1368@.tk2msftngp13.phx.gbl...
>I need to launch an exe application written in VB6 from stored procedure or
>trigger. I know I have to use os_oa* but I cannot find any document to help
>me build one. Many examples that I found have something to do with com but
>I only have exe. I know this is not the way to go but I was told to do it.
>Can any one help me by pointing me in the right directions? I know nothing
>about this so I am learning from scratch for os_oa*.
>
> The exe was developed to run silent in the background with no user
> interface.
>

Monday, February 20, 2012

Orphaned transaction in sql 2005

Once in a while we end up with an orphaned transaction in sql 2005 around
the same application and it holds locks and the only way to get rid of it is
kill it.
So what causes it ? According to the app owner, they close the connection
and I have to say they do because the app is called so often and 99% of the
time it works fine and then once in 2 or 3 months, it leaves the orphaned
transaction.
The driver is a Java driver.. But I've seen this behavior on non Java
drivers as well.
So does SQL have any way of automatically killing orphaned transactions
Thank youRomeo,
The problem is that the SQL Server does not know it is an orphaned
transaction. If it knew, it would drop the transaction.
My anecdotal experience has been, if the machine that initiated the orphaned
transaction is logged off the domain, then logged back in the orphaned
transaction will ofter terminate. Apparently (real non-technical here) the
login back into the domain lets the SQL Server say to itself, "Hey, this
transaction must be orphaned because the machine I am doing it for just
logged in." But, I don't think I have ever seen this documented. (And it
is still a pain in the neck to track down the user and get them to log out,
then log back in.)
For orphaned DTC transactions, the SPID is -2, which you can find and kill.
This is documented in sp_who.
http://msdn2.microsoft.com/en-us/library/ms174313.aspx
RLF
"Romeo" <romeo@.juliet.com> wrote in message
news:e2mfGWVZIHA.208@.TK2MSFTNGP02.phx.gbl...
> Once in a while we end up with an orphaned transaction in sql 2005 around
> the same application and it holds locks and the only way to get rid of it
> is kill it.
> So what causes it ? According to the app owner, they close the connection
> and I have to say they do because the app is called so often and 99% of
> the time it works fine and then once in 2 or 3 months, it leaves the
> orphaned transaction.
> The driver is a Java driver.. But I've seen this behavior on non Java
> drivers as well.
> So does SQL have any way of automatically killing orphaned transactions
> Thank you|||> So does SQL have any way of automatically killing orphaned transactions
SQL Server will rollback an open transaction when the client disconnects so
I suspect that network connection is still open. Get the value of
client_tcp_port from sys,dm_exec_connections and check against a netstat
list on the client machine. If you see that the port is in use according to
netstat, then the connection is still open as far as the network layer and
SQL Server are concerned.
I don't know anything about your application other than you are using a java
driver with a SQL 2005 back end. Most drivers support some form of
connection pooling which means that a connection isn't actually closed when
the application closes the connection; the connection is simply returned to
the pool and is available for reuse. If a transaction is open when a pooled
connection is closed, it could remain open until the connection is either
reused or removed from the pool. The exact behavior depends on a number of
factors, such as the specific driver and how the transaction was initiated
(server vs. client API).
> So what causes it ? According to the app owner, they close the connection
> and I have to say they do because the app is called so often and 99% of
> the time it works fine and then once in 2 or 3 months, it leaves the
> orphaned transaction.
It may be than all is fine as long as the expected code path is executed.
Make sure that the application cleans up (e;g; WHILE @.@.TRANCOUNT > 0
ROLLBACK and close connection) following exceptions.
Hope this helps.
Dan Guzman
SQL Server MVP
"Romeo" <romeo@.juliet.com> wrote in message
news:e2mfGWVZIHA.208@.TK2MSFTNGP02.phx.gbl...
> Once in a while we end up with an orphaned transaction in sql 2005 around
> the same application and it holds locks and the only way to get rid of it
> is kill it.
> So what causes it ? According to the app owner, they close the connection
> and I have to say they do because the app is called so often and 99% of
> the time it works fine and then once in 2 or 3 months, it leaves the
> orphaned transaction.
> The driver is a Java driver.. But I've seen this behavior on non Java
> drivers as well.
> So does SQL have any way of automatically killing orphaned transactions
> Thank you