Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Monday, March 26, 2012

Getting Started with SQL

I'm learning SQL in a class, but I'd like to be able to get the syntax down through practice. Unfortunately, I have no idea how to get started when it comes to the server part. I have experience with Java, C++, and HTML. I'm good at programming, but the whole networking thing is throwing me.

So, what do I need to do to run/test SQL commands? Ideally, it would be on my machine, using some virtual server. Is that even possible? Please let me know, thanks for your input.

Quote:

Originally Posted by LoneHunter01

I'm learning SQL in a class, but I'd like to be able to get the syntax down through practice. Unfortunately, I have no idea how to get started when it comes to the server part. I have experience with Java, C++, and HTML. I'm good at programming, but the whole networking thing is throwing me.

So, what do I need to do to run/test SQL commands? Ideally, it would be on my machine, using some virtual server. Is that even possible? Please let me know, thanks for your input.


Any DB backend that you use will setup a service on your machine. And that acts like a server. So you wont have to setup anything apart from installling your DB backend.

Fortunately, if you are setting up the DB Server on your local machine, you wont have any networking issues (especially security and permission which can be bad many time)

once you have the server setup, go to you ODBC sources and test if you can connect to the server you installed.

Once thats done too, build up a connection string with the help of your DB driver. For more help on connection Strings check this site
cheers,
Happy coding

Wednesday, March 7, 2012

getting more information while using audit trace files .trc files

Hello All,
I am trying to create a trace for user error messages using audit user error messages event class.I could create .trc file. But , unfortunately I am unable to get sql query which caused the error . I cannot use profiler to create and see the trace files as it is against our requirement.

This is how I created the trace file

1) DECLARE @.TraceIdOut int
Exec sp_trace_create @.traceid= @.TraceIdOut OUTPUT
,@.options = 2 ,@.tracefile =N'c:\Parseerrors'
PRINT @.TraceIdOut

2) Set the trace event to monitor Parse error messages
Exec sp_trace_setevent @.traceid = 2,@.eventid = 162,@.columnid =1, @.on = @.On

3) Set the trace event status to start.
EXEC sp_trace_setstatus @.traceid = 2, @.status = 1

I am getting only one column ..that is column which shows the user error..
for example "incorrect syntax near 'abcd' ".

I also want the sql query which caused the error. I could give only one columnid number while setting the trace event.

Please help me in getting the sql query which caused this error.

Each execution of 'sp_trace_setevent' will set a single column capture for the given event. If you want to capture different columns for the same event, include multiple back-to-back executions of 'sp_trace_setevent' with the same @.traceid and @.eventid values, but different @.columnid values.

Might find it easier if you opened profiler and configured the trace graphically with the events and columns you'd like to capture then start it and stop it immediately, then choose to script it from the 'File...Export...Script Trace Definition' menu option(s)...that will create a script file with the commands you would want to use to capture via a server-side trace.

HTH

Friday, February 24, 2012

Getting Exception while installing SQL Express 2005 in Windows Vista OS

Hi All,

I have developed an windows application using C#. I am using SQL Express as back-end.

I have created an installer class which first installs .NET Framework2.0, SQL Express2005 and then the

application. It is woking fine with WindowsNT and XP oprating systems.

If i try to install this on Windows Vista OS, I am getting expection while installing SQL Express(Creating SQL

Instance).

Can anybody help me in this scenario.

Regards,
Doppalapudi.

Can you supply the exact error message you are seeing? Are you seeing it on multiple Vista machines or just one? Can you also check your log directory for the text string "value 3" and supply the 10-15 lines above it?

Thanks,
Sam Lester (MSFT)

|||

Hi

Thanks for giving quick reply. I got the problem and solved it. I was able to install the application.

Thanks

Doppalapudi.