显示标签为“app”的博文。显示所有博文
显示标签为“app”的博文。显示所有博文

2012年3月27日星期二

Float data

Hello.

We have a third party app that's database holds allsorts of info as floats. I have to update records in this database from my source database that stores it's data as decimal(8,2).

so when I update a row with 25.00 it goes into the 3rd party app database as 25 because it's a float. Is it possible to put the data in so it reads 25.00 without changing the datatype from a float?

Thanks.

You should not worry about the format of numbers as they come from a query. Use your application to apply any formatting that is needed.|||The "float" data type does not store non-significant digits. The trailing 0 is non-significant. So the answer is no.

You would have to reformat it to decimal(8,2) when you get it back out of the float.|||

Thanks for the replies, I thought as much after reading BOL but you see my source database is an Ingres database (remember them!) and it's float data type does store the non-significant digits so I was curious to see if SQL could do the same.

Thanks again

2012年3月26日星期一

flat file to raletionship database

I have an app which needs to download from mainframe flat file to my
relationship database (Parent - Child) tables.
I would like to know are there any better solution.
My flat file data structure like following:
Filed Name
Account Number : Char(10)
Account Name: Char(35)
Address1 Char(30)
Address2 Char(30)
City Char(25)
....etc
New table:
Parent table:
Account Number: Char(10)
Account Name Char(35)
Child table:
Account Number char(10)
Update ID Integer
Address1 char(30)
Address2 char(30)
City char(25)
The app downloads data every night and convert to my parent child table.
I can use append query to copy all the data to my table.
The problem is in child table. I need add a Update ID and validate
duplicates.
I have to append the data and make sure the record does not duplicates.
Are there any better solutions for this application?
Any information is great appreciated.
Thanks in advance,
Souris,Since you're the only who knows what the business rule for data
transformation, we would not be able to suggest much. The only advice I can
give is to upload the data into a work table and then call a stored
procedure that has your business rule implemented to massage the data.
-oj
"souris" <soukkris@.viddotron.com> wrote in message
news:u79vhWaCFHA.4008@.tk2msftngp13.phx.gbl...
>I have an app which needs to download from mainframe flat file to my
>relationship database (Parent - Child) tables.
> I would like to know are there any better solution.
> My flat file data structure like following:
> Filed Name
> Account Number : Char(10)
> Account Name: Char(35)
> Address1 Char(30)
> Address2 Char(30)
> City Char(25)
> ....etc
> New table:
> Parent table:
> Account Number: Char(10)
> Account Name Char(35)
> Child table:
> Account Number char(10)
> Update ID Integer
> Address1 char(30)
> Address2 char(30)
> City char(25)
>
> The app downloads data every night and convert to my parent child table.
> I can use append query to copy all the data to my table.
> The problem is in child table. I need add a Update ID and validate
> duplicates.
> I have to append the data and make sure the record does not duplicates.
> Are there any better solutions for this application?
> Any information is great appreciated.
> Thanks in advance,
> Souris,
>

2012年3月19日星期一

FK constraint when FK row is there! Always takes 10 mins to fail!

I am developing a SQLServer/JSP/Java (Jrun4) web app that intermittently has a FK constraint that always hoses up the transaction for exactly 10 minutes.

The user can save a record from a form that inserts a few rows in the db. The second insert is dependent on the FK of the first insert. All the inserts are done in an entity bean that calls stored procs.

We've had this intermittant error where the inserts take exactly 10 minutes (every time!), then it fails with a FK constraint, yet out logging shows that it's using an existing foreign key. (the stored procs returns the FK)

We have a dev server and a test server, and this has yet to occur on the dev server! I feel like there must be something set up incorrectly.

Any ideas?

thanks in advance!

-DanFlagged -

Are any of the tables really large? Enforcing a FK constraint without indexes on large tables could cause it to take a really long time. 10 minutes seems extreme, but...

And do you know what the differences are between your dev and test server? Do they have the same constraints? Do they have the same data?|||And the same indexes and statistics?|||There isn't much data: under 100 rows, 10 column.

The problem only happens intermittently. In fact it hasn't happed in the last several hundered inserts (we've been testing it)

Originally posted by strader
Flagged -

Are any of the tables really large? Enforcing a FK constraint without indexes on large tables could cause it to take a really long time. 10 minutes seems extreme, but...

And do you know what the differences are between your dev and test server? Do they have the same constraints? Do they have the same data?|||Both servers are set up the same. The more I think about it- based on the infrequency of the problem it may just be a coincidence that it only happed on the one server.

I'm investigating a possible answer to the problem- I noticed an unhandled exception in the bean and I think it's possible the 1st insert worked, then some unhandled exception occured and rolled back the transaction, then the bean continuted to attempt to insert the child row- just a theory since this is so infrequent.

Originally posted by Paul Young
And the same indexes and statistics?|||Here's another possibility - if you're running simultaneous transactions from different threads or processes against that table, and if your java code or your interface (jdbc?) is hanging, causing that transaction to sit there indefinitely, it could be causing blocking or deadlocks on that small table. If it puts an exclusive lock on the table, and you're holding that transaction open, then all the other waiting processes will fail or timeout.

It might be happening on only one server vs. the other because you're stressing one more than the other.

If it happens again, try using SET LOCK_TIMEOUT to change it to a shorter time for that connection. The more I think about it, the more likely it seems this is what's happening, since it's timing out after exactly ten minutes each time.|||I wanted to try one more thing before I tried your suggestion- and it looks like I fixed the problem, but I'm not 100% sure why the transaction was failing. Here's what the code was doing:

When the user saves form data, the entity bean inserts rows into the database, and in the same transaction (I think) proceeds to update those rows. My guess is that once in a while sqlserver locks those rows so that the records cannot be re-read. My fix was to prevent the extraneous update from occuring. It was happening because I didn't know enough about Java beans when I wrote the bean code. (I only used the store method in the bean for UPDATES and I handled inserts manually, but the store is called automatically for all bean calls so I ended up inserting, then updating).

Our beans are container managed, so that their transactions begin when the bean is called and end when the bean returns. I thought that one could manipulate an uncommited row inserted within a transaction but I guess that's not ALWAYS the case because 1 out of 100 times it times out and fails.

I'd say the problem's solved since it's been a week since my fix was in and no more problems!

thanks for the help.

2012年3月9日星期五

Fix Bad Data Error After Restore

Our test server had a hardware failuare and I restored the Report Server db's and app - no problem - so it seemed. I am getting a Bad Data Error when trying to run a report. From a previous post I see the issue relates to a different encryption key being used. The autoher noted to fix by reloading catalog.sql. If I do that, won;t i lose the previous deployed reports settings, descriptions etc. Is there a way to keep that info without having to manually redeploy if a hardware failure occurs'Yes, but you must backup (before the failure) and restore the key
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:46813D69-6259-4A82-BA7F-881C52616518@.microsoft.com...
> Our test server had a hardware failuare and I restored the Report Server
db's and app - no problem - so it seemed. I am getting a Bad Data Error
when trying to run a report. From a previous post I see the issue relates
to a different encryption key being used. The autoher noted to fix by
reloading catalog.sql. If I do that, won;t i lose the previous deployed
reports settings, descriptions etc. Is there a way to keep that info
without having to manually redeploy if a hardware failure occurs'|||Ah - I did back up and was able to restore. What is the mysterious key?
The only painful part of the server restore was redeploying and reconfiguring RSS (reports in the right folders, group permissions, etc). After restoring ReportServer db to the server and getting the bad data error, I then restored the ReportServer db to my local PC and copied and pasted necessary report descriptions and other info from the previous install back into the new install using the web interface. It was not terrible but it would have been much nicer to just have restored the ReportServer db versus the redeploy/reconfigure. Is redeploy/reconfigure the only way to recover from hardware failure? Am I missing something with regards to how to do recover better in the event hardware fails again?
All my jobs, db's, etc were operation from restored backups.
"Jason Carlson [MSFT]" wrote:
> Yes, but you must backup (before the failure) and restore the key
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Jen" <Jen@.discussions.microsoft.com> wrote in message
> news:46813D69-6259-4A82-BA7F-881C52616518@.microsoft.com...
> > Our test server had a hardware failuare and I restored the Report Server
> db's and app - no problem - so it seemed. I am getting a Bad Data Error
> when trying to run a report. From a previous post I see the issue relates
> to a different encryption key being used. The autoher noted to fix by
> reloading catalog.sql. If I do that, won;t i lose the previous deployed
> reports settings, descriptions etc. Is there a way to keep that info
> without having to manually redeploy if a hardware failure occurs'
>
>|||Look for the topic "key management" in Books Online. You use the rskeymgmt
utility to backup and restore the encryption key.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:8463A8BA-A3A9-4AD6-8864-60A537234A19@.microsoft.com...
> Ah - I did back up and was able to restore. What is the mysterious key?
> The only painful part of the server restore was redeploying and
reconfiguring RSS (reports in the right folders, group permissions, etc).
After restoring ReportServer db to the server and getting the bad data
error, I then restored the ReportServer db to my local PC and copied and
pasted necessary report descriptions and other info from the previous
install back into the new install using the web interface. It was not
terrible but it would have been much nicer to just have restored the
ReportServer db versus the redeploy/reconfigure. Is redeploy/reconfigure
the only way to recover from hardware failure? Am I missing something
with regards to how to do recover better in the event hardware fails again?
>
> All my jobs, db's, etc were operation from restored backups.
> "Jason Carlson [MSFT]" wrote:
> > Yes, but you must backup (before the failure) and restore the key
> >
> > --
> >
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > "Jen" <Jen@.discussions.microsoft.com> wrote in message
> > news:46813D69-6259-4A82-BA7F-881C52616518@.microsoft.com...
> > > Our test server had a hardware failuare and I restored the Report
Server
> > db's and app - no problem - so it seemed. I am getting a Bad Data
Error
> > when trying to run a report. From a previous post I see the issue
relates
> > to a different encryption key being used. The autoher noted to fix by
> > reloading catalog.sql. If I do that, won;t i lose the previous deployed
> > reports settings, descriptions etc. Is there a way to keep that info
> > without having to manually redeploy if a hardware failure occurs'
> >
> >
> >

2012年2月24日星期五

Firing a java application from stored procedure

Hey all,
I've got a question and after doing some research I've found only a vague reference but no clear answer.

I have a java app that will be passing parameters to my stored procedure. I'll grab the requested info from the tables but instead of sending it back to the java app that sent the request, I need to send it to a "different" java app (the second java app will not be running at the time).

Can someone point me to a good source for executing java applications from a stored procedure?

Thanks in advance ...
tamSee this http://www.onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html link is any help.

Another link http://www.sswug.org/searchresults.asp%3Fkeywordstofind%3Djava,%2520sto red%2520procedures for information.

firing a dts package's execution

Hi all,
I am using Sql Server 2000. I need to create a very simple app which when
clicked would fire the execution of a dts package on the sql server. The app
itself would sit on the client machine. Is this possible? If so, how?
Thanks in advance.someone wrote:
> Hi all,
> I am using Sql Server 2000. I need to create a very simple app which wh
en
> clicked would fire the execution of a dts package on the sql server. The a
pp
> itself would sit on the client machine. Is this possible? If so, how?
I tried this a month back. There are a number of solutions but I found
that there were alot of security/permissions issues that prevented me
from triggering a DTS package from an application. The most promising
solution I thought was the triggering of a job from within a stored
procedure using sp_start_job. I finally got the permissions worked out
to execute the job but then the job wouldn't execute the DTS.
Ultimately I gave up and went to a scheduled job solution that ran every
10 minutes. I'm sure it's possible to trigger a DTS but my
organization's security policies (which are there for a reason) made
that difficult to accomplish.
Anyway, google for sp_start_job, you should get alot of information that
will help you out.
gorf|||someone wrote:
> Hi all,
> I am using Sql Server 2000. I need to create a very simple app which wh
en
> clicked would fire the execution of a dts package on the sql server. The a
pp
> itself would sit on the client machine. Is this possible? If so, how?
> Thanks in advance.
>
Some combination of xp_cmdshell and DTSRUN would probably do it. Both
are documented in BOL.|||someone wrote:
> Hi all,
> I am using Sql Server 2000. I need to create a very simple app which wh
en
> clicked would fire the execution of a dts package on the sql server. The a
pp
> itself would sit on the client machine. Is this possible? If so, how?
> Thanks in advance.
I've just added something to my VB.Net app something that should also
work from VB 6, and anything that can use COM. Add a reference to the
Microsoft DTSPackage Object Library. Then it's a couple of lines like:
Dim pkg As New DTS.Package2
pkg.LoadFromSQLServer("SERVERNAME", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, "",
"", "", "PACKAGENAME", "")
AddHandler pkg.OnError, AddressOf RecordExtractError
pkg.Execute()
If you need more/something else, it might help if you tell us what the
app is being developed in (incidentally I think the above can also be
written as a script file)

2012年2月19日星期日

Firewall between IIS and SQL Server

Hi:
(Sorry for double post, I already post it in sqlserver.setup group but
i did't get any reply.)
I plan to deploying an ASP.Net web app into the following scenario:
Internet --> Firewall1 --> WebServer (IIS+SQL Server 2000) -->
firewall2 --> SQL Server 2000
The WebServer and the SQL Server behind the firewall2 is sit on
different LAN (different sub net),
and a two way replication will be create to sync these two SQL server
through firewall2.
Is it possible ? Is the firewall2 redundant ?
Separate the Web server and SQL server to different sub net and add
firewall2 between Web Server and SQL Server, does this configuration
provide better security to secure the data use by the LAN user ?
Thanks
JCVoon
having your servers behind the firewall does provide greater security.
however, you might want to read up on configuration to ensure connectivity
between hubs.
http://support.microsoft.com/kb/287932
-oj
"jcvoon" <jcvoon@.maximas.com.my> wrote in message
news:1143602187.916531.187150@.i39g2000cwa.googlegr oups.com...
> Hi:
> (Sorry for double post, I already post it in sqlserver.setup group but
> i did't get any reply.)
> I plan to deploying an ASP.Net web app into the following scenario:
>
> Internet --> Firewall1 --> WebServer (IIS+SQL Server 2000) -->
> firewall2 --> SQL Server 2000
>
> The WebServer and the SQL Server behind the firewall2 is sit on
> different LAN (different sub net),
> and a two way replication will be create to sync these two SQL server
> through firewall2.
>
> Is it possible ? Is the firewall2 redundant ?
> Separate the Web server and SQL server to different sub net and add
> firewall2 between Web Server and SQL Server, does this configuration
> provide better security to secure the data use by the LAN user ?
>
> Thanks
> JCVoon
>
|||oj:
Thanks for the info.
Regards
JCVoon

Firewall between IIS and SQL Server

Hi:
(Sorry for double post, I already post it in sqlserver.setup group but
i did't get any reply.)
I plan to deploying an ASP.Net web app into the following scenario:
Internet --> Firewall1 --> WebServer (IIS+SQL Server 2000) -->
firewall2 --> SQL Server 2000
The WebServer and the SQL Server behind the firewall2 is sit on
different LAN (different sub net),
and a two way replication will be create to sync these two SQL server
through firewall2.
Is it possible ? Is the firewall2 redundant ?
Separate the Web server and SQL server to different sub net and add
firewall2 between Web Server and SQL Server, does this configuration
provide better security to secure the data use by the LAN user ?
Thanks
JCVoonhaving your servers behind the firewall does provide greater security.
however, you might want to read up on configuration to ensure connectivity
between hubs.
http://support.microsoft.com/kb/287932
-oj
"jcvoon" <jcvoon@.maximas.com.my> wrote in message
news:1143602187.916531.187150@.i39g2000cwa.googlegroups.com...
> Hi:
> (Sorry for double post, I already post it in sqlserver.setup group but
> i did't get any reply.)
> I plan to deploying an ASP.Net web app into the following scenario:
>
> Internet --> Firewall1 --> WebServer (IIS+SQL Server 2000) -->
> firewall2 --> SQL Server 2000
>
> The WebServer and the SQL Server behind the firewall2 is sit on
> different LAN (different sub net),
> and a two way replication will be create to sync these two SQL server
> through firewall2.
>
> Is it possible ? Is the firewall2 redundant ?
> Separate the Web server and SQL server to different sub net and add
> firewall2 between Web Server and SQL Server, does this configuration
> provide better security to secure the data use by the LAN user ?
>
> Thanks
> JCVoon
>|||oj:
Thanks for the info.
Regards
JCVoon

Firewall between IIS and SQL Server

Hi:
(Sorry for double post, I already post it in sqlserver.setup group but
i did't get any reply.)
I plan to deploying an ASP.Net web app into the following scenario:
Internet --> Firewall1 --> WebServer (IIS+SQL Server 2000) -->
firewall2 --> SQL Server 2000
The WebServer and the SQL Server behind the firewall2 is sit on
different LAN (different sub net),
and a two way replication will be create to sync these two SQL server
through firewall2.
Is it possible ? Is the firewall2 redundant ?
Separate the Web server and SQL server to different sub net and add
firewall2 between Web Server and SQL Server, does this configuration
provide better security to secure the data use by the LAN user ?
Thanks
JCVoonhaving your servers behind the firewall does provide greater security.
however, you might want to read up on configuration to ensure connectivity
between hubs.
http://support.microsoft.com/kb/287932
-oj
"jcvoon" <jcvoon@.maximas.com.my> wrote in message
news:1143602187.916531.187150@.i39g2000cwa.googlegroups.com...
> Hi:
> (Sorry for double post, I already post it in sqlserver.setup group but
> i did't get any reply.)
> I plan to deploying an ASP.Net web app into the following scenario:
>
> Internet --> Firewall1 --> WebServer (IIS+SQL Server 2000) -->
> firewall2 --> SQL Server 2000
>
> The WebServer and the SQL Server behind the firewall2 is sit on
> different LAN (different sub net),
> and a two way replication will be create to sync these two SQL server
> through firewall2.
>
> Is it possible ? Is the firewall2 redundant ?
> Separate the Web server and SQL server to different sub net and add
> firewall2 between Web Server and SQL Server, does this configuration
> provide better security to secure the data use by the LAN user ?
>
> Thanks
> JCVoon
>|||oj:
Thanks for the info.
Regards
JCVoon

Firefox Issues in 2005...

Can someone please verify that the following items are not supported in Firefox. Our app issues an http request to the report server (url access). The following differences are seen between IE and FF:

1) The message "Report is being generated" does not disply in FF during report generation.

2) The printer icon does not appear in the toolbar.

3) Is there any plan to support search functionality within the report in the future?

Thanks.

I'm not sure about #1 or #3, but for #2, client side print is only supported in IE. This is because the client side printing is done via an ActiveX control.

|||Thanks Daniel. I'm recommending to my clients that the IE Tab add-on be installed in Firefox; it solves the problems with the search bar and also displays the "Report is being generated" message. I understand why the search bar functionality is not available in vanilla FF but I'm not sure why the Report generation message with the twirly doesn't appear.