Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Monday, March 19, 2012

Detailed error reporting. How to?

The best I can get out of my detail log is this which is no help. How do I find out what really happened. My windows app log is no help either

Date 5/24/2006 9:51:41 PM
Log Job History (DTS_xx)

Step ID 1
Server xx
Job Name DTS_xx
Step Name DTS_xx
Duration 00:00:01
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0

Message
Executed as user: xx\administrator. The package execution failed. The step failed.

This KB article discusses various options:
http://support.microsoft.com/kb/918760|||

Michael - I'm glad your online right now. All that I'm trying to do is run stored procs on my database. My ssis package uses the correct login but I keep getting the error I posted. This was running fine on my 2000 box.

So I tried a few other things. I recreated the package on my production server and it works. Seems to be the problem is when I move it from my dev box to production its loosing something.

Wednesday, March 7, 2012

Desprate..Please Help

I wrote an application using Visual Studio 2005. This app requires a login that get that accesses SQL Express Data.

I have an XP Pro box set up as a server using DSL Modem and connected to that is a Wireless hub.

I used Network Wizard to set up a Home/Small Business Network on all the computers.

My laptop has XP Pro and has Visual Studio and that's where I wrote the application. It's connect to the wirless hub with a cat 5 cable.

The other laptop has XP Home Edition and is in another room is connected with wirless only.

I set up a user called user1 in SQLExpress with a password. I set it up using MIXED MODE. (SQL server and Windows authentication mode)

Connection String: myCn.ConnectionString = "Provider=SQLOLEDB;Data Source=ServerBox\SQLEXPRESS;Initial Catalog=db1;User ID=user1;Password=12345"

I turned off Simple Filesharing on the XP Pro box (Server).

In User Accounts XP...Guest account is turned OFF

When I run the applicaton I wrote from MY laptop (connected with cat 5 or Wireless), the application logs me in and I see all the data...It works

BUT when I run the appication from the other laptop (connected with wirless), I get an error : "Login Failed....ServerBox\Guest".

I'M STUMPED...DON'T KNOW WHAT TO DO ...CAN ANY HELP......

The first thought I had was I wonder if the 2nd laptop has SQL Server database drivers installed... I don't know if XP home installs them by default or not...|||No..the second laptop dosn't have sql drivers installed. Also the 2nd laptop has .net framework 1.1 not .net framework 2, not sure if that matters.|||

Can you verify the connection string used on the failing laptop?

The error message indicates that WIndows authentication was used even though the connection string above uses SQL Server authentication (by specifying User ID).

There should be a "login failed" message also in the SQL Express application event log (use Event Viewer to view), which contains a state number which may provide additional insights - can you paste that here omitting any confidential information (IP addresses, etc.)?

|||

This is the error log...I changed the servername and IP addresses.....

The laptop in question is using XP Home Edition

2006-10-09 06:49:38.81 Server Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86)
Apr 14 2006 01:12:25
Copyright (c) 1988-2005 Microsoft Corporation
Express Edition with Advanced Services on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-10-09 06:49:38.89 Server (c) 2005 Microsoft Corporation.
2006-10-09 06:49:38.89 Server All rights reserved.
2006-10-09 06:49:38.89 Server Server process ID is 1896.
2006-10-09 06:49:38.89 Server Logging SQL Server messages in file 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2006-10-09 06:49:38.90 Server This instance of SQL Server last reported using a process ID of 1928 at 10/8/2006 3:28:44 PM (local) 10/8/2006 7:28:44 PM (UTC). This is an informational message only; no user action is required.
2006-10-09 06:49:38.90 Server Registry startup parameters:
2006-10-09 06:49:38.94 Server -d c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2006-10-09 06:49:38.94 Server -e c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2006-10-09 06:49:38.94 Server -l c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2006-10-09 06:49:39.05 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2006-10-09 06:49:39.05 Server Detected 1 CPUs. This is an informational message; no user action is required.
2006-10-09 06:49:39.90 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2006-10-09 06:49:40.71 Server Database mirroring has been enabled on this instance of SQL Server.
2006-10-09 06:49:40.86 spid5s Starting up database 'master'.
2006-10-09 06:49:41.18 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2006-10-09 06:49:41.51 spid5s SQL Trace ID 1 was started by login "sa".
2006-10-09 06:49:41.58 spid5s Starting up database 'mssqlsystemresource'.
2006-10-09 06:49:41.61 spid5s The resource database build version is 9.00.2047. This is an informational message only. No user action is required.
2006-10-09 06:49:42.02 spid8s Starting up database 'model'.
2006-10-09 06:49:42.04 spid5s Server name is 'MYSERVER\SQLEXPRESS'. This is an informational message only. No user action is required.
2006-10-09 06:49:42.04 spid5s Starting up database 'msdb'.
2006-10-09 06:49:42.58 Server A self-generated certificate was successfully loaded for encryption.
2006-10-09 06:49:43.16 spid8s Clearing tempdb database.
2006-10-09 06:49:44.65 spid8s Starting up database 'tempdb'.
2006-10-09 06:49:45.26 spid5s Recovery is complete. This is an informational message only. No user action is required.
2006-10-09 06:49:45.30 spid11s The Service Broker protocol transport is disabled or not configured.
2006-10-09 06:49:45.35 spid11s The Database Mirroring protocol transport is disabled or not configured.
2006-10-09 06:49:46.83 spid11s Service Broker manager has started.
2006-10-09 06:49:47.93 Server Server is listening on [ 'any' <ipv4> 1632].
2006-10-09 06:49:47.93 Server Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\SQLEXPRESS ].
2006-10-09 06:49:47.93 Server Server named pipe provider is ready to accept connection on [ \\.\pipe\MSSQL$SQLEXPRESS\sql\query ].
2006-10-09 06:49:47.96 Server Dedicated administrator connection support was not started because it is not available on this edition of SQL Server. This is an informational message only. No user action is required.
2006-10-09 06:49:47.98 Server The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
2006-10-09 06:49:47.98 Server SQL Server is now ready for client connections. This is an informational message; no user action is required.
2006-10-09 07:03:44.08 Server Server resumed execution after being idle 807 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 07:03:59.40 spid51 Using 'xpstar90.dll' version '2005.90.2047' to execute extended stored procedure 'xp_enumerrorlogs'. This is an informational message only; no user action is required.
2006-10-09 07:44:23.82 Server Server resumed execution after being idle 1499 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 07:44:24.29 spid51 Starting up database 'db1'.
2006-10-09 08:36:00.42 Server Server resumed execution after being idle 2171 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 08:36:08.78 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 08:36:08.78 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 08:47:50.96 spid52 Using 'xplog70.dll' version '2005.90.2047' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
2006-10-09 08:50:50.02 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 08:50:50.02 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 09:28:40.91 Server Server resumed execution after being idle 45 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 09:55:25.09 Logon Error: 17806, Severity: 20, State: 2.
2006-10-09 09:55:25.09 Logon SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 100.100.1.100]
2006-10-09 09:55:25.09 Logon Error: 18452, Severity: 14, State: 1.
2006-10-09 09:55:25.09 Logon Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: 100.100.1.100]
2006-10-09 10:26:09.32 Server Server resumed execution after being idle 737 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 10:35:36.64 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 10:35:36.64 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 10:37:21.16 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 10:37:21.16 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 10:38:45.95 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 10:38:45.95 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 11:30:57.70 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 11:30:57.70 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 11:35:06.42 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 11:35:06.42 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 11:37:52.79 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 11:37:52.79 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 12:02:28.78 Server Server resumed execution after being idle 563 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 12:02:30.29 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 12:02:30.29 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 12:24:35.74 Server Server resumed execution after being idle 417 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 12:42:25.36 Server Server resumed execution after being idle 144 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 16:48:01.64 Server Server resumed execution after being idle 13826 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 16:49:19.98 Server SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.
2006-10-09 16:49:27.51 spid11s Service Broker manager has shut down.
2006-10-09 16:49:27.63 spid11s Error: 17054, Severity: 16, State: 1.
2006-10-09 16:49:27.63 spid11s The current event was not reported to the Windows Events log. Operating system error = 1717(The interface is unknown.). You may need to clear the Windows Events log if it is full.
2006-10-09 16:49:28.71 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

|||

Are you able to verify the connection string actually used on the failing machine?

Error messages that specify the user name in the form 'MYSERVER\Guest' typically indicate the use of Windows ("Integrated") authentication?

If you want to use Windows authentication, and your computers are in a workgroup (i.e. they are not joined to a domain) then you must create a Windows account to access the SQL Server with the same name and same password on both the SQL Server machine and every client machine that connects to the SQL Server, and use that account when making database connections.

|||When you say Windows Account, do you mean "User Accounts" on the Client and Server Machines?|||

Yes, "User Accounts" in the sense of the OS (Windows), not SQL Server.

|||

Thanks...I created a user account in the xp pro serverbox identical to the home edition laptop of the user.

I set up the user in sqlexpress........SERVER\laptopuser...Windows Authentication...default Database "db1".. The only thing is that the user never created a password in his home edition xp..So I left the Password BLANK. When he starts his computer there is NO login screen...he just goes to his workspace. Is that a problem, is a password needed.....?.

Anyway when I try to login from the users laptop I get error....cannot open db1.....So it looks like its loggin in to sqlexpress, but can't use db1 database. He is listed under both..Server Security and db1 security....db1

|||

Your initial tact to use SQL Server Authentication seemed like a perfectly adequate solution for your situation (and far more manageable). It's not clear to me how your connection is mapping into Windows Authentication mode (this would have "Trusted_Connection=yes" in the connection string...note the all important underscore, btw)...getting to the bottom of this may help shed some light on why your app is failing to connect.

Can you verify the connection string in your client app? Given your comment about versions of the .Net Framework that were installed, I'm assuming that this is a managed app...if that's correct, you can probably find the connection string by looking for the creation of a new SqlConnection in your code (the connection string would be the parameter to the constructor).

With regards to connecting using a blank password, it should, technically speaking, work fine. However, in terms of allowing access to your database, I would recommend against it.

|||

The settings for SQL Server Authentication are... Connections strings:

myCn.ConnectionString = "Provider=SQLOLEDB;Data Source=ServerBox\SQLEXPRESS;Initial Catalog=db1;User ID=user1;Password=12345"

The setting for Windows Authentication are... Connection string:

myCn.ConnectionString = "Provider=SQLOLEDB;Data Source=ServerBox\SQLEXPRESS;Initial Catalog=db1;Integrated Security=SSPI

I change the Application "Setting" to reflect the connection string I will be using, then re-complie the app.

|||Which of these two connection strings works/fails on which client machine?|||

Both fail on 1st client machine (xp home edition)

Both work on 2nd client machine (xp pro)

Also I just wanted to say that in my vb app, in debug..I notice that I get a connection to the db, but when the program continues....and starts reading the "TableAdapter.Fill" I get the error "login Failed for user1.
I Set up the user1 in SQLexpress for SQL Authentication with the default db as 'db1'..I checkd permissions in Instance properties and effective permissions show 'Connect SQL" and 'View Any Database'.
I checked the xsd(xml) and in debug mode when I select to "Preview Data" I ineter username and password and the data comes up. My Settings in the application are set as I stated to SQL Authentication.

Securables show nothing under db1 security and server security. I don't know what securables are...When I tried to add some, then save...and go back to look at them...they are gone ?

I must be missing something in SQL express Users and Logins...but I don't know what.
I'm at a loss ......!!!!!

|||

What is the state of the Error 18456 in SQL Server ERROROLOG when it says "Login Failed for user1"? Is it 16, as it was for MYSERVER\Guest?

State 16 is explained in this blog post:

http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

# re: Understanding "login failed" (Error 18456) error messages in SQL Server 2005

Tuesday, March 14, 2006 2:24 AM by Matt Neerincx [MSFT]

State=16 means that the incoming user does not have permissions to log into the target database. So for example say you create a user FOO and set FOO's default database to master, but FOO does not have permissions to log into master.

This can also happen if for example the default database for user FOO is not online (for example the database is marked suspect).

So to check on this theory, try logging the user into some other database and then try using the USE DATABASE command to switch to the target database, you will get a better error message as to the root cause of the failure.

|||

I get Error 18456, Severity 14, State: 8

From what I can gather State 8 means incorrect password. But I double checked and the password I'm using IS CORRECT. ?

The password I'm using is 6 characters all lowercase

Like i said, I connect to the server, but when it comes to accessing the database 'db1', I get the error.

Effective Permissions show: CONNECT SQL and VIEW ANY DATABASE

Desprate..Please Help

I wrote an application using Visual Studio 2005. This app requires a login that get that accesses SQL Express Data.

I have an XP Pro box set up as a server using DSL Modem and connected to that is a Wireless hub.

I used Network Wizard to set up a Home/Small Business Network on all the computers.

My laptop has XP Pro and has Visual Studio and that's where I wrote the application. It's connect to the wirless hub with a cat 5 cable.

The other laptop has XP Home Edition and is in another room is connected with wirless only.

I set up a user called user1 in SQLExpress with a password. I set it up using MIXED MODE. (SQL server and Windows authentication mode)

Connection String: myCn.ConnectionString = "Provider=SQLOLEDB;Data Source=ServerBox\SQLEXPRESS;Initial Catalog=db1;User ID=user1;Password=12345"

I turned off Simple Filesharing on the XP Pro box (Server).

In User Accounts XP...Guest account is turned OFF

When I run the applicaton I wrote from MY laptop (connected with cat 5 or Wireless), the application logs me in and I see all the data...It works

BUT when I run the appication from the other laptop (connected with wirless), I get an error : "Login Failed....ServerBox\Guest".

I'M STUMPED...DON'T KNOW WHAT TO DO ...CAN ANY HELP......

The first thought I had was I wonder if the 2nd laptop has SQL Server database drivers installed... I don't know if XP home installs them by default or not...|||No..the second laptop dosn't have sql drivers installed. Also the 2nd laptop has .net framework 1.1 not .net framework 2, not sure if that matters.|||

Can you verify the connection string used on the failing laptop?

The error message indicates that WIndows authentication was used even though the connection string above uses SQL Server authentication (by specifying User ID).

There should be a "login failed" message also in the SQL Express application event log (use Event Viewer to view), which contains a state number which may provide additional insights - can you paste that here omitting any confidential information (IP addresses, etc.)?

|||

This is the error log...I changed the servername and IP addresses.....

The laptop in question is using XP Home Edition

2006-10-09 06:49:38.81 Server Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86)
Apr 14 2006 01:12:25
Copyright (c) 1988-2005 Microsoft Corporation
Express Edition with Advanced Services on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-10-09 06:49:38.89 Server (c) 2005 Microsoft Corporation.
2006-10-09 06:49:38.89 Server All rights reserved.
2006-10-09 06:49:38.89 Server Server process ID is 1896.
2006-10-09 06:49:38.89 Server Logging SQL Server messages in file 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2006-10-09 06:49:38.90 Server This instance of SQL Server last reported using a process ID of 1928 at 10/8/2006 3:28:44 PM (local) 10/8/2006 7:28:44 PM (UTC). This is an informational message only; no user action is required.
2006-10-09 06:49:38.90 Server Registry startup parameters:
2006-10-09 06:49:38.94 Server -d c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2006-10-09 06:49:38.94 Server -e c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2006-10-09 06:49:38.94 Server -l c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2006-10-09 06:49:39.05 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2006-10-09 06:49:39.05 Server Detected 1 CPUs. This is an informational message; no user action is required.
2006-10-09 06:49:39.90 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2006-10-09 06:49:40.71 Server Database mirroring has been enabled on this instance of SQL Server.
2006-10-09 06:49:40.86 spid5s Starting up database 'master'.
2006-10-09 06:49:41.18 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2006-10-09 06:49:41.51 spid5s SQL Trace ID 1 was started by login "sa".
2006-10-09 06:49:41.58 spid5s Starting up database 'mssqlsystemresource'.
2006-10-09 06:49:41.61 spid5s The resource database build version is 9.00.2047. This is an informational message only. No user action is required.
2006-10-09 06:49:42.02 spid8s Starting up database 'model'.
2006-10-09 06:49:42.04 spid5s Server name is 'MYSERVER\SQLEXPRESS'. This is an informational message only. No user action is required.
2006-10-09 06:49:42.04 spid5s Starting up database 'msdb'.
2006-10-09 06:49:42.58 Server A self-generated certificate was successfully loaded for encryption.
2006-10-09 06:49:43.16 spid8s Clearing tempdb database.
2006-10-09 06:49:44.65 spid8s Starting up database 'tempdb'.
2006-10-09 06:49:45.26 spid5s Recovery is complete. This is an informational message only. No user action is required.
2006-10-09 06:49:45.30 spid11s The Service Broker protocol transport is disabled or not configured.
2006-10-09 06:49:45.35 spid11s The Database Mirroring protocol transport is disabled or not configured.
2006-10-09 06:49:46.83 spid11s Service Broker manager has started.
2006-10-09 06:49:47.93 Server Server is listening on [ 'any' <ipv4> 1632].
2006-10-09 06:49:47.93 Server Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\SQLEXPRESS ].
2006-10-09 06:49:47.93 Server Server named pipe provider is ready to accept connection on [ \\.\pipe\MSSQL$SQLEXPRESS\sql\query ].
2006-10-09 06:49:47.96 Server Dedicated administrator connection support was not started because it is not available on this edition of SQL Server. This is an informational message only. No user action is required.
2006-10-09 06:49:47.98 Server The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
2006-10-09 06:49:47.98 Server SQL Server is now ready for client connections. This is an informational message; no user action is required.
2006-10-09 07:03:44.08 Server Server resumed execution after being idle 807 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 07:03:59.40 spid51 Using 'xpstar90.dll' version '2005.90.2047' to execute extended stored procedure 'xp_enumerrorlogs'. This is an informational message only; no user action is required.
2006-10-09 07:44:23.82 Server Server resumed execution after being idle 1499 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 07:44:24.29 spid51 Starting up database 'db1'.
2006-10-09 08:36:00.42 Server Server resumed execution after being idle 2171 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 08:36:08.78 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 08:36:08.78 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 08:47:50.96 spid52 Using 'xplog70.dll' version '2005.90.2047' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
2006-10-09 08:50:50.02 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 08:50:50.02 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 09:28:40.91 Server Server resumed execution after being idle 45 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 09:55:25.09 Logon Error: 17806, Severity: 20, State: 2.
2006-10-09 09:55:25.09 Logon SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 100.100.1.100]
2006-10-09 09:55:25.09 Logon Error: 18452, Severity: 14, State: 1.
2006-10-09 09:55:25.09 Logon Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: 100.100.1.100]
2006-10-09 10:26:09.32 Server Server resumed execution after being idle 737 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 10:35:36.64 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 10:35:36.64 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 10:37:21.16 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 10:37:21.16 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 10:38:45.95 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 10:38:45.95 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 11:30:57.70 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 11:30:57.70 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 11:35:06.42 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 11:35:06.42 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 11:37:52.79 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 11:37:52.79 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 12:02:28.78 Server Server resumed execution after being idle 563 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 12:02:30.29 Logon Error: 18456, Severity: 14, State: 16.
2006-10-09 12:02:30.29 Logon Login failed for user 'MYSERVER\Guest'. [CLIENT: 100.100.1.100]
2006-10-09 12:24:35.74 Server Server resumed execution after being idle 417 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 12:42:25.36 Server Server resumed execution after being idle 144 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 16:48:01.64 Server Server resumed execution after being idle 13826 seconds: user activity awakened the server. This is an informational message only. No user action is required.
2006-10-09 16:49:19.98 Server SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.
2006-10-09 16:49:27.51 spid11s Service Broker manager has shut down.
2006-10-09 16:49:27.63 spid11s Error: 17054, Severity: 16, State: 1.
2006-10-09 16:49:27.63 spid11s The current event was not reported to the Windows Events log. Operating system error = 1717(The interface is unknown.). You may need to clear the Windows Events log if it is full.
2006-10-09 16:49:28.71 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

|||

Are you able to verify the connection string actually used on the failing machine?

Error messages that specify the user name in the form 'MYSERVER\Guest' typically indicate the use of Windows ("Integrated") authentication?

If you want to use Windows authentication, and your computers are in a workgroup (i.e. they are not joined to a domain) then you must create a Windows account to access the SQL Server with the same name and same password on both the SQL Server machine and every client machine that connects to the SQL Server, and use that account when making database connections.

|||When you say Windows Account, do you mean "User Accounts" on the Client and Server Machines?|||

Yes, "User Accounts" in the sense of the OS (Windows), not SQL Server.

|||

Thanks...I created a user account in the xp pro serverbox identical to the home edition laptop of the user.

I set up the user in sqlexpress........SERVER\laptopuser...Windows Authentication...default Database "db1".. The only thing is that the user never created a password in his home edition xp..So I left the Password BLANK. When he starts his computer there is NO login screen...he just goes to his workspace. Is that a problem, is a password needed.....?.

Anyway when I try to login from the users laptop I get error....cannot open db1.....So it looks like its loggin in to sqlexpress, but can't use db1 database. He is listed under both..Server Security and db1 security....db1

|||

Your initial tact to use SQL Server Authentication seemed like a perfectly adequate solution for your situation (and far more manageable). It's not clear to me how your connection is mapping into Windows Authentication mode (this would have "Trusted_Connection=yes" in the connection string...note the all important underscore, btw)...getting to the bottom of this may help shed some light on why your app is failing to connect.

Can you verify the connection string in your client app? Given your comment about versions of the .Net Framework that were installed, I'm assuming that this is a managed app...if that's correct, you can probably find the connection string by looking for the creation of a new SqlConnection in your code (the connection string would be the parameter to the constructor).

With regards to connecting using a blank password, it should, technically speaking, work fine. However, in terms of allowing access to your database, I would recommend against it.

|||

The settings for SQL Server Authentication are... Connections strings:

myCn.ConnectionString = "Provider=SQLOLEDB;Data Source=ServerBox\SQLEXPRESS;Initial Catalog=db1;User ID=user1;Password=12345"

The setting for Windows Authentication are... Connection string:

myCn.ConnectionString = "Provider=SQLOLEDB;Data Source=ServerBox\SQLEXPRESS;Initial Catalog=db1;Integrated Security=SSPI

I change the Application "Setting" to reflect the connection string I will be using, then re-complie the app.

|||Which of these two connection strings works/fails on which client machine?|||

Both fail on 1st client machine (xp home edition)

Both work on 2nd client machine (xp pro)

Also I just wanted to say that in my vb app, in debug..I notice that I get a connection to the db, but when the program continues....and starts reading the "TableAdapter.Fill" I get the error "login Failed for user1.
I Set up the user1 in SQLexpress for SQL Authentication with the default db as 'db1'..I checkd permissions in Instance properties and effective permissions show 'Connect SQL" and 'View Any Database'.
I checked the xsd(xml) and in debug mode when I select to "Preview Data" I ineter username and password and the data comes up. My Settings in the application are set as I stated to SQL Authentication.

Securables show nothing under db1 security and server security. I don't know what securables are...When I tried to add some, then save...and go back to look at them...they are gone ?

I must be missing something in SQL express Users and Logins...but I don't know what.
I'm at a loss ......!!!!!

|||

What is the state of the Error 18456 in SQL Server ERROROLOG when it says "Login Failed for user1"? Is it 16, as it was for MYSERVER\Guest?

State 16 is explained in this blog post:

http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

# re: Understanding "login failed" (Error 18456) error messages in SQL Server 2005

Tuesday, March 14, 2006 2:24 AM by Matt Neerincx [MSFT]

State=16 means that the incoming user does not have permissions to log into the target database. So for example say you create a user FOO and set FOO's default database to master, but FOO does not have permissions to log into master.

This can also happen if for example the default database for user FOO is not online (for example the database is marked suspect).

So to check on this theory, try logging the user into some other database and then try using the USE DATABASE command to switch to the target database, you will get a better error message as to the root cause of the failure.

|||

I get Error 18456, Severity 14, State: 8

From what I can gather State 8 means incorrect password. But I double checked and the password I'm using IS CORRECT. ?

The password I'm using is 6 characters all lowercase

Like i said, I connect to the server, but when it comes to accessing the database 'db1', I get the error.

Effective Permissions show: CONNECT SQL and VIEW ANY DATABASE

Desktop platform support for SQL Server Compact Edition?

Hi-

I am doing some technology research for a new app and was wondering about the desktop operating system support for SQL Server compact edition. This app has a PC component and a mobile component, and both need to be data enabled, with syncronization between the PC and the mobile device.

So it seems like SSCE would be a good fit. Just run the SSCE client on both the PC and the device. But in the system requirements for SSCE it only gives XP as a valid desktop OS...

Is that correct? Obviously, desktop platform support for a production app will need to be broader than just XP.

Will SSCE desktop run on Win98,Win2000,XP Home, and Vista?

From my own experience, XP Home and Vista are supported. The official support list is:

Supported Operating Systems: Windows 2000 Service Pack 4; Windows CE; Windows Mobile 2003 software for Pocket PCs; Windows Mobile 5.0; Windows Server 2003 R2 (32-Bit x86); Windows Server 2003 R2 Datacenter Edition (32-Bit x86); Windows Server 2003 R2 Enterprise Edition (32-Bit x86); Windows Server 2003 R2 Standard Edition (32-bit x86); Windows Server 2003, Datacenter Edition (32-bit x86); Windows Server 2003, Standard Edition (32-bit x86); Windows XP Home Edition ; Windows XP Media Center Edition; Windows XP Professional Edition ; Windows XP Service Pack 2; Windows XP Tablet PC Edition

|||

Jo?o Paulo Figueira wrote:

From my own experience, XP Home and Vista are supported. The official support list is:

Supported Operating Systems: Windows 2000 Service Pack 4; Windows CE; Windows Mobile 2003 software for Pocket PCs; Windows Mobile 5.0; Windows Server 2003 R2 (32-Bit x86); Windows Server 2003 R2 Datacenter Edition (32-Bit x86); Windows Server 2003 R2 Enterprise Edition (32-Bit x86); Windows Server 2003 R2 Standard Edition (32-bit x86); Windows Server 2003, Datacenter Edition (32-bit x86); Windows Server 2003, Standard Edition (32-bit x86); Windows XP Home Edition ; Windows XP Media Center Edition; Windows XP Professional Edition ; Windows XP Service Pack 2; Windows XP Tablet PC Edition

Hi Joao-

Thanks a lot for that info. Is there any way you can publish the URL to that list - there may be other useful info on that page?

Also, I notice Windows Mobile 6.0 is not on the supported operating systems list? Is there any estimate on when that will be supported?
|||Here's the link. Although not explicitly stated, I don't believe you will have problems running on Windows Mobile 6.|||On Windows Mobile 6.0, SQL Compact 3.1 is included in ROM.

Desktop platform support for SQL Server Compact Edition?

Hi-

I am doing some technology research for a new app and was wondering about the desktop operating system support for SQL Server compact edition. This app has a PC component and a mobile component, and both need to be data enabled, with syncronization between the PC and the mobile device.

So it seems like SSCE would be a good fit. Just run the SSCE client on both the PC and the device. But in the system requirements for SSCE it only gives XP as a valid desktop OS...

Is that correct? Obviously, desktop platform support for a production app will need to be broader than just XP.

Will SSCE desktop run on Win98,Win2000,XP Home, and Vista?

From my own experience, XP Home and Vista are supported. The official support list is:

Supported Operating Systems: Windows 2000 Service Pack 4; Windows CE; Windows Mobile 2003 software for Pocket PCs; Windows Mobile 5.0; Windows Server 2003 R2 (32-Bit x86); Windows Server 2003 R2 Datacenter Edition (32-Bit x86); Windows Server 2003 R2 Enterprise Edition (32-Bit x86); Windows Server 2003 R2 Standard Edition (32-bit x86); Windows Server 2003, Datacenter Edition (32-bit x86); Windows Server 2003, Standard Edition (32-bit x86); Windows XP Home Edition ; Windows XP Media Center Edition; Windows XP Professional Edition ; Windows XP Service Pack 2; Windows XP Tablet PC Edition

|||

Jo?o Paulo Figueira wrote:

From my own experience, XP Home and Vista are supported. The official support list is:

Supported Operating Systems: Windows 2000 Service Pack 4; Windows CE; Windows Mobile 2003 software for Pocket PCs; Windows Mobile 5.0; Windows Server 2003 R2 (32-Bit x86); Windows Server 2003 R2 Datacenter Edition (32-Bit x86); Windows Server 2003 R2 Enterprise Edition (32-Bit x86); Windows Server 2003 R2 Standard Edition (32-bit x86); Windows Server 2003, Datacenter Edition (32-bit x86); Windows Server 2003, Standard Edition (32-bit x86); Windows XP Home Edition ; Windows XP Media Center Edition; Windows XP Professional Edition ; Windows XP Service Pack 2; Windows XP Tablet PC Edition

Hi Joao-

Thanks a lot for that info. Is there any way you can publish the URL to that list - there may be other useful info on that page?

Also, I notice Windows Mobile 6.0 is not on the supported operating systems list? Is there any estimate on when that will be supported?
|||Here's the link. Although not explicitly stated, I don't believe you will have problems running on Windows Mobile 6.|||On Windows Mobile 6.0, SQL Compact 3.1 is included in ROM.

Desktop platform support for SQL Server Compact Edition?

Hi-

I am doing some technology research for a new app and was wondering about the desktop operating system support for SQL Server compact edition. This app has a PC component and a mobile component, and both need to be data enabled, with syncronization between the PC and the mobile device.

So it seems like SSCE would be a good fit. Just run the SSCE client on both the PC and the device. But in the system requirements for SSCE it only gives XP as a valid desktop OS...

Is that correct? Obviously, desktop platform support for a production app will need to be broader than just XP.

Will SSCE desktop run on Win98,Win2000,XP Home, and Vista?

From my own experience, XP Home and Vista are supported. The official support list is:

Supported Operating Systems: Windows 2000 Service Pack 4; Windows CE; Windows Mobile 2003 software for Pocket PCs; Windows Mobile 5.0; Windows Server 2003 R2 (32-Bit x86); Windows Server 2003 R2 Datacenter Edition (32-Bit x86); Windows Server 2003 R2 Enterprise Edition (32-Bit x86); Windows Server 2003 R2 Standard Edition (32-bit x86); Windows Server 2003, Datacenter Edition (32-bit x86); Windows Server 2003, Standard Edition (32-bit x86); Windows XP Home Edition ; Windows XP Media Center Edition; Windows XP Professional Edition ; Windows XP Service Pack 2; Windows XP Tablet PC Edition

|||

Jo?o Paulo Figueira wrote:

From my own experience, XP Home and Vista are supported. The official support list is:

Supported Operating Systems: Windows 2000 Service Pack 4; Windows CE; Windows Mobile 2003 software for Pocket PCs; Windows Mobile 5.0; Windows Server 2003 R2 (32-Bit x86); Windows Server 2003 R2 Datacenter Edition (32-Bit x86); Windows Server 2003 R2 Enterprise Edition (32-Bit x86); Windows Server 2003 R2 Standard Edition (32-bit x86); Windows Server 2003, Datacenter Edition (32-bit x86); Windows Server 2003, Standard Edition (32-bit x86); Windows XP Home Edition ; Windows XP Media Center Edition; Windows XP Professional Edition ; Windows XP Service Pack 2; Windows XP Tablet PC Edition

Hi Joao-

Thanks a lot for that info. Is there any way you can publish the URL to that list - there may be other useful info on that page?

Also, I notice Windows Mobile 6.0 is not on the supported operating systems list? Is there any estimate on when that will be supported?
|||Here's the link. Although not explicitly stated, I don't believe you will have problems running on Windows Mobile 6.|||On Windows Mobile 6.0, SQL Compact 3.1 is included in ROM.

Saturday, February 25, 2012

designing inheriting entities

Dear All,
our customer has 3 kinds of entites
the first one is the ApplicationCenter where students can register to
exams...
and there are types of app centers like University offices, high schools
etc.. these types goes to another table..
and finally each type has its own instances like University one ,
university2 , univ3 etc. which means there are several more tables Like
universities , highschools , examCenters etc...
the requirement is to have ADD/Edit/Delete screens of all ApplicationCenters
of the customer..
the listing of the centers and their info is straightforward however when it
is time to edit many entities needs to be updated at the same time
.........
i am trying to figure out a table design where i can build sort of
inheriting entities..
any clue?
best regards..
emre dincer
Emre DNER wrote:
> Dear All,
> our customer has 3 kinds of entites
> the first one is the ApplicationCenter where students can register to
> exams...
> and there are types of app centers like University offices, high schools
> etc.. these types goes to another table..
> and finally each type has its own instances like University one ,
> university2 , univ3 etc. which means there are several more tables Like
> universities , highschools , examCenters etc...
> the requirement is to have ADD/Edit/Delete screens of all ApplicationCenters
> of the customer..
> the listing of the centers and their info is straightforward however when it
> is time to edit many entities needs to be updated at the same time
> ........
> i am trying to figure out a table design where i can build sort of
> inheriting entities..
> any clue?
> best regards..
> emre dincer
It is possible to ensure that each common attribute appears only in
one place in the hierarchy for each type of entity. Therefore the
problem of updating the same attribute in multiple places won't arise.
Fifth Normal Form and the Principle of Orthogonal Design are two
principles that will help you achieve a good model. Google for them if
you aren't already familiar with them.
David Portas

designing inheriting entities

Dear All,
our customer has 3 kinds of entites
the first one is the ApplicationCenter where students can register to
exams...
and there are types of app centers like university offices, high schools
etc.. these types goes to another table..
and finally each type has its own instances like university one ,
university2 , univ3 etc. which means there are several more tables Like
universities , highschools , examCenters etc...
the requirement is to have ADD/Edit/Delete screens of all ApplicationCenters
of the customer..
the listing of the centers and their info is straightforward however when it
is time to edit many entities needs to be updated at the same time
........
i am trying to figure out a table design where i can build sort of
inheriting entities..
any clue?
best regards..
emre dincerEmre D=DDN=C7ER wrote:
> Dear All,
> our customer has 3 kinds of entites
> the first one is the ApplicationCenter where students can register to
> exams...
> and there are types of app centers like university offices, high schools
> etc.. these types goes to another table..
> and finally each type has its own instances like university one ,
> university2 , univ3 etc. which means there are several more tables Like
> universities , highschools , examCenters etc...
> the requirement is to have ADD/Edit/Delete screens of all ApplicationCente=[/vbcol
]
rs[vbcol=seagreen]
> of the customer..
> the listing of the centers and their info is straightforward however when =[/vbcol
]
it[vbcol=seagreen]
> is time to edit many entities needs to be updated at the same time
> ........
> i am trying to figure out a table design where i can build sort of
> inheriting entities..
> any clue?
> best regards..
> emre dincer
It is possible to ensure that each common attribute appears only in
one place in the hierarchy for each type of entity. Therefore the
problem of updating the same attribute in multiple places won't arise.
Fifth Normal Form and the Principle of Orthogonal Design are two
principles that will help you achieve a good model. Google for them if
you aren't already familiar with them.
David Portas

Designing a Report without Dataset

Hello

We are trying to create an app where we pass dynamically a dataset (from our form in C#) to our {report}.rdl file.

We are having doubts about something.

How can we design the actual report if we don't have the datasource until runtime? The reason to do this is due to our complex calculations of data which becomes almost impossible to achieve in a T-SQL environment.

I know with a lot of patience and time (we don't have both) we can achieve it, but even though, we would need to process some data in the client side.

So, the question is... is it possible to design a report without a Dataset? I know we can drag the controls on the layout window, but we won't be able to test it. IS there any workaroung about this?

Thank you

Assuming that you use the ReportViewer control in local mode and you have the dataset schema, you can lay out the report from the schema, e.g. from a typed dataset. You may find the following article helpful.|||

Ok, let's get more detailed about this.

We have our SQL Server. let's call it SQL. We have our clients using our software. In our software we have a winform with a ReportViewer object.

Ok. We want that winform to load dynamically the reports stored in our SQL Server. We want to pass a parameter to the winform, which is the report name, then according to that parameter we are going to load a report. OK. Then, Once we know what report we want to load, we want to be able to pass a "runtime dataset" (a dataset created at runtime) Why? because of the complexity of our calculations we prefer to retrieve the data raw from the SQL, then process it in our client software and then pass it to our report (which we have already selected and it's waiting to be shown in the Report Viewer).

We thought the steps were something like create an instance of a LocalReport, then get the Definition from the report (stored in the SQL Server) and pass it to this LocalReport, then create a ReportDataset instance and pass the data the way we want it, then pass that ReportDataset to the LocalReport and then tell the ReportViewer to show that instance of the LocalReport.

That's in detail what we want. So far we haven't been able to achieve it, but we keep on trying. Any suggestion is welcome.

By the way, does anyone can address me to this new feature of SQL2005 for writing code in C#. Maybe that's a solution for our "Processin Stage".

Regards

|||

We want that winform to load dynamically the reports stored in our SQL Server.

I interpret this as you keep the report definitions in a SQL Server database. You don't have/need a Report Server, correct? You need to:

1. Save the report definition to a local file.

2. Generate the dataset.

3. Configure the report viewer in local mode and bind the dataset to it.

Friday, February 24, 2012

Design Solution Required

We are facing design issues, Could you please advice us how to proceed?

Problem description: Web App will pass a complex dynamic SQL query to
backend and it should return result set as fast as it can
Issue 1: SQL query will have lot of JOINS and WHERE clause
Issue 2: Each Table contain millions of records

Requirement: Turn around time of the SQL query should be as far as
possible minimum.

Could you please advice us which technology we should use, such that
users get the resultset in few seconds.

We are Microsoft Partner. We use only Microsoft technology for our
product development.

Your Help is much appreciated

With Regards
S a t h y a RCould you please advice us which technology we should use, such that

Quote:

Originally Posted by

users get the resultset in few seconds.


Pay particular attention to index and query tuning. Make sure you have
indexes that the optimizer can use to generate the most efficient plan.
Prioritize tuning so that the most often executed and expensive queries are
addressed first. Also consider indexed views, which are especially
appropriate for aggregated data. Keep in mind that too many indexes can
hurt performance if you do a lot of inserts/updates so you'll need to
perform cost-benefit analysis.

I suggest you get a good book that covers query and index tuning in depth.
I recommend Inside Microsoft SQL Server 2005: T-SQL Querying, ISBN
9780735623132.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Sathya" <sathyamca@.gmail.comwrote in message
news:1164801200.132687.7070@.j72g2000cwa.googlegrou ps.com...

Quote:

Originally Posted by

We are facing design issues, Could you please advice us how to proceed?
>
Problem description: Web App will pass a complex dynamic SQL query to
backend and it should return result set as fast as it can
Issue 1: SQL query will have lot of JOINS and WHERE clause
Issue 2: Each Table contain millions of records
>
Requirement: Turn around time of the SQL query should be as far as
possible minimum.
>
>
Could you please advice us which technology we should use, such that
users get the resultset in few seconds.
>
We are Microsoft Partner. We use only Microsoft technology for our
product development.
>
>
Your Help is much appreciated
>
With Regards
S a t h y a R
>

|||Sathya wrote:

Quote:

Originally Posted by

We are facing design issues, Could you please advice us how to proceed?
>
Problem description: Web App will pass a complex dynamic SQL query to
backend and it should return result set as fast as it can
Issue 1: SQL query will have lot of JOINS and WHERE clause
Issue 2: Each Table contain millions of records


Quote:

Originally Posted by

Could you please advice us which technology we should use, such that
users get the resultset in few seconds.
>


Use sp_executesql to execute your dynamic SQL (not EXEC). Even better,
try to use a prepared statement. In your queries, make sure to use the
indexes, avoid calling functions and do not sort in SQL unless it is
absolutely necessary (sort on client side instead).

You could also save typical queries and run them through the Database
Tuning Advisor, which will suggest how to index your tables. This
wizard is available with SQL Server 2005 in the Management Studio, but
it can help to tune SQL Server 2000 databases as well.

If you can afford it, use SQL 2005 Enterprise Edition, which will allow
you to partition your tables. Partitions can greatly improve speed.
Again save a typical query and run it through the Database Tuning
Advisor, which can suggest how to create optimal partitions.

This wizard is just awesome, but of course if your queries are
completely random and different it won't be of much help since it need
a specific workload to make suggestions.

Regard,
lucm

Sunday, February 19, 2012

Design Question - SQL 2000 to 2005 App Upgrade (CLR?)

I'm upgrading an app I wrote from SQL 2000 to 2005 looking for some
high-level design advice, just to determine how much should be T-SQL vs.
CLR, and the best approach to take for performance. For background, I'm a
strong c# developer, but with only average SQL skills and I'm just getting
into SQL 2005.
My Current (SQL 2000) Setup:
--
My C# app regularly collects performance information, then inserts it into a
table. On insert in that table I have a trigger to kick off a couple stored
procs that compare the new data to other tables where thresholds are set.
As a simple example, it essentially does a "SELECT * FROM Thresholds WHERE
@.NewlyInsertedValue > ThresholdValue" to determine if the current value is
in violation of any thresholds. (There are a couple more columns that are
considered that makes the query a little more intensive, but this is the
general idea)
If thresholds are violated, it inserts a record into an 'alerts' table and
generates an email (by another stored proc). If no thresholds are violated,
it runs a stored proc to clear any alerts that might have been created
previously since we're not in violation anymore. Since this happens EVERY
time a new value is collected, I really want to optimize this as much as
possible.
My Desired (SQL 2005) Setup:
--
I'm going to replace certain obvious functions like the "send email"
function from old SQL objects to net CLR objects. However, I want to
further optimize the system that compares incoming data with thresholds and
generates alerts as necessary. It seems very wasteful to do selects every
time a new value is inserted, and as the tables grow even with proper
indexing it is going to get expensive. Is there a way I can take advantage
of CLR to maybe keep these thresholds in memory to compare them against?
Any other ideas about how to accomplish this most efficiently?
Craig
PS - I can post DDL if you really want it, I was just trying to get high
level design ideas from someone that's done a lot of SQL CLR work already.For general data manipulation especially Inserts, Updates, Deletes and
normal Selects TSQL will always be the best choice. The CLR is useful for
heavy calculations / aggregations or when you simply can't do something with
TSQL. Of coarse anytime you need to visit the filesystem or need the
equivalent of an extended sp the CLR is prime for that as well. AS for the
mail component you can use the new DatabaseMail which works pretty well and
a lot less troublesome than the MAPI version in 2000. But in general I
suggest you use stored procedures for this instead of triggers. You have a
fair amount of processing to do and you should keep triggers as trim as
possible. I don't see any reason this logic can not be put into a standard
TSQL stored procedure. But as for checking the values why not do that in the
front end or middle tier before you even attempt the insert? That kind of
information is pretty much static and can be cached very easily in the
middle tier or front end. If these inserts are many you can save a lot of
processing etc. on the back end by validating the data before you send it
in.
Andrew J. Kelly SQL MVP
"Craig S" <cscheets@.dontspam.kc.rr.com> wrote in message
news:OIG$CfXDGHA.1544@.TK2MSFTNGP10.phx.gbl...
> I'm upgrading an app I wrote from SQL 2000 to 2005 looking for some
> high-level design advice, just to determine how much should be T-SQL vs.
> CLR, and the best approach to take for performance. For background, I'm a
> strong c# developer, but with only average SQL skills and I'm just getting
> into SQL 2005.
> My Current (SQL 2000) Setup:
> --
> My C# app regularly collects performance information, then inserts it into
> a table. On insert in that table I have a trigger to kick off a couple
> stored procs that compare the new data to other tables where thresholds
> are set. As a simple example, it essentially does a "SELECT * FROM
> Thresholds WHERE @.NewlyInsertedValue > ThresholdValue" to determine if the
> current value is in violation of any thresholds. (There are a couple more
> columns that are considered that makes the query a little more intensive,
> but this is the general idea)
> If thresholds are violated, it inserts a record into an 'alerts' table and
> generates an email (by another stored proc). If no thresholds are
> violated, it runs a stored proc to clear any alerts that might have been
> created previously since we're not in violation anymore. Since this
> happens EVERY time a new value is collected, I really want to optimize
> this as much as possible.
> My Desired (SQL 2005) Setup:
> --
> I'm going to replace certain obvious functions like the "send email"
> function from old SQL objects to net CLR objects. However, I want to
> further optimize the system that compares incoming data with thresholds
> and generates alerts as necessary. It seems very wasteful to do selects
> every time a new value is inserted, and as the tables grow even with
> proper indexing it is going to get expensive. Is there a way I can take
> advantage of CLR to maybe keep these thresholds in memory to compare them
> against? Any other ideas about how to accomplish this most efficiently?
> Craig
> PS - I can post DDL if you really want it, I was just trying to get high
> level design ideas from someone that's done a lot of SQL CLR work already.
>|||First, you're right - everything I'm doing can be done in T-SQL (It is today
in SQL 2000). I just wanted to see if CLR would offer any optimization.
Secondly, I think you're right about caching the data and performing the
checks in the middle tier for violations (I'm using web services). From
what I understand I can actually subscribe to changes to a table/view in
2005 so that I could cache that info and just rebuild it any time the
thresholds table was updated. The thresholds data is pretty static, so this
could definately work.
I guess this is basically what I was trying to do, but for some reason
thought it needed to live in the db. Logic is always best left in the
middle/front tier anyway I guess.
So, good call Andrew. Anyone else have anything to add/recommend?
Craig
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:O9eKD9XDGHA.3444@.TK2MSFTNGP10.phx.gbl...
> For general data manipulation especially Inserts, Updates, Deletes and
> normal Selects TSQL will always be the best choice. The CLR is useful for
> heavy calculations / aggregations or when you simply can't do something
> with TSQL. Of coarse anytime you need to visit the filesystem or need the
> equivalent of an extended sp the CLR is prime for that as well. AS for the
> mail component you can use the new DatabaseMail which works pretty well
> and a lot less troublesome than the MAPI version in 2000. But in general
> I suggest you use stored procedures for this instead of triggers. You have
> a fair amount of processing to do and you should keep triggers as trim as
> possible. I don't see any reason this logic can not be put into a
> standard TSQL stored procedure. But as for checking the values why not do
> that in the front end or middle tier before you even attempt the insert?
> That kind of information is pretty much static and can be cached very
> easily in the middle tier or front end. If these inserts are many you can
> save a lot of processing etc. on the back end by validating the data
> before you send it in.
> --
> Andrew J. Kelly SQL MVP
>
> "Craig S" <cscheets@.dontspam.kc.rr.com> wrote in message
> news:OIG$CfXDGHA.1544@.TK2MSFTNGP10.phx.gbl...
>|||Xref: TK2MSFTNGP08.phx.gbl microsoft.public.sqlserver.programming:574655
Craig S (cscheets@.dontspam.kc.rr.com) writes:
> My C# app regularly collects performance information, then inserts it
> into a table. On insert in that table I have a trigger to kick off a
> couple stored procs that compare the new data to other tables where
> thresholds are set. As a simple example, it essentially does a "SELECT *
> FROM Thresholds WHERE @.NewlyInsertedValue > ThresholdValue" to determine
> if the current value is in violation of any thresholds. (There are a
> couple more columns that are considered that makes the query a little
> more intensive, but this is the general idea)
As long you have full control over the data, using a stored procedure
to insert is better. Triggers are more difficult to write, and there
is one ugly thing about them: they can disappear without notice. If
a stored procedure is dropped inadvertenly, your application will
cry out, but if the trigger is missing, you will only get incorrect
results.

> It seems very wasteful to do selects every time a new value is inserted,
> and as the tables grow even with proper indexing it is going to get
> expensive. Is there a way I can take advantage of CLR to maybe keep
> these thresholds in memory to compare them against?
Maybe there is, but it would be a bad idea. Don't worry, that data
is in memory already. SQL Server takes care of that, and keeps as
much data in cache as possible.

> I guess this is basically what I was trying to do, but for some reason
> thought it needed to live in the db. Logic is always best left in the
> middle/front tier anyway I guess.
Personally, I'm a strong believer in having the business logic where
the database is.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Design question

We currently have an ASP.NET app that includes some reports. I'm
considering
making the data available in RS and I'm looking for some opinions
about
the feasibility and difficulty in doing this.
The app uses ODBC to connect to DB2. The users use their DB2 userid
and password, and this is what is used in the connection string.
The current solution includes a lot of manipulation of datatables
which are then bound to ASP.NET datagrids.
My thought was to create a web service that would serve as an RS Data
Extension, but I'm just taking a first look at this and don't know how
practical it would be. The idea is that the data retrieval and
manipulation logic could be in the web service, which would return a
dataset (or whatever).
The solution would have to include drilling down / linking to other
reports, so the userid and password would have to be maintained behind
the scenes so they could be passed, along with other parameters, to
the web service for each report/subreport.
Any thoughts are welcome.
TIA,
JimSounds like a winner to me :-). It doesn't have to be a web service of
course, you can write a data extension which would itself query your data
source and massage the data.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"jim corey" <jhcorey@.yahoo.com> wrote in message
news:1c4f8dcf.0409210702.587ac17d@.posting.google.com...
> We currently have an ASP.NET app that includes some reports. I'm
> considering
> making the data available in RS and I'm looking for some opinions
> about
> the feasibility and difficulty in doing this.
> The app uses ODBC to connect to DB2. The users use their DB2 userid
> and password, and this is what is used in the connection string.
> The current solution includes a lot of manipulation of datatables
> which are then bound to ASP.NET datagrids.
> My thought was to create a web service that would serve as an RS Data
> Extension, but I'm just taking a first look at this and don't know how
> practical it would be. The idea is that the data retrieval and
> manipulation logic could be in the web service, which would return a
> dataset (or whatever).
> The solution would have to include drilling down / linking to other
> reports, so the userid and password would have to be maintained behind
> the scenes so they could be passed, along with other parameters, to
> the web service for each report/subreport.
> Any thoughts are welcome.
> TIA,
> Jim