![]() |
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? |
Re: MS SQL Logging Util
Quote:
...or you can get to it from Enterprise Manager/Tools |
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 |
Re: MS SQL Logging Util
Quote:
|
Re: MS SQL Logging Util
Quote:
|
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.
|
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 :( |
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?).
|
Re: MS SQL Logging Util
Quote:
INSERT INTO Storage (First, Late, VipEndDate) VALUES ('Peter','Pan','07/20/2005 05:27:14') |
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 !!
|
Re: MS SQL Logging Util
Glad you sorted it :tu: ..and I agree with JohnHorb Dates are a real nightmare when developing :(
|
| All times are GMT. The time now is 05:11. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum