19-07-2005, 18:38
|
#1
|
|
Prevoiusly Terabyte !!
Join Date: Jan 2004
Location: Scunthorpe
Age: 41
Services: 10mbit SB4100, Sky and BT Line.
Posts: 407
|
MS SQL Logging Util
I have a problem with a program which uses MSSQL as the database. Now in order to work out why it is crashing, I need to somehow see what it is trying to do in SQL and any errors - for example trying to write to a database with the wrong usename or fields misisng etc..
Anybody know of a program or way to achive this?
|
|
|
19-07-2005, 18:44
|
#2
|
|
Guest
Location: Sale, Cheshire
Services: 10MB Broadband, DTV, Telephone
Posts: n/a
|
Re: MS SQL Logging Util
Quote:
|
Originally Posted by Mauldor
I have a problem with a program which uses MSSQL as the database. Now in order to work out why it is crashing, I need to somehow see what it is trying to do in SQL and any errors - for example trying to write to a database with the wrong usename or fields misisng etc..
Anybody know of a program or way to achive this?
|
MSSQL Trace? (Haven't got it on this PC, but I think it's called SQL Performance Analyzer, if you've got the SQL management tools installed).
...or you can get to it from Enterprise Manager/Tools
|
|
|
|
19-07-2005, 18:44
|
#3
|
|
NINJA
Join Date: May 2005
Location: Nr Manchester
Age: 31
Posts: 892
|
Re: MS SQL Logging Util
you can use sql enterprise manager to view the last action of the user that processed the transaction.
(as long as (s) he does'nt move on and process anything else..
I used it to track down an error in a field where a user was using an ' in an address and SQL was whinging
|
|
|
19-07-2005, 18:45
|
#4
|
|
cf.mega poster
Join Date: Jun 2003
Posts: 4,845
|
Re: MS SQL Logging Util
Quote:
|
Originally Posted by Mauldor
I have a problem with a program which uses MSSQL as the database. Now in order to work out why it is crashing, I need to somehow see what it is trying to do in SQL and any errors - for example trying to write to a database with the wrong usename or fields misisng etc..
Anybody know of a program or way to achive this?
|
Have you tried the MSSQL tool Query Analyser or even Enterprise Manager.
__________________
Read this for a I-Web domain hosted update.
|
|
|
19-07-2005, 18:56
|
#5
|
|
Prevoiusly Terabyte !!
Join Date: Jan 2004
Location: Scunthorpe
Age: 41
Services: 10mbit SB4100, Sky and BT Line.
Posts: 407
|
Re: MS SQL Logging Util
Quote:
|
Originally Posted by Caspar
Have you tried the MSSQL tool Query Analyser or even Enterprise Manager. 
|
Indeed I have, I can see what Transactions its doing, tried the very same thing in Eneterprise Manager and they work fine, though the program is not updating this database. Maybe I never put enough Fields on Profiler (only think I have tried so far) to show Errors - I am trying to see what its doing and any errors and why sort of thing.. Oh well Ill keep looking
|
|
|
19-07-2005, 19:03
|
#6
|
|
Guest
Location: Sale, Cheshire
Services: 10MB Broadband, DTV, Telephone
Posts: n/a
|
Re: MS SQL Logging Util
Profiler - that's what I was thinking of. Set up a trace, and you should see all the SQL statements submitted. You can then cut and paste iinto Query Analyser to check for errors.
|
|
|
|
20-07-2005, 06:10
|
#7
|
|
Prevoiusly Terabyte !!
Join Date: Jan 2004
Location: Scunthorpe
Age: 41
Services: 10mbit SB4100, Sky and BT Line.
Posts: 407
|
Re: MS SQL Logging Util
Right he ho - finally got somewhere (though no closer to the answer like)..
I selected all the option on Profiler and ran this just before I knew where there would be a error and stopped it after the error, this gave me a better chance to see what the problem was.
Now to explain (as this might help) what it is I am doing, the program (a game server written in Chinese) Is running on a XP Box with everything set to Chinese PRC (so i can see if nothing else the txt files in chinese to aid me translating it). The trace was rouhgly like thus:
INSERT INTO Storage (First, Late, VipEndDate) VALUES ('Peter','Pan','20/07/2005 05:27:14')
Now if I run this on Enterprise Manager on the said database, I get the Error :
The Convertion of char data type to a DateTime DataType resulted in a out-of-range datetime value
VipEndDate by the way is defined as DateTime. I will go Google this to death and see what comes from it - cos I can type the date in no problems, just on a Update that it failes
|
|
|
20-07-2005, 06:46
|
#8
|
|
Guest
Location: Sale, Cheshire
Services: 10MB Broadband, DTV, Telephone
Posts: n/a
|
Re: MS SQL Logging Util
Dates in computers are the bane of my life! If you can fix the code so that the date is formatted as 20 Jul 2005, before submitting the SQL, you'll be alright! (That's the easiest - I think there are ways of getting it to accept the data in dd/mm/yyyy format, but these are more complex and involve editing the registry, etc - even more complicated if the box is set to Chinese - what is the Chinese date format in Windows?).
|
|
|
|
20-07-2005, 07:09
|
#9
|
|
cf.mega poster
Join Date: Jun 2003
Age: 29
Posts: 6,273
|
Re: MS SQL Logging Util
Quote:
|
Originally Posted by Mauldor
Right he ho - finally got somewhere (though no closer to the answer like)..
I selected all the option on Profiler and ran this just before I knew where there would be a error and stopped it after the error, this gave me a better chance to see what the problem was.
Now to explain (as this might help) what it is I am doing, the program (a game server written in Chinese) Is running on a XP Box with everything set to Chinese PRC (so i can see if nothing else the txt files in chinese to aid me translating it). The trace was rouhgly like thus:
INSERT INTO Storage (First, Late, VipEndDate) VALUES ('Peter','Pan','20/07/2005 05:27:14')
Now if I run this on Enterprise Manager on the said database, I get the Error :
The Convertion of char data type to a DateTime DataType resulted in a out-of-range datetime value
VipEndDate by the way is defined as DateTime. I will go Google this to death and see what comes from it - cos I can type the date in no problems, just on a Update that it failes 
|
Use:
INSERT INTO Storage (First, Late, VipEndDate) VALUES ('Peter','Pan','07/20/2005 05:27:14')
|
|
|
20-07-2005, 18:37
|
#10
|
|
Prevoiusly Terabyte !!
Join Date: Jan 2004
Location: Scunthorpe
Age: 41
Services: 10mbit SB4100, Sky and BT Line.
Posts: 407
|
Re: MS SQL Logging Util
I changed my Regional Lang to USA and it worked, how i fathered this out was playing about with that Update Statement till I worked out what format it was hoping to get. Google showed LOTS of these Problems (for Coders) and MS-SQL - so its not Uniquie Problem. Many Thanks to everybody anyhow for the Help and it was Indeed Profiler - I must play with this Utility so more to see what the good triggers are to set !!
|
|
|
20-07-2005, 18:59
|
#11
|
|
cf.mega poster
Join Date: Jun 2003
Posts: 4,845
|
Re: MS SQL Logging Util
Glad you sorted it  ..and I agree with JohnHorb Dates are a real nightmare when developing
__________________
Read this for a I-Web domain hosted update.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 22:22.
|