Showing posts with label run. Show all posts
Showing posts with label run. Show all posts

Thursday, March 29, 2012

Auto export to Excel

Is there a way to export directly to an excel .csv file when the report is run without having to preview the report first and then click the export icon?

I want to be able to schedule a report to run and have it go directly to an excel .csv file.

You can use the file delivery subscription. This allows you to automaticly create a csv file at a UNC path.

See http://msdn2.microsoft.com/en-us/library/ms157386.aspx for more information.

|||You can specify the export format using the URL access syntax. Have a look in the BOL, there are some samples for that listed.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

I cannot get to the property tab. It's greyed out. Only the location shows.

|||Alright I found it. It's all done on the server side. I was on the client side.

Auto export to Excel

Is there a way to export directly to an excel .csv file when the report is run without having to preview the report first and then click the export icon?

I want to be able to schedule a report to run and have it go directly to an excel .csv file.

You can use the file delivery subscription. This allows you to automaticly create a csv file at a UNC path.

See http://msdn2.microsoft.com/en-us/library/ms157386.aspx for more information.

|||You can specify the export format using the URL access syntax. Have a look in the BOL, there are some samples for that listed.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

I cannot get to the property tab. It's greyed out. Only the location shows.

|||Alright I found it. It's all done on the server side. I was on the client side.

auto expanding Temp DB to fit large requests

I have run into a glitch in SQL 2000's ability to automatically expand the temp db when temp tables become very large.

In our business it is sometimes required that I alter a customer's configuration data without modifying any of their transaction data. This requires a rather complex procedure that creates a script of insert/update/delete statements that, when run on a customer's database, modifies their configuration to a replica of our in-house test environment.

While creating this script, sometimes a few lines are dropped. The real problem is that we have no error or indication that the script had dropped lines until we attempt to run it (which is usually on-site in a live environment.) Our solution is to manually increase the size of the temp db and it's transaction log. After we do this, the script is always created correctly.

This appears to be a bug in the ability for the temp db to auto expand. Is this fixed in SQL 2005?

Various tempdb defects have been fixed in SQL Server 2005. In addition there is a new feature allowing the "automatic space growth" without zeroing pages (makes auto growth much faster).
Without going into more details I expect that your problem will be fixed
SQL Server CTP15.
Please install the CTP15 release and test it. In addition I suggest to contact
MS-CSS (SQL Server 2000 Customer Service) and report your problem for SQL Server 2000

Please let me know the test results for SQL Server 2005 CTP15
Thanks
Mirek

Tuesday, March 27, 2012

auto backup jobs wont run - not in single user mode

Hello!
I am trying to get a SQL server that was configured by someone else up
and running the backup and maintainance jobs from within SQL server
2000. when the job runs it backs up all but 3 of the databases, the 3
it doesnt is our ASDB (our arcserv) database, master and model.
the error that shows for the asdb database is ..
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
The one that shows for the others is this...
12] Database master: Check Data and Index Linkage...
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Repair statement not processed.
Database needs to be in single user mode.
The following errors were found:
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
[13] Database model: Check Data and Index Linkage...
** Execution Time: 0 hrs, 0 mins, 1 secs **
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Database state cannot be changed
while other users are using the database 'msdb'
[Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE
statement failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption command
failed.
[14] Database msdb: Check Data and Index Linkage...
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Repair statement not processed.
Database needs to be in single user mode.
The following errors were found:
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
Can anyone advise me on how to resolve this issue?
Thanks in advance!
/ehrenWingnut wrote:
> Hello!
> I am trying to get a SQL server that was configured by someone else up
> and running the backup and maintainance jobs from within SQL server
> 2000. when the job runs it backs up all but 3 of the databases, the 3
> it doesnt is our ASDB (our arcserv) database, master and model.
> the error that shows for the asdb database is ..
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> The one that shows for the others is this...
>
> 12] Database master: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Repair statement not processed.
> Database needs to be in single user mode.
> The following errors were found:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [13] Database model: Check Data and Index Linkage...
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Database state cannot be changed
> while other users are using the database 'msdb'
> [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE
> statement failed.
> [Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption command
> failed.
> [14] Database msdb: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Repair statement not processed.
> Database needs to be in single user mode.
> The following errors were found:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> Can anyone advise me on how to resolve this issue?
> Thanks in advance!
> /ehren
>
In your maintenance plan, turn off the "repair problems" option...
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks, I will give that a try.
On Jan 29, 9:38 am, Tracy McKibben <t...@.realsqlguy.com> wrote:
> Wingnut wrote:
> > Hello!
> > I am trying to get a SQL server that was configured by someone else up
> > and running the backup and maintainance jobs from within SQL server
> > 2000. when the job runs it backs up all but 3 of the databases, the 3
> > it doesnt is our ASDB (our arcserv) database, master and model.
> > the error that shows for the asdb database is ..
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> > processed. Database needs to be in single user mode.
> > ** Execution Time: 0 hrs, 0 mins, 1 secs **
> > The one that shows for the others is this...
> > 12] Database master: Check Data and Index Linkage...
> > [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
> > [ODBC SQL Server Driver][SQL Server]Repair statement not processed.
> > Database needs to be in single user mode.
> > The following errors were found:
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> > processed. Database needs to be in single user mode.
> > ** Execution Time: 0 hrs, 0 mins, 1 secs **
> > [13] Database model: Check Data and Index Linkage...
> > ** Execution Time: 0 hrs, 0 mins, 1 secs **
> > [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft]
> > [ODBC SQL Server Driver][SQL Server]Database state cannot be changed
> > while other users are using the database 'msdb'
> > [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE
> > statement failed.
> > [Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption command
> > failed.
> > [14] Database msdb: Check Data and Index Linkage...
> > [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
> > [ODBC SQL Server Driver][SQL Server]Repair statement not processed.
> > Database needs to be in single user mode.
> > The following errors were found:
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> > processed. Database needs to be in single user mode.
> > ** Execution Time: 0 hrs, 0 mins, 1 secs **
> > Can anyone advise me on how to resolve this issue?
> > Thanks in advance!
> > /ehrenIn your maintenance plan, turn off the "repair problems" option...
> --
> Tracy McKibben
> MCDBAhttp://www.realsqlguy.com- Hide quoted text -- Show quoted text -

auto backup jobs wont run - not in single user mode

Hello!
I am trying to get a SQL server that was configured by someone else up
and running the backup and maintainance jobs from within SQL server
2000. when the job runs it backs up all but 3 of the databases, the 3
it doesnt is our ASDB (our arcserv) database, master and model.
the error that shows for the asdb database is ..
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
The one that shows for the others is this...
12] Database master: Check Data and Index Linkage...
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Repair statement not processed.
Database needs to be in single user mode.
The following errors were found:
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
[13] Database model: Check Data and Index Linkage...
** Execution Time: 0 hrs, 0 mins, 1 secs **
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Database state cannot be changed
while other users are using the database 'msdb'
[Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE
statement failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption command
failed.
[14] Database msdb: Check Data and Index Linkage...
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Repair statement not processed.
Database needs to be in single user mode.
The following errors were found:
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
Can anyone advise me on how to resolve this issue?
Thanks in advance!
/ehren
Wingnut wrote:
> Hello!
> I am trying to get a SQL server that was configured by someone else up
> and running the backup and maintainance jobs from within SQL server
> 2000. when the job runs it backs up all but 3 of the databases, the 3
> it doesnt is our ASDB (our arcserv) database, master and model.
> the error that shows for the asdb database is ..
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> The one that shows for the others is this...
>
> 12] Database master: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Repair statement not processed.
> Database needs to be in single user mode.
> The following errors were found:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [13] Database model: Check Data and Index Linkage...
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Database state cannot be changed
> while other users are using the database 'msdb'
> [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE
> statement failed.
> [Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption command
> failed.
> [14] Database msdb: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Repair statement not processed.
> Database needs to be in single user mode.
> The following errors were found:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> Can anyone advise me on how to resolve this issue?
> Thanks in advance!
> /ehren
>
In your maintenance plan, turn off the "repair problems" option...
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||Thanks, I will give that a try.
On Jan 29, 9:38 am, Tracy McKibben <t...@.realsqlguy.com> wrote:
> Wingnut wrote:
>
>
>
>
>
>
>
> --
> Tracy McKibben
> MCDBAhttp://www.realsqlguy.com- Hide quoted text -- Show quoted text -
sql

auto backup jobs wont run - not in single user mode

Hello!
I am trying to get a SQL server that was configured by someone else up
and running the backup and maintainance jobs from within SQL server
2000. when the job runs it backs up all but 3 of the databases, the 3
it doesnt is our ASDB (our arcserv) database, master and model.
the error that shows for the asdb database is ..
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement
not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
The one that shows for the others is this...
12] Database master: Check Data and Index Linkage...
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Repair statement not processed.
Database needs to be in single user mode.
The following errors were found:
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement
not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
[13] Database model: Check Data and Index Linkage...
** Execution Time: 0 hrs, 0 mins, 1 secs **
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Database state cannot be changed
while other users are using the database 'msdb'
[Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE
statement failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption comma
nd
failed.
[14] Database msdb: Check Data and Index Linkage...
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
[ODBC SQL Server Driver][SQL Server]Repair statement not processed.
Database needs to be in single user mode.
The following errors were found:
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement
not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
Can anyone advise me on how to resolve this issue?
Thanks in advance!
/ehrenWingnut wrote:
> Hello!
> I am trying to get a SQL server that was configured by someone else up
> and running the backup and maintainance jobs from within SQL server
> 2000. when the job runs it backs up all but 3 of the databases, the 3
> it doesnt is our ASDB (our arcserv) database, master and model.
> the error that shows for the asdb database is ..
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statemen
t not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> The one that shows for the others is this...
>
> 12] Database master: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Repair statement not processed
.
> Database needs to be in single user mode.
> The following errors were found:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statemen
t not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [13] Database model: Check Data and Index Linkage...
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Database state cannot be chang
ed
> while other users are using the database 'msdb'
> [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE
> statement failed.
> [Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption com
mand
> failed.
> [14] Database msdb: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft]
> [ODBC SQL Server Driver][SQL Server]Repair statement not processed
.
> Database needs to be in single user mode.
> The following errors were found:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statemen
t not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> Can anyone advise me on how to resolve this issue?
> Thanks in advance!
> /ehren
>
In your maintenance plan, turn off the "repair problems" option...
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks, I will give that a try.
On Jan 29, 9:38 am, Tracy McKibben <t...@.realsqlguy.com> wrote:
> Wingnut wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Tracy McKibben
> MCDBAhttp://www.realsqlguy.com- Hide quoted text -- Show quoted text -

AuthzInitializeContextFromSid: Win32 error: 58

I get the error AuthzInitializeContextFromSid: Win32 error: 58 when
subscriptions run, one to write to a share and the other is an email.
This was all working just fine until I installed 2k3 sp1.
Anyone have any ideas?
Thanks, Seanhttp://support.microsoft.com/kb/842423/en-us
Because of rendering the report and sending or placing it somewhere, the
Report Server has no more control about the data to be viewed by the
recipient. Therefor the Reporting Service Account has to check wheter the
User has the appropiate permissions. That won´t work with a local service
account, so you have to setup your Service to use a Domain Windows Service
Account.
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Sean" <Sean@.discussions.microsoft.com> schrieb im Newsbeitrag
news:50AE4F7C-86D6-4C08-94E5-5D82970CF789@.microsoft.com...
>I get the error AuthzInitializeContextFromSid: Win32 error: 58 when
> subscriptions run, one to write to a share and the other is an email.
> This was all working just fine until I installed 2k3 sp1.
> Anyone have any ideas?
> Thanks, Sean|||THANKS - for the reply!
As it turns out, it had nothing to do with RS or SQL - it looks like it was
a trust issue. When I applied 2k3 sp1, it must have broke the trust between
my two domains - go figure...
-Sean
--
"Jens Sü�meyer" wrote:
> http://support.microsoft.com/kb/842423/en-us
> Because of rendering the report and sending or placing it somewhere, the
> Report Server has no more control about the data to be viewed by the
> recipient. Therefor the Reporting Service Account has to check wheter the
> User has the appropiate permissions. That won´t work with a local service
> account, so you have to setup your Service to use a Domain Windows Service
> Account.
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Sean" <Sean@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:50AE4F7C-86D6-4C08-94E5-5D82970CF789@.microsoft.com...
> >I get the error AuthzInitializeContextFromSid: Win32 error: 58 when
> > subscriptions run, one to write to a share and the other is an email.
> >
> > This was all working just fine until I installed 2k3 sp1.
> >
> > Anyone have any ideas?
> >
> > Thanks, Sean
>
>

Sunday, March 25, 2012

Authorization

Hi,

How to develop the application will run under user who have permission to view the reports.

When multiple users are accessing reports for example in this case i have 5 users.

could anyone help to me.

regards

kumar

first i have some question are the user in Domain or not if so then you can give each user the privileges on the reports you want on the reporting service

and by code you get the identity of the user in the context and then he will gain the privileges on the reports he can view

this is a great article which explain how you can do this

http://msdn2.microsoft.com/en-us/library/ms159846.aspx


http://msdn2.microsoft.com/en-us/library/ms159778.aspx

sql

author of package affects login?

This is a very frustrating problem.

Let me break it down for the reader.

I have an agent service account that works fine - the account that jobs run under.

I know it works fine because this is the same account all my SQL Backup jobs run under - without a hitch.

I also have a valid sql server account that I use for connection string logins when building packages -

that account works fine. I know it works fine because I can login to the SQL Server Manager with this account.

So, I build a package with the sql server account and password for the OLE DB connection manager in a package. All the package does is a simple query on a table and outputs to a flat file.

I create a job, with 'sa' as the owner. in step 1 I select SSIS package, run as SQL Agent Service Account, package source is file system and I point to the package. The package itself uses the sql server login account to execute.

If I run the package it works fine. I close the solution, someone else comes along and opens the solution - THEY CHANGE ABSOLUTELY NOTHING ABOUT THE LOGIN OR SQL AGENT SERVICE ACCOUNT, but apparently just the fact that they opened the solution and looked at the package, breaks the login. If they try to run the package, they get a login failure, whereas I did not. After they close it, it breaks for me as well. If they open the solution, open the connection manager, re-enter the sql login's password, the package works fine for them, until I come along and open the solution, then it is broken again.

This makes no sense to me. Why would an 'author' opening a solution impact the connection manager when ABOLUTELY NOTHING ABOUT THE CONNECTION MANAGER WAS CHANGED?!

Seems like a bug to me. Anyone seen something like this?

Thanks in advance.

randy

Read up on the package ProtectionLevel property in this forum and in Books-Online.

I'd bet the package is set to EncryptSensitiveWithUserKey, which would prevent others from being able to run the package. You can try EncryptSensitiveWithPassword, but then all developers would need to know the package's password and would be required to enter it to open the package and be able to use it. Either way, Microsoft did not want to be responsible for package security and made sure that the packages are secure.

You could also try DontSaveSensitive, but then you'd have to use a package configuration file to pass in the passwords to the connection managers. It's a touch cumbersome, but in the end it's worth the extra security.|||

Thanks very much. I'll take a look.

Regards

|||

Randyvol,

What you described in your first post is just the normal behavior of SSIS. SSIS does not save sensitive information like connection manager's passwords unless you use an encrypted protection level in your package. If the protection level of the package is set to DonSaveSensitive; then you have to provide the connection credentials every time you open the package. That is what seems to be happening.

As a good practice you can use package configuration to set the connection string of connection managers at run time; that way the package will always get the connection credential when is executed. That will not change the behavior of the package when editing it.

Thursday, March 22, 2012

Authentication on 2003 server

Hi
I've installed 2003 server and RS with no problems. Also got Sharepoint
Services to run 100%. The only issue is that every time i click on a report a
username, password dialog appears. On XP this didn't happen. Everything is on
NT integrated security and my account is part of the admins group. Any ideas ?Does you Windows 2003 box belong to your login domain?
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], 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/
---
"Markus" <Markus@.discussions.microsoft.com> wrote in message
news:F0BD2F13-3140-403D-B823-FAA6E5CFD7C8@.microsoft.com...
> Hi
> I've installed 2003 server and RS with no problems. Also got Sharepoint
> Services to run 100%. The only issue is that every time i click on a
report a
> username, password dialog appears. On XP this didn't happen. Everything is
on
> NT integrated security and my account is part of the admins group. Any
ideas ?

Authentication mode / configuration issue

I'm having a little issue here with the MSSQLServer service which installs as part of the BlackBerry Enterprise Server. I can connect to it and run queries on it via Query Analyzer, but when I attempt to have a PHP script query against it, I get an error stating that the login failed because the user is not associated with a trusted SQL connection (severity 14). I've seen this before with other servers, and it was always a result of the server not being in mixed authentication mode.

So the question is this: How do I change it? There doesn't appear to be an Enterprise Manager or anything equivalent installed. Digging through the SQL Server folder, the only thing I saw that might have been useful is the SQL Server Network Utility located at Program Files\Microsoft SQL Server\80\Tools\Binn\SVRNETCN.EXE. This utility appears to only let me disable/enable protocols however, nothing about authentication.

I checked the Service Manager as well and didn't see anything of use there. Any ideas how I can do this?

It looks like I might have figured this one out. Using a copy of Enterprise Manager that I had installed on my machine, I added the MSSQL server installed on the BlackBerry server and changed its authentication properties that way. It looks like I'll have to tweak with some permissions for the individual databases but I think I've got it now.

Authentication methods for connections to SQL Server in ASP Pages

I am trying to access SQL Server via an ASP page using a Trusted Connection,
but it is not working. When I run the page I receive the following error
message:
Microsoft OLE DB Service Components error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.
line 35
My connection string is in a separate file: cst = "data
source=X099789\Widgets;Initial Catalog=Automotive; Integrated Security=SSPI;
"
My code snipet looks like the following:
set OBJRST = Server.CreateObject("ADODB.Recordset")
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = cst '****LIne 35
MotorsSQL = "usp_MotorAll"
UIPWSQL = "usp_UIPW '" & struserid &"', '"& strpassword &"';"
objConnAll.open cst
What is the correct coding to connect to the SQL Server using Windows
Authentication in an ASP page?
I have read the instructions on:
http://support.microsoft.com/default.aspx/kb/247931, made the changes,
however the page still will not work.
Kindly assist. I will be thankful.
AuntieAuntieAuntie> Microsoft OLE DB Service Components error '80040e21'
> Multiple-step OLE DB operation generated errors. Check each OLE DB status
> value, if available. No work was done.
These errors are probably because there is no 'Provider' keyword in your
OLEDB connection string. Try adding 'Provider=SQLOLEDB'.
Hope this helps.
Dan Guzman
SQL Server MVP
"AuntieAuntieAuntie" <AuntieAuntieAuntie@.discussions.microsoft.com> wrote in
message news:EE4C5259-1F64-4893-9AF1-657A1C03917B@.microsoft.com...
>I am trying to access SQL Server via an ASP page using a Trusted
>Connection,
> but it is not working. When I run the page I receive the following error
> message:
> Microsoft OLE DB Service Components error '80040e21'
> Multiple-step OLE DB operation generated errors. Check each OLE DB status
> value, if available. No work was done.
> line 35
> My connection string is in a separate file: cst = "data
> source=X099789\Widgets;Initial Catalog=Automotive; Integrated
> Security=SSPI;"
> My code snipet looks like the following:
> set OBJRST = Server.CreateObject("ADODB.Recordset")
> Set objComm = Server.CreateObject("ADODB.Command")
> objComm.ActiveConnection = cst '****LIne 35
> MotorsSQL = "usp_MotorAll"
> UIPWSQL = "usp_UIPW '" & struserid &"', '"& strpassword &"';"
> objConnAll.open cst
> What is the correct coding to connect to the SQL Server using Windows
> Authentication in an ASP page?
> I have read the instructions on:
> http://support.microsoft.com/default.aspx/kb/247931, made the changes,
> however the page still will not work.
> Kindly assist. I will be thankful.
> AuntieAuntieAuntie
>

authentication issues, security groups

Hi,

Apologies for not knowing much around this subject, we currently run sql
server 2000 for a database and have each user marked up on the database.
We are moving to use a windows security group, so taking the
management slightly away from the database server.

What I would like to know is, will this effect functions such as
suser_sname() by returning the group name instead of user id? I would
assume not but it's worth checking!

Also, I'm guessing if a user is marked on the database as their own id
and as part of a security group, then all permissions are thrown in with
deny taking preference? How does this work with a database owner who is
also part of a security group that has limiting functionality?

Thanks for your help,
ChrisSUSER_SNAME() or SYSTEM_USER will return a user's individual Windows
account name, even if server access has been granted via group
membership. You can use IS_MEMBER() to check membership of a Windows
group if necessary.

Permissions work more or less like most other Windows permissions -
they are cumulative, but DENY overrides everything else. Check out
"Managing Security" in Books Online, and this white paper:

http://www.microsoft.com/technet/pr...n/sp3sec00.mspx

Simon

Tuesday, March 20, 2012

Authentication Extension: SoapException: Null Reference

Okay, I thought I almost had this security extension licked, but now I've run
into this and I don't know where to begin looking.
When I call LogonUser() from my UILogon.aspx, I'm getting this:
System.Web.Services.Protocols.SoapException: Server was unable to process
request. --> Object reference not set to an instance of an object. at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
Microsoft.SqlServer.ReportingServices.ReportingService.LogonUser(String
userName, String password, String authority) in
c:\dotnet\UserDirectoryWeb\RSSecurityExtension\ReportingService.cs:line 2301
at TBI.UserDirectory.RSSecurityExtension.UILogon.BtnLogon_Click(Object
sender, EventArgs e) in
c:\dotnet\userdirectoryweb\rssecurityextension\uilogon.aspx.cs:line 96
Some descriptions:
ReportingServices.cs is the same one provided with the FormsAuth example.
I checked out the properties unique to SoapException while debugging; there
is nothing of note there (e.g., Actor == "").
My "variation" on the FormsAuth also has ReportManager using Forms
authentication, because it makes managing my single logon mechanism easier.
Could this difference be causing the error?
Finally, I'm quite sure it isn't my custom LogonUser() that's throwing the
error; even a trivial version ("return true;") has this issue. In fact,
since in debug it never breaks at the breakpoint I set, I'm not entirely sure
that it is even being called (it would be underneath the ASP.NET worker
process, would it not?)
This is especially frustrating, since I'm not even sure where to begin
debugging this one. Any suggestions of how I might even begin tracking the
error down would be appreciated.
Thanks,
-MarcWhen debugging, you have to do two things:
1) Copy the Custom Security dll's into the Report Manager\Bin folder and
Report Server\bin folder.
2) Attach to the process aspnet_wp.exe using Debug > Processes...
Cheers,
--
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Marc Lewandowski" <MarcLewandowski@.discussions.microsoft.com> wrote in
message news:0376DE5D-EA59-48EF-B2C0-655AEBA9EFF4@.microsoft.com...
> Okay, I thought I almost had this security extension licked, but now I've
> run
> into this and I don't know where to begin looking.
> When I call LogonUser() from my UILogon.aspx, I'm getting this:
> System.Web.Services.Protocols.SoapException: Server was unable to process
> request. --> Object reference not set to an instance of an object. at
> System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
> message, WebResponse response, Stream responseStream, Boolean asyncCall)
> at
> System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> methodName, Object[] parameters) at
> Microsoft.SqlServer.ReportingServices.ReportingService.LogonUser(String
> userName, String password, String authority) in
> c:\dotnet\UserDirectoryWeb\RSSecurityExtension\ReportingService.cs:line
> 2301
> at TBI.UserDirectory.RSSecurityExtension.UILogon.BtnLogon_Click(Object
> sender, EventArgs e) in
> c:\dotnet\userdirectoryweb\rssecurityextension\uilogon.aspx.cs:line 96
> Some descriptions:
> ReportingServices.cs is the same one provided with the FormsAuth example.
> I checked out the properties unique to SoapException while debugging;
> there
> is nothing of note there (e.g., Actor == "").
> My "variation" on the FormsAuth also has ReportManager using Forms
> authentication, because it makes managing my single logon mechanism
> easier.
> Could this difference be causing the error?
> Finally, I'm quite sure it isn't my custom LogonUser() that's throwing the
> error; even a trivial version ("return true;") has this issue. In fact,
> since in debug it never breaks at the breakpoint I set, I'm not entirely
> sure
> that it is even being called (it would be underneath the ASP.NET worker
> process, would it not?)
> This is especially frustrating, since I'm not even sure where to begin
> debugging this one. Any suggestions of how I might even begin tracking
> the
> error down would be appreciated.
> Thanks,
> -Marc

Authentication errors after backing out changes for forms authentication

We attempted to run the custom authentication sample from the RS
samples. We had issues and attempted to "back out" our changes - being
stupid, we didn't back up our config files. "How hard could it be?"
Well, 8 hours later, we're out of answers as to why we can't run RS
anymore. Yes, learn from our mistake.
We're hoping someone can help us with the following.
When going to http://localhost/Reports, I get the following:
System.Web.Services.Protocols.SoapException: Server was unable to
process request. --> System.NullReferenceException: Object reference
not set to an instance of an object. at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetExtensionConfigurationInfo(String
extensionType, String extensionName) at
Microsoft.ReportingServices.Diagnostics.AuthenticationExtensionFactory.get_AuthenticationExtension()
at Microsoft.ReportingServices.WebServer.ReportingService2005..ctor()
-- End of inner exception stack trace --
When going to http://localhost/ReportServer, I get a 404.
The log file ReportServerWebApp__01_17_2006_15_33_40 contains the
following stack dump:
'
aspnet_wp!ui!1!1/17/2006-15:34:06:: e ERROR:
System.Web.Services.Protocols.SoapException: Server was unable to
process request. --> System.NullReferenceException: Object reference
not set to an instance of an object.
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetExtensionConfigurationInfo(String
extensionType, String extensionName)
at
Microsoft.ReportingServices.Diagnostics.AuthenticationExtensionFactory.get_AuthenticationExtension()
at
Microsoft.ReportingServices.WebServer.ReportingService2005..ctor()
-- End of inner exception stack trace --
aspnet_wp!ui!1!1/17/2006-15:34:06:: e ERROR: HTTP status code --> 500
--Details--
System.Web.Services.Protocols.SoapException:
System.Web.Services.Protocols.SoapException: Server was unable to
process request. --> System.NullReferenceException: Object reference
not set to an instance of an object.
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetExtensionConfigurationInfo(String
extensionType, String extensionName)
at
Microsoft.ReportingServices.Diagnostics.AuthenticationExtensionFactory.get_AuthenticationExtension()
at
Microsoft.ReportingServices.WebServer.ReportingService2005..ctor()
-- End of inner exception stack trace --
at
Microsoft.SqlServer.ReportingServices2005.RSConnection.GetSecureMethods()
at
Microsoft.ReportingServices.UI.Global.RSWebServiceWrapper.GetSecureMethods()
at
Microsoft.SqlServer.ReportingServices2005.RSConnection.IsSecureMethod(String
methodname)
at
Microsoft.SqlServer.ReportingServices2005.RSConnection.ValidateConnection()
at
Microsoft.ReportingServices.UI.ReportingPage.EnsureHttpsLevel(HttpsLevel
level)
at
Microsoft.ReportingServices.UI.ReportingPage.ReportingPage_Init(Object
sender, EventArgs args)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Page.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
aspnet_wp!ui!1!1/17/2006-15:34:06:: e ERROR: Exception in
ShowErrorPage: System.Threading.ThreadAbortException: Thread was being
aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm)
at Microsoft.ReportingServices.UI.ReportingPage.ShowErrorPage(String
errMsg) at at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm)
at Microsoft.ReportingServices.UI.ReportingPage.ShowErrorPage(String
errMsg)
I confirmed that the rsreportserver.config section that deals with
security/authentication looks as follows - this matches another server
whose RS is working:
<Security>
<Extension Name="Windows"
Type="Microsoft.ReportingServices.Authorization.WindowsAuthorization,Microsoft.ReportingServices.Authorization"/>
</Security>
<Authentication>
<Extension Name="Windows"
Type="Microsoft.ReportingServices.Authentication.WindowsAuthentication,Microsoft.ReportingServices.Authorization"/>
</Authentication>
And the web.configs in both ReportManager and ReportServer folders
reference the correct authentication extension:
Report Manager web.config:
<authentication mode="Windows" />
<identity impersonate="true" />
Report Server web.config:
<authentication mode="Windows" />
<identity impersonate="true" />
At this point, I'm considering spinning up a second instance of RS to
see if there's something more basic broken, but I thought I would ask
for any help/pointers on this.
Thank you!
MichaelSJust a followup, in case a search finds this topic. We never did solve
the problem. We ended up completely removing SQL/RS and reinstalling.
Our suspicion is that something was inadvertently deleted. Since this
was a dev box, it's assumed that a trashing every so often is
acceptable.
MS|||In our case, the pieces that disappeared were three files from
C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting
Services\ReportServer. Specifically:
global.asax, ModelGenerationRules.smgl, and ReportExecution2005.asmx.
Replacing those files (from a working installation) solved the problem.

Authentication errors after backing out changes for forms authentication

We attempted to run the custom authentication sample from the RS samples. We had issues and attempted to "back out" our changes - being stupid, we didn't back up our config files. "How hard could it be?" Well, 8 hours later, we're out of answers as to why we can't run RS anymore. Yes, learn from our mistake.

We're hoping someone can help us with the following.


When going to http://localhost/Reports, I get the following:

System.Web.Services.Protocols.SoapException: Server was unable to process request. > System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetExtensionConfigurationInfo(String extensionType, String extensionName) at Microsoft.ReportingServices.Diagnostics.AuthenticationExtensionFactory.get_AuthenticationExtension() at Microsoft.ReportingServices.WebServer.ReportingService2005..ctor() End of inner exception stack trace


When going to http://localhost/ReportServer, I get a 404.


The log file ReportServerWebApp__01_17_2006_15_33_40 contains the following stack dump:
'
aspnet_wp!ui!1!1/17/2006-15:34:06:: e ERROR: System.Web.Services.Protocols.SoapException: Server was unable to process request. > System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetExtensionConfigurationInfo(String extensionType, String extensionName)
at Microsoft.ReportingServices.Diagnostics.AuthenticationExtensionFactory.get_AuthenticationExtension()
at Microsoft.ReportingServices.WebServer.ReportingService2005..ctor()
End of inner exception stack trace
aspnet_wp!ui!1!1/17/2006-15:34:06:: e ERROR: HTTP status code --> 500
-Details--
System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. > System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetExtensionConfigurationInfo(String extensionType, String extensionName)
at Microsoft.ReportingServices.Diagnostics.AuthenticationExtensionFactory.get_AuthenticationExtension()
at Microsoft.ReportingServices.WebServer.ReportingService2005..ctor()
End of inner exception stack trace

at Microsoft.SqlServer.ReportingServices2005.RSConnection.GetSecureMethods()

at Microsoft.ReportingServices.UI.Global.RSWebServiceWrapper.GetSecureMethods()

at Microsoft.SqlServer.ReportingServices2005.RSConnection.IsSecureMethod(String methodname)

at Microsoft.SqlServer.ReportingServices2005.RSConnection.ValidateConnection()

at Microsoft.ReportingServices.UI.ReportingPage.EnsureHttpsLevel(HttpsLevel level)

at Microsoft.ReportingServices.UI.ReportingPage.ReportingPage_Init(Object sender, EventArgs args)

at System.EventHandler.Invoke(Object sender, EventArgs e)

at System.Web.UI.Control.OnInit(EventArgs e)

at System.Web.UI.Page.OnInit(EventArgs e)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
aspnet_wp!ui!1!1/17/2006-15:34:06:: e ERROR: Exception in ShowErrorPage: System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm)
at Microsoft.ReportingServices.UI.ReportingPage.ShowErrorPage(String errMsg) at at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm)
at Microsoft.ReportingServices.UI.ReportingPage.ShowErrorPage(String errMsg)

I confirmed that the rsreportserver.config section that deals with security/authentication looks as follows - this matches another server whose RS is working:

<Security>
<Extension Name="Windows" Type="Microsoft.ReportingServices.Authorization.WindowsAuthorization,Microsoft.ReportingServices.Authorization"/>
</Security>
<Authentication>
<Extension Name="Windows" Type="Microsoft.ReportingServices.Authentication.WindowsAuthentication,Microsoft.ReportingServices.Authorization"/>
</Authentication>


And the web.configs in both ReportManager and ReportServer folders reference the correct authentication extension:

Report Manager web.config:
<authentication mode="Windows" />
<identity impersonate="true" />

Report Server web.config:
<authentication mode="Windows" />
<identity impersonate="true" />


At this point, I'm considering spinning up a second instance of RS to see if there's something more basic broken, but I thought I would ask for any help/pointers on this.

Thank you!

Michael Shorten

Just as a followup, in case someone else searches for this problem and finds my post - we never solved it. We recovered the config files to what they were supposed to be, but things never still worked. We now believe that we somehow deleted a file(s) - given the error message, that seems plausible. We ended up having to completely removed SQL Server and RS from our system, physically deleting the MSSQL and MSSQLRS directories and reinstalling. This time, we backed everything up before working on it and of course, it worked.

Michael S

sql

Authentication error in SQL Mobile

Hi ,

I was trying to run my application that has to Synchronize data between sql mobile and sql 2005. In the emulator all is fine and executes without any error.But when I deploy the application in real device it throws an exception:"Authentication failed in server running IIS". The device is WM5.0

The connection string is like this.

String strRemote = "Provider=SQLOLEDB;Data Source=servername;User ID=userid;Password=password;Initial Catalog=databasename";

I am getting the exception only when the application is deployed in the device.

The error log in C:inetpub/wwwroot/Sync is the following:

2007/05/25 12:54:29 Hr=00000000 SQLCESA30.DLL loaded 0
2007/05/25 12:54:29 Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1
2007/05/25 12:54:58 Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1
2007/05/25 12:57:00 Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1
2007/05/25 13:00:37 Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1
2007/05/25 14:55:07 Hr=00000000 SQLCESA30.DLL loaded 0
2007/05/25 14:56:10 Thread=1534 RSCB=2 Command=SCHK Hr=80040E2F The statement has been terminated. 3621
2007/05/25 14:56:10 Thread=1534 RSCB=2 Command=SCHK Hr=80040E2F Violation of PRIMARY KEY constraint 'PK_Orders'. Cannot insert duplicate key in object 'dbo.Orders'. 2627
2007/05/25 19:19:20 Hr=00000000 SQLCESA30.DLL loaded 0
2007/05/25 19:19:20 Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1
2007/05/25 19:20:12 Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1
2007/05/25 19:21:27 Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1
2007/05/25 19:21:47 Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1

Please reply....

It seems to be authenticating fine.

It looks like the error is a primary key constraint on the Orders table.

Just a first look,

Adamus

Monday, March 19, 2012

Auotmated Stored Procedure

Hi
Is there is any way to run the stored procedure automatically from master
database on daily at particular time.
Thanks is advance
NizhamYes, create a SQL Server Agent job with a TSQL jobstep which executes the pr
ocedure.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Junkmn" <junkmn@.gmail.com> wrote in message news:%23gwULcLMGHA.3460@.TK2MSFTNGP15.phx.gbl..
.
> Hi
> Is there is any way to run the stored procedure automatically from master
> database on daily at particular time.
> Thanks is advance
> Nizham
>|||Yes. Create a job and schedule it to run at a specific time. From EM, you
can do this by using the Jobs node under Management. ( Make sure the SQL
Agent service is enabled & started )
Anith|||Thanks Tibor Karaszi
I hope you are expert on that If possible will you please send me the sample
code to run the stored procedure sp_XYZ to be run at 1.00 am
Regards
Nizham
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:ugXXSfLMGHA.1832@.TK2MSFTNGP11.phx.gbl...
> Yes, create a SQL Server Agent job with a TSQL jobstep which executes the
> procedure.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Junkmn" <junkmn@.gmail.com> wrote in message
> news:%23gwULcLMGHA.3460@.TK2MSFTNGP15.phx.gbl...|||It's much easier to use the GUI than to write the code for you. Have a look
at SQL Server Agent topics in Books Online. You can also see a brief
example here:
http://www.aspfaq.com/2403
"Junkmn" <junkmn@.gmail.com> wrote in message
news:O03vlkLMGHA.668@.TK2MSFTNGP11.phx.gbl...
> Thanks Tibor Karaszi
> I hope you are expert on that If possible will you please send me the
> sample code to run the stored procedure sp_XYZ to be run at 1.00 am
> Regards
> Nizham
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in message news:ugXXSfLMGHA.1832@.TK2MSFTNGP11.phx.gbl...
>

Thursday, March 8, 2012

Auditing a SQL user's Login activity

I have a database on my SQL 2000 server called Test. I have a SQL user accou
nt called Bob. I am trying to run a query against the Test database to see w
hen the last time Bob accessed the database. I did a google search and came
up with the following:
select UserName, LastLoggedIn = max(LoggedIn)
from {InsertYourTableName}
group by UserName
order by UserName
This seems to be at the Table level, not the database level. So then I tried
running SQL profiler, but before I waste too much time on Profiler, I was h
oping that someone could point in the right direction. Thanks.It appears that you would run the query after collecting the data using SQL
Profiler.
SQL Profiler can be configured to put the data it captures in a SQL table.
So, this sample code appears
to query the table.
This is not a query on the System tables. We don't capture this info by
default.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Wednesday, March 7, 2012

Audit log in 3-tiered applicaiton

In the past, a user would run a Windows application that connected
directly to the database. When that user made changes, we used a
trigger to log those changes to a separate table. We used Current_User
to record who made the changes, Current_TimeStamp to record when and
values out of the inserted or deleted table(s) to record what was
changed. Easy enough.
How can we create a log of changes in a 3-tiered windows application?
The user never touches the database. The account that executes the
middle tier is the same for every user. The GUI (vb.net) can easily
determine the Windows ID of the application user. The GUI already
passes that ID to the middle tier for security reasons. But then what?
Every idea I come up with involves calling stored procs from either the
middle tier or from the application's stored procs. That seems like a
lot of work and triggers were so easy for this task.
Any ideas are appreciated.
Tom the lazy programmer.
E-mail correspondence to and from this address may be subject to the
North Carolina Public Records Law and may be disclosed to third parties.Does the database not record what logged-in user (logged into the
application, not the database) is making changes? If not, why not? It
seems like it would make sense to record that anyway -- and this would
enable your trigger solution to work once again... Or am I missing
something?
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Tom Williams" <Tom.Williams@.NOSPAMncmail.net> wrote in message
news:e2PbWjkLFHA.1308@.tk2msftngp13.phx.gbl...
> In the past, a user would run a Windows application that connected
> directly to the database. When that user made changes, we used a
> trigger to log those changes to a separate table. We used Current_User
> to record who made the changes, Current_TimeStamp to record when and
> values out of the inserted or deleted table(s) to record what was
> changed. Easy enough.
> How can we create a log of changes in a 3-tiered windows application?
> The user never touches the database. The account that executes the
> middle tier is the same for every user. The GUI (vb.net) can easily
> determine the Windows ID of the application user. The GUI already
> passes that ID to the middle tier for security reasons. But then what?
> Every idea I come up with involves calling stored procs from either the
> middle tier or from the application's stored procs. That seems like a
> lot of work and triggers were so easy for this task.
> Any ideas are appreciated.
> Tom the lazy programmer.
>
> --
> E-mail correspondence to and from this address may be subject to the
> North Carolina Public Records Law and may be disclosed to third parties.
>|||Please pardon my ignorance, but I'm .
Our users log into a Windows domain and would then execute the Windows
application(GUI). I don't know what you mean by "logged into the
application". The application does not have it's own user IDs and
passwords. Our users have too many of those already. If they've
already logged into Windows, that's good enough for me. The GUI will
make function calls to the middle tier which will then access the
database.
Are you saying that there is a function in the database that can return
which Windows user called the middle tier function?
thanks
Tom
Adam Machanic wrote:

>Does the database not record what logged-in user (logged into the
>application, not the database) is making changes? If not, why not? It
>seems like it would make sense to record that anyway -- and this would
>enable your trigger solution to work once again... Or am I missing
>something?
>
>
"Tom Williams" <Tom.Williams@.NOSPAMncmail.net> wrote in message
news:e2PbWjkLFHA.1308@.tk2msftngp13.phx.gbl...

> In the past, a user would run a Windows application that connected
> directly to the database. When that user made changes, we used a
> trigger to log those changes to a separate table. We used Current_User
> to record who made the changes, Current_TimeStamp to record when and
> values out of the inserted or deleted table(s) to record what was
> changed. Easy enough.
> How can we create a log of changes in a 3-tiered windows application?
> The user never touches the database. The account that executes the
> middle tier is the same for every user. The GUI (vb.net) can easily
> determine the Windows ID of the application user. The GUI already
> passes that ID to the middle tier for security reasons. But then what?
> Every idea I come up with involves calling stored procs from either the
> middle tier or from the application's stored procs. That seems like a
> lot of work and triggers were so easy for this task.
> Any ideas are appreciated.
> Tom the lazy programmer.
>
>
E-mail correspondence to and from this address may be subject to the
North Carolina Public Records Law and may be disclosed to third parties.|||No; I made the assumption that your application required credentails or a
login of some sort -- which apparently it does (domain authentication). So
the question is, can the front-end pass the logged-in users' name to the
middle tier, which will then pass it into the database? And can a UserName
column be added to each table that the database manipulates, such that the
trigger once again becomes a viable option?
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Tom Williams" <Tom.Williams@.NOSPAMncmail.net> wrote in message
news:%23gmx8dlLFHA.436@.TK2MSFTNGP09.phx.gbl...
> Please pardon my ignorance, but I'm .
> Our users log into a Windows domain and would then execute the Windows
> application(GUI). I don't know what you mean by "logged into the
> application". The application does not have it's own user IDs and
> passwords. Our users have too many of those already. If they've
> already logged into Windows, that's good enough for me. The GUI will
> make function calls to the middle tier which will then access the
> database.
> Are you saying that there is a function in the database that can return
> which Windows user called the middle tier function?
> thanks
> Tom
>|||Oh, I see!
I'll have to think about whether we want to add that column or not.
Thanks for the suggestion.
Tom
Adam Machanic wrote:

>No; I made the assumption that your application required credentails or a
>login of some sort -- which apparently it does (domain authentication). So
>the question is, can the front-end pass the logged-in users' name to the
>middle tier, which will then pass it into the database? And can a UserName
>column be added to each table that the database manipulates, such that the
>trigger once again becomes a viable option?
>
>
E-mail correspondence to and from this address may be subject to the
North Carolina Public Records Law and may be disclosed to third parties.|||Tom Williams wrote:
> In the past, a user would run a Windows application that connected
> directly to the database. When that user made changes, we used a
> trigger to log those changes to a separate table. We used Current_User
> to record who made the changes, Current_TimeStamp to record when and
> values out of the inserted or deleted table(s) to record what was
> changed. Easy enough.
> How can we create a log of changes in a 3-tiered windows application?
> The user never touches the database. The account that executes the
> middle tier is the same for every user. The GUI (vb.net) can easily
> determine the Windows ID of the application user. The GUI already
> passes that ID to the middle tier for security reasons. But then what?
Store the ID using SET CONTEXT_INFO, then have the triggers read that
back and write it in your audit trail. See BOL for SET CONTEXT_INFO.
Steve Troxell
http://www.omniaudit.com