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

Wednesday, March 28, 2012

login failed for user after moving app to web server

My app works fine in development server. After moving to web server, error occured as bellow. Can someone help me? I use vs 2005 and SQL server is windows authentication mode.

Login failed for user 'domain_name\REPORT$'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Login failed for user 'domain_name\REPORT$'.

Source Error:

Line 348:Line 349: If MyTable = Nothing ThenLine 350: MySQLDataAdapter.Fill(MyDataSet)Line 351: ElseLine 352: MySQLDataAdapter.Fill(MyDataSet, MyTable)

Hi,

Are you running your application (web server) on a windows 2003 server ? If yes then you have to add a login withdomain_name\<machine_name>$ and you have to grant access to the operative database to this login. This login weill be a windows account (domain not machine).

Hope it Helps!

Bhaskar!

Login failed for user . The user is not associated with a trusted SQL Server connection.

I have a windows 2003 server hosting MS SQL Server 2005. Another windows 2003 server hosting my App, and clients from the local intranet and outside (web). How do I surpass this problem, when it all works fine locally on my development machine?

Use Forms authentication!

Al

|||

I am using Forms authentication.

<

connectionStrings>

<

addname="memSocConnection"connectionString=" Data Source=WSPASQL01; Initial Catalog=mem_soc;Integrated Security=True"providerName="System.Data.SqlClient" />

<

addname="MySqlRoleManagerConnection"connectionString="Data Source=WSPASQL01;Initial Catalog=mem_soc_core;Integrated Security=True"providerName="System.Data.SqlClient" />

<

addname="MySqlMembershipProviderConnection"connectionString="Data Source=WSPASQL01;Initial Catalog=mem_soc_core;Integrated Security=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<authentication mode="Forms"><formsname="SqlAuthCookie" loginUrl="admin/login.aspx" timeout="10" /> </authentication>

This works fine locally. I am trying to migrate the application onto the servers. As soon as I use the WSPASQL01 server it fails. I have followed the walkthrough from microsoft on using forms authentication and still no progress. I have assigned roles to the login 'aspnet'.

Monday, March 26, 2012

Login failed for user '(null)'. Reason: Not associated with a trusted SQL server....

Hi guys,

I have a problem:

I have a created a vb.net app.

From this vb.net App (in server A) I connect to the SQL server SP4 (in serverA) and to a SQLServer 2000 SP4 in another server (server B).
All connection are with trusted_connection = true. Server A and B are in a domain.

After pressed a button, (when I run the button I am logged as a domain administrator) some store procedures and table are created in SQL server A and B.

During this phase everything is OK, I mean tables and store procs are installed correctly, and Linked server are installed.

The problem is that:at the end of this job a store aprocedure (in server B) is called form which has a sql statement (SQL select ...inner join from table in different sql server A,B),
the vb.net app show an error:

"System.Data.SQLClient.SqlExcemption: Login failed for user '(null)'. Reason: Not associated with a trusted SQL server connection"

Linked server is:

Local Login: domain\administrator
Impersonate: true
RMUser and Pw are null
Selected: Be made using the login's current security context

SQL server is win + SQL auth mode.

and account: System Account

Do you know how to solve the problem.

I tried to modify option in Linked server but is the same.

I replaced the conn string in vb.net with user and pass and everything work.
So, it looks like that using windows account credential used are lost.

Any help will be very appreciated

For .NET related questions, please see the Data Access forum in the .NET group.

Friday, March 23, 2012

login failed for user (null)

Hi
I have .net app got this error below,
Connection failed: sqlstate:28000 sql server error: 18452 login failed for
user(null). reason: not associated with a trusted SQL server connection
Any ideas
thanksYour SQL Server Authenticaton could be Windows Authentication and a user
tries to connect using his\her SQL Server login.
Another possibility, that user might not be a member of your domain and
tries to connect to your SQL Server instance.
Ekrem nsoy
"mecn" <mecn2002@.yahoo.com> wrote in message
news:e45jDthJIHA.3516@.TK2MSFTNGP02.phx.gbl...
> Hi
> I have .net app got this error below,
> Connection failed: sqlstate:28000 sql server error: 18452 login failed for
> user(null). reason: not associated with a trusted SQL server connection
> Any ideas
> thanks
>|||Yeah, he's right. It's trying to connect with a windows acct that doesn't
have rights in the DB. Either give it rights, or switch to sql auth.
"mecn" wrote:

> Hi
> I have .net app got this error below,
> Connection failed: sqlstate:28000 sql server error: 18452 login failed for
> user(null). reason: not associated with a trusted SQL server connection
> Any ideas
> thanks
>
>|||Or the application is trying to connect using Windows Authentication when no
one is logged in, and it doesn't have a user context. I've seen this when
people set it up using Windows Authentication when they are logged in, and
expect it to work when no one is logged in.
--
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sean McCown" <SeanMcCown@.discussions.microsoft.com> wrote in message
news:2EA9BABD-7F69-4758-BD14-A7809FAB6657@.microsoft.com...[vbcol=seagreen]
> Yeah, he's right. It's trying to connect with a windows acct that doesn't
> have rights in the DB. Either give it rights, or switch to sql auth.
>
> "mecn" wrote:
>|||Hmm.. Good point!
Thanks for sharing.
Ekrem ?nsoy
"Rick Byham, (MSFT)" <rickbyh@.REDMOND.CORP.MICROSOFT.COM> wrote in message
news:6E02C41D-1A5E-4A9A-9218-BC5BF1746759@.microsoft.com...
> Or the application is trying to connect using Windows Authentication when
> no one is logged in, and it doesn't have a user context. I've seen this
> when people set it up using Windows Authentication when they are logged
> in, and expect it to work when no one is logged in.
> --
> Rick Byham (MSFT)
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Sean McCown" <SeanMcCown@.discussions.microsoft.com> wrote in message
> news:2EA9BABD-7F69-4758-BD14-A7809FAB6657@.microsoft.com...
>

Wednesday, March 21, 2012

login failed for user -- why?

I have an ASP.NET intranet app in c# accessing a SQL 7 database that used to work before we move to a new Windows 2003 server. Don't know if win2k3 server has anything to do with it.

I run the website for now on my machine, IIS config for the site is no anonymous access, Integrated Windows security only, but it doesn't seem to matter what I use.

We had to change from using a common user id/pw to Integrated security. I run the app in VS2003 studio, and try to connect with this code and string:

WebConfig:
<add key="connectionString" value="Data Source=chchtdev02;Initial Catalog=InsourceMaster;Integrated Security=SSPI" />

cs file:
SqlConnection myConn = new SqlConnection(connStr);
myConn.Open();

The group 'Development Global' of which I am a member has been added to the System Administrator role on the SQL 7 installation on the new server.

I've even added my own network logon alone and tried to use the string
<add key="connectionString" value="Data Source=chchtdev02;Initial Catalog=InsourceMaster;user id=myusername;password=mypassword />

causing basically the same error. Both are included below.

Anyone have any ideas what I'm missing here?

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

Source Error:

Line 229: int i;
Line 230: SqlConnection myConn = new SqlConnection(connStr);
Line 231: myConn.Open();
Line 232: SqlCommand cmd = new SqlCommand();
Line 233: cmd.Connection = myConn;

Source File: c:\inetpub\wwwroot\xmlinsourceedit\xmlinsourceedit .aspx.cs Line: 231

Stack Trace:

[SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
XMLInsourceEdit.XMLInsourceEdit.FillDropDownsFromS ql(String gStatecode, String gBookcode, String gTypecode) in c:\inetpub\wwwroot\xmlinsourceedit\xmlinsourceedit .aspx.cs:231
XMLInsourceEdit.XMLInsourceEdit.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\xmlinsourceedit\xmlinsourceedit .aspx.cs:151
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Login failed for user 'myusername'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'myusername'.

Source Error:

Line 229: int i;
Line 230: SqlConnection myConn = new SqlConnection(connStr);
Line 231: myConn.Open();
Line 232: SqlCommand cmd = new SqlCommand();
Line 233: cmd.Connection = myConn;

Source File: c:\inetpub\wwwroot\xmlinsourceedit\xmlinsourceedit .aspx.cs Line: 231

Stack Trace:

[SqlException: Login failed for user 'myusername'.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
XMLInsourceEdit.XMLInsourceEdit.FillDropDownsFromS ql(String gStatecode, String gBookcode, String gTypecode) in c:\inetpub\wwwroot\xmlinsourceedit\xmlinsourceedit .aspx.cs:231
XMLInsourceEdit.XMLInsourceEdit.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\xmlinsourceedit\xmlinsourceedit .aspx.cs:151
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()I'm still taking my first tentative steps with ASP.NET, so I may be off base here; still, I'll take a stab because I think I ran into something similar recently.

ASP.NET runs under the context of the (localmachine)\ASPNET user account. You will need to add this user to the SQL Logins (sp_grantaccess)in order to use integrated security. If you're SQL server is not local, then you will need to add (localmachine)\ASPNET into a Domain Group and add the Domain Group into SQL Logins.

I know that you indicated that you were running the website with windows authentication. I did the same thing, but for some reason it would not accept my credentials (that was another issue that took some time to resolve).

Also, check out www.connectionstrings.com. They had some good information on connecting with the ASP.NET SQLClient object. I think I had to type the keywords that they gave exactly as given (case sensitive) in order to get anywhere. I realize that doesn't sound right, but it is what worked for me finally.

That's part of the reason I have been so hesitant with ASP.NET; it seems in so many respect to be foreign to me. Sigh, I guess I'm getting too old to learn new tricks.

Good Luck,

hmscott

Monday, March 19, 2012

login failed

I know this is probably a question that has been answered a million times, but it is in regard to SQLEXPRESS. I have built a small ASP 2.0 web app that runs fine on the local production machine when I go to view a gridview or a detailsview to delete or add records. However, when I try the site out on another machine, it runs fine (logins, etc), however when I go to the data page I get an error stating that the login failed for the ASPNET account.

In SQLEXPRESS, where do I set the permission for the ASPNET account, or how do I go about handling this?

Thanks for the information.

BradJust some other information as I have not yet found an answer to this problem - I am using SQLEXPRESS (as stated in the prior post) and IIS 5.1 for other tables. I can using the login controls just fine. I can add users, etc. I created a new database in SQLEXPRESS and it is the tables to this database that I am having a problem with.

Thanks for the help.

Brad|||Okay, the only Express Manager and grant dbo rights to ASPNET. If there is a better way for this, please let me know because I don't know if it is safe to give those rights to this account.

Brad|||Are remote connections enabled for SQL Express? Can you connect remotely at all? You can check if remote connections are enabled using the Surface Area Configuration tool.

What is the login failure error message in the SQL Express error log?

What is the version of SQL Express that you are using?

Thanks
Laurentiu

Monday, February 20, 2012

Logging stored procedure use with MSDE (2000)

I have a app connected to MSDE that creates a report. The DB has over 300
stored procedures, with various args. I'm 9.9% sure the report must call a
SP. Can I somehow start a trace or log and have MSDE capture everything?
I'm hoping this way, I can discover the SP being run, along with the args.
I need to be able to run the report from the command line to get the output
into VBScript. (I know how to run a SP from VBScript, and massaging the
output shouldn't be a problem.)
Marco
You should be able to capture this using a server-side trace. Read about Profiler in Books Online,
and also read about, for instance sp_trace_create (etc).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Marco Shaw" <marco@.Znbnet.nb.ca> wrote in message news:u14RnmN4GHA.2420@.TK2MSFTNGP02.phx.gbl...
>I have a app connected to MSDE that creates a report. The DB has over 300
> stored procedures, with various args. I'm 9.9% sure the report must call a
> SP. Can I somehow start a trace or log and have MSDE capture everything?
> I'm hoping this way, I can discover the SP being run, along with the args.
> I need to be able to run the report from the command line to get the output
> into VBScript. (I know how to run a SP from VBScript, and massaging the
> output shouldn't be a problem.)
> Marco
>
|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uGNTi%23U4GHA.2596@.TK2MSFTNGP06.phx.gbl...
> You should be able to capture this using a server-side trace. Read about
Profiler in Books Online,
> and also read about, for instance sp_trace_create (etc).
Am just using MSDE which doesn't seem to have Profiler. Looking in to
sp_trace_create.
Thanks.
|||I just replied to your other post. Try to get hold of a "full" SQL Server, if only for a minute, and
script a trace from there. Here's an example, btw:
/************************************************** **/
/* Created by: SQL Server Profiler 2005 */
/* Date: 2006/09/26 16:21:52 */
/************************************************** **/
-- Create a Queue
declare @.rc int
declare @.TraceID int
declare @.maxfilesize bigint
set @.maxfilesize = 5
-- Please replace the text InsertFileNameHere, with an appropriate
-- filename prefixed by a path, e.g., c:\MyFolder\MyTrace. The .trc extension
-- will be appended to the filename automatically. If you are writing from
-- remote server to local drive, please use UNC path and make sure server has
-- write access to your network share
exec @.rc = sp_trace_create @.TraceID output, 0, N'InsertFileNameHere', @.maxfilesize, NULL
if (@.rc != 0) goto error
-- Client side File and Table cannot be scripted
-- Set the events
declare @.on bit
set @.on = 1
exec sp_trace_setevent @.TraceID, 14, 1, @.on
exec sp_trace_setevent @.TraceID, 14, 9, @.on
exec sp_trace_setevent @.TraceID, 14, 6, @.on
exec sp_trace_setevent @.TraceID, 14, 10, @.on
exec sp_trace_setevent @.TraceID, 14, 14, @.on
exec sp_trace_setevent @.TraceID, 14, 11, @.on
exec sp_trace_setevent @.TraceID, 14, 12, @.on
exec sp_trace_setevent @.TraceID, 15, 15, @.on
exec sp_trace_setevent @.TraceID, 15, 16, @.on
exec sp_trace_setevent @.TraceID, 15, 9, @.on
exec sp_trace_setevent @.TraceID, 15, 13, @.on
exec sp_trace_setevent @.TraceID, 15, 17, @.on
exec sp_trace_setevent @.TraceID, 15, 6, @.on
exec sp_trace_setevent @.TraceID, 15, 10, @.on
exec sp_trace_setevent @.TraceID, 15, 14, @.on
exec sp_trace_setevent @.TraceID, 15, 18, @.on
exec sp_trace_setevent @.TraceID, 15, 11, @.on
exec sp_trace_setevent @.TraceID, 15, 12, @.on
exec sp_trace_setevent @.TraceID, 17, 12, @.on
exec sp_trace_setevent @.TraceID, 17, 1, @.on
exec sp_trace_setevent @.TraceID, 17, 9, @.on
exec sp_trace_setevent @.TraceID, 17, 6, @.on
exec sp_trace_setevent @.TraceID, 17, 10, @.on
exec sp_trace_setevent @.TraceID, 17, 14, @.on
exec sp_trace_setevent @.TraceID, 17, 11, @.on
exec sp_trace_setevent @.TraceID, 10, 15, @.on
exec sp_trace_setevent @.TraceID, 10, 16, @.on
exec sp_trace_setevent @.TraceID, 10, 9, @.on
exec sp_trace_setevent @.TraceID, 10, 17, @.on
exec sp_trace_setevent @.TraceID, 10, 2, @.on
exec sp_trace_setevent @.TraceID, 10, 10, @.on
exec sp_trace_setevent @.TraceID, 10, 18, @.on
exec sp_trace_setevent @.TraceID, 10, 11, @.on
exec sp_trace_setevent @.TraceID, 10, 12, @.on
exec sp_trace_setevent @.TraceID, 10, 13, @.on
exec sp_trace_setevent @.TraceID, 10, 6, @.on
exec sp_trace_setevent @.TraceID, 10, 14, @.on
exec sp_trace_setevent @.TraceID, 12, 15, @.on
exec sp_trace_setevent @.TraceID, 12, 16, @.on
exec sp_trace_setevent @.TraceID, 12, 1, @.on
exec sp_trace_setevent @.TraceID, 12, 9, @.on
exec sp_trace_setevent @.TraceID, 12, 17, @.on
exec sp_trace_setevent @.TraceID, 12, 6, @.on
exec sp_trace_setevent @.TraceID, 12, 10, @.on
exec sp_trace_setevent @.TraceID, 12, 14, @.on
exec sp_trace_setevent @.TraceID, 12, 18, @.on
exec sp_trace_setevent @.TraceID, 12, 11, @.on
exec sp_trace_setevent @.TraceID, 12, 12, @.on
exec sp_trace_setevent @.TraceID, 12, 13, @.on
exec sp_trace_setevent @.TraceID, 13, 12, @.on
exec sp_trace_setevent @.TraceID, 13, 1, @.on
exec sp_trace_setevent @.TraceID, 13, 9, @.on
exec sp_trace_setevent @.TraceID, 13, 6, @.on
exec sp_trace_setevent @.TraceID, 13, 10, @.on
exec sp_trace_setevent @.TraceID, 13, 14, @.on
exec sp_trace_setevent @.TraceID, 13, 11, @.on
-- Set the Filters
declare @.intfilter int
declare @.bigintfilter bigint
exec sp_trace_setfilter @.TraceID, 10, 0, 7, N'SQL Server Profiler -
74e4bb26-8675-4e74-90d0-5793d57489d1'
-- Set the trace status to start
exec sp_trace_setstatus @.TraceID, 1
-- display trace id for future references
select TraceID=@.TraceID
goto finish
error:
select ErrorCode=@.rc
finish:
go
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Marco Shaw" <marco@.Znbnet.nb.ca> wrote in message news:e2RVkeX4GHA.4352@.TK2MSFTNGP03.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:uGNTi%23U4GHA.2596@.TK2MSFTNGP06.phx.gbl...
> Profiler in Books Online,
> Am just using MSDE which doesn't seem to have Profiler. Looking in to
> sp_trace_create.
> Thanks.
>

Logging stored procedure use with MSDE (2000)

I have a app connected to MSDE that creates a report. The DB has over 300
stored procedures, with various args. I'm 9.9% sure the report must call a
SP. Can I somehow start a trace or log and have MSDE capture everything?
I'm hoping this way, I can discover the SP being run, along with the args.
I need to be able to run the report from the command line to get the output
into VBScript. (I know how to run a SP from VBScript, and massaging the
output shouldn't be a problem.)
MarcoYou should be able to capture this using a server-side trace. Read about Pro
filer in Books Online,
and also read about, for instance sp_trace_create (etc).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Marco Shaw" <marco@.Znbnet.nb.ca> wrote in message news:u14RnmN4GHA.2420@.TK2MSFTNGP02.phx.gb
l...
>I have a app connected to MSDE that creates a report. The DB has over 300
> stored procedures, with various args. I'm 9.9% sure the report must call
a
> SP. Can I somehow start a trace or log and have MSDE capture everything?
> I'm hoping this way, I can discover the SP being run, along with the args.
> I need to be able to run the report from the command line to get the outpu
t
> into VBScript. (I know how to run a SP from VBScript, and massaging the
> output shouldn't be a problem.)
> Marco
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uGNTi%23U4GHA.2596@.TK2MSFTNGP06.phx.gbl...
> You should be able to capture this using a server-side trace. Read about
Profiler in Books Online,
> and also read about, for instance sp_trace_create (etc).
Am just using MSDE which doesn't seem to have Profiler. Looking in to
sp_trace_create.
Thanks.|||I just replied to your other post. Try to get hold of a "full" SQL Server, i
f only for a minute, and
script a trace from there. Here's an example, btw:
/ ****************************************
************/
/* Created by: SQL Server Profiler 2005 */
/* Date: 2006/09/26 16:21:52 */
/ ****************************************
************/
-- Create a Queue
declare @.rc int
declare @.TraceID int
declare @.maxfilesize bigint
set @.maxfilesize = 5
-- Please replace the text InsertFileNameHere, with an appropriate
-- filename prefixed by a path, e.g., c:\MyFolder\MyTrace. The .trc extensio
n
-- will be appended to the filename automatically. If you are writing from
-- remote server to local drive, please use UNC path and make sure server ha
s
-- write access to your network share
exec @.rc = sp_trace_create @.TraceID output, 0, N'InsertFileNameHere', @.maxfi
lesize, NULL
if (@.rc != 0) goto error
-- Client side File and Table cannot be scripted
-- Set the events
declare @.on bit
set @.on = 1
exec sp_trace_setevent @.TraceID, 14, 1, @.on
exec sp_trace_setevent @.TraceID, 14, 9, @.on
exec sp_trace_setevent @.TraceID, 14, 6, @.on
exec sp_trace_setevent @.TraceID, 14, 10, @.on
exec sp_trace_setevent @.TraceID, 14, 14, @.on
exec sp_trace_setevent @.TraceID, 14, 11, @.on
exec sp_trace_setevent @.TraceID, 14, 12, @.on
exec sp_trace_setevent @.TraceID, 15, 15, @.on
exec sp_trace_setevent @.TraceID, 15, 16, @.on
exec sp_trace_setevent @.TraceID, 15, 9, @.on
exec sp_trace_setevent @.TraceID, 15, 13, @.on
exec sp_trace_setevent @.TraceID, 15, 17, @.on
exec sp_trace_setevent @.TraceID, 15, 6, @.on
exec sp_trace_setevent @.TraceID, 15, 10, @.on
exec sp_trace_setevent @.TraceID, 15, 14, @.on
exec sp_trace_setevent @.TraceID, 15, 18, @.on
exec sp_trace_setevent @.TraceID, 15, 11, @.on
exec sp_trace_setevent @.TraceID, 15, 12, @.on
exec sp_trace_setevent @.TraceID, 17, 12, @.on
exec sp_trace_setevent @.TraceID, 17, 1, @.on
exec sp_trace_setevent @.TraceID, 17, 9, @.on
exec sp_trace_setevent @.TraceID, 17, 6, @.on
exec sp_trace_setevent @.TraceID, 17, 10, @.on
exec sp_trace_setevent @.TraceID, 17, 14, @.on
exec sp_trace_setevent @.TraceID, 17, 11, @.on
exec sp_trace_setevent @.TraceID, 10, 15, @.on
exec sp_trace_setevent @.TraceID, 10, 16, @.on
exec sp_trace_setevent @.TraceID, 10, 9, @.on
exec sp_trace_setevent @.TraceID, 10, 17, @.on
exec sp_trace_setevent @.TraceID, 10, 2, @.on
exec sp_trace_setevent @.TraceID, 10, 10, @.on
exec sp_trace_setevent @.TraceID, 10, 18, @.on
exec sp_trace_setevent @.TraceID, 10, 11, @.on
exec sp_trace_setevent @.TraceID, 10, 12, @.on
exec sp_trace_setevent @.TraceID, 10, 13, @.on
exec sp_trace_setevent @.TraceID, 10, 6, @.on
exec sp_trace_setevent @.TraceID, 10, 14, @.on
exec sp_trace_setevent @.TraceID, 12, 15, @.on
exec sp_trace_setevent @.TraceID, 12, 16, @.on
exec sp_trace_setevent @.TraceID, 12, 1, @.on
exec sp_trace_setevent @.TraceID, 12, 9, @.on
exec sp_trace_setevent @.TraceID, 12, 17, @.on
exec sp_trace_setevent @.TraceID, 12, 6, @.on
exec sp_trace_setevent @.TraceID, 12, 10, @.on
exec sp_trace_setevent @.TraceID, 12, 14, @.on
exec sp_trace_setevent @.TraceID, 12, 18, @.on
exec sp_trace_setevent @.TraceID, 12, 11, @.on
exec sp_trace_setevent @.TraceID, 12, 12, @.on
exec sp_trace_setevent @.TraceID, 12, 13, @.on
exec sp_trace_setevent @.TraceID, 13, 12, @.on
exec sp_trace_setevent @.TraceID, 13, 1, @.on
exec sp_trace_setevent @.TraceID, 13, 9, @.on
exec sp_trace_setevent @.TraceID, 13, 6, @.on
exec sp_trace_setevent @.TraceID, 13, 10, @.on
exec sp_trace_setevent @.TraceID, 13, 14, @.on
exec sp_trace_setevent @.TraceID, 13, 11, @.on
-- Set the Filters
declare @.intfilter int
declare @.bigintfilter bigint
exec sp_trace_setfilter @.TraceID, 10, 0, 7, N'SQL Server Profiler -
74e4bb26-8675-4e74-90d0-5793d57489d1'
-- Set the trace status to start
exec sp_trace_setstatus @.TraceID, 1
-- display trace id for future references
select TraceID=@.TraceID
goto finish
error:
select ErrorCode=@.rc
finish:
go
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Marco Shaw" <marco@.Znbnet.nb.ca> wrote in message news:e2RVkeX4GHA.4352@.TK2MSFTNGP03.phx.gb
l...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n
> message news:uGNTi%23U4GHA.2596@.TK2MSFTNGP06.phx.gbl...
> Profiler in Books Online,
> Am just using MSDE which doesn't seem to have Profiler. Looking in to
> sp_trace_create.
> Thanks.
>

Logging stored procedure use with MSDE (2000)

I have a app connected to MSDE that creates a report. The DB has over 300
stored procedures, with various args. I'm 9.9% sure the report must call a
SP. Can I somehow start a trace or log and have MSDE capture everything?
I'm hoping this way, I can discover the SP being run, along with the args.
I need to be able to run the report from the command line to get the output
into VBScript. (I know how to run a SP from VBScript, and massaging the
output shouldn't be a problem.)
MarcoYou should be able to capture this using a server-side trace. Read about Profiler in Books Online,
and also read about, for instance sp_trace_create (etc).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Marco Shaw" <marco@.Znbnet.nb.ca> wrote in message news:u14RnmN4GHA.2420@.TK2MSFTNGP02.phx.gbl...
>I have a app connected to MSDE that creates a report. The DB has over 300
> stored procedures, with various args. I'm 9.9% sure the report must call a
> SP. Can I somehow start a trace or log and have MSDE capture everything?
> I'm hoping this way, I can discover the SP being run, along with the args.
> I need to be able to run the report from the command line to get the output
> into VBScript. (I know how to run a SP from VBScript, and massaging the
> output shouldn't be a problem.)
> Marco
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uGNTi%23U4GHA.2596@.TK2MSFTNGP06.phx.gbl...
> You should be able to capture this using a server-side trace. Read about
Profiler in Books Online,
> and also read about, for instance sp_trace_create (etc).
Am just using MSDE which doesn't seem to have Profiler. Looking in to
sp_trace_create.
Thanks.|||I just replied to your other post. Try to get hold of a "full" SQL Server, if only for a minute, and
script a trace from there. Here's an example, btw:
/****************************************************/
/* Created by: SQL Server Profiler 2005 */
/* Date: 2006/09/26 16:21:52 */
/****************************************************/
-- Create a Queue
declare @.rc int
declare @.TraceID int
declare @.maxfilesize bigint
set @.maxfilesize = 5
-- Please replace the text InsertFileNameHere, with an appropriate
-- filename prefixed by a path, e.g., c:\MyFolder\MyTrace. The .trc extension
-- will be appended to the filename automatically. If you are writing from
-- remote server to local drive, please use UNC path and make sure server has
-- write access to your network share
exec @.rc = sp_trace_create @.TraceID output, 0, N'InsertFileNameHere', @.maxfilesize, NULL
if (@.rc != 0) goto error
-- Client side File and Table cannot be scripted
-- Set the events
declare @.on bit
set @.on = 1
exec sp_trace_setevent @.TraceID, 14, 1, @.on
exec sp_trace_setevent @.TraceID, 14, 9, @.on
exec sp_trace_setevent @.TraceID, 14, 6, @.on
exec sp_trace_setevent @.TraceID, 14, 10, @.on
exec sp_trace_setevent @.TraceID, 14, 14, @.on
exec sp_trace_setevent @.TraceID, 14, 11, @.on
exec sp_trace_setevent @.TraceID, 14, 12, @.on
exec sp_trace_setevent @.TraceID, 15, 15, @.on
exec sp_trace_setevent @.TraceID, 15, 16, @.on
exec sp_trace_setevent @.TraceID, 15, 9, @.on
exec sp_trace_setevent @.TraceID, 15, 13, @.on
exec sp_trace_setevent @.TraceID, 15, 17, @.on
exec sp_trace_setevent @.TraceID, 15, 6, @.on
exec sp_trace_setevent @.TraceID, 15, 10, @.on
exec sp_trace_setevent @.TraceID, 15, 14, @.on
exec sp_trace_setevent @.TraceID, 15, 18, @.on
exec sp_trace_setevent @.TraceID, 15, 11, @.on
exec sp_trace_setevent @.TraceID, 15, 12, @.on
exec sp_trace_setevent @.TraceID, 17, 12, @.on
exec sp_trace_setevent @.TraceID, 17, 1, @.on
exec sp_trace_setevent @.TraceID, 17, 9, @.on
exec sp_trace_setevent @.TraceID, 17, 6, @.on
exec sp_trace_setevent @.TraceID, 17, 10, @.on
exec sp_trace_setevent @.TraceID, 17, 14, @.on
exec sp_trace_setevent @.TraceID, 17, 11, @.on
exec sp_trace_setevent @.TraceID, 10, 15, @.on
exec sp_trace_setevent @.TraceID, 10, 16, @.on
exec sp_trace_setevent @.TraceID, 10, 9, @.on
exec sp_trace_setevent @.TraceID, 10, 17, @.on
exec sp_trace_setevent @.TraceID, 10, 2, @.on
exec sp_trace_setevent @.TraceID, 10, 10, @.on
exec sp_trace_setevent @.TraceID, 10, 18, @.on
exec sp_trace_setevent @.TraceID, 10, 11, @.on
exec sp_trace_setevent @.TraceID, 10, 12, @.on
exec sp_trace_setevent @.TraceID, 10, 13, @.on
exec sp_trace_setevent @.TraceID, 10, 6, @.on
exec sp_trace_setevent @.TraceID, 10, 14, @.on
exec sp_trace_setevent @.TraceID, 12, 15, @.on
exec sp_trace_setevent @.TraceID, 12, 16, @.on
exec sp_trace_setevent @.TraceID, 12, 1, @.on
exec sp_trace_setevent @.TraceID, 12, 9, @.on
exec sp_trace_setevent @.TraceID, 12, 17, @.on
exec sp_trace_setevent @.TraceID, 12, 6, @.on
exec sp_trace_setevent @.TraceID, 12, 10, @.on
exec sp_trace_setevent @.TraceID, 12, 14, @.on
exec sp_trace_setevent @.TraceID, 12, 18, @.on
exec sp_trace_setevent @.TraceID, 12, 11, @.on
exec sp_trace_setevent @.TraceID, 12, 12, @.on
exec sp_trace_setevent @.TraceID, 12, 13, @.on
exec sp_trace_setevent @.TraceID, 13, 12, @.on
exec sp_trace_setevent @.TraceID, 13, 1, @.on
exec sp_trace_setevent @.TraceID, 13, 9, @.on
exec sp_trace_setevent @.TraceID, 13, 6, @.on
exec sp_trace_setevent @.TraceID, 13, 10, @.on
exec sp_trace_setevent @.TraceID, 13, 14, @.on
exec sp_trace_setevent @.TraceID, 13, 11, @.on
-- Set the Filters
declare @.intfilter int
declare @.bigintfilter bigint
exec sp_trace_setfilter @.TraceID, 10, 0, 7, N'SQL Server Profiler -
74e4bb26-8675-4e74-90d0-5793d57489d1'
-- Set the trace status to start
exec sp_trace_setstatus @.TraceID, 1
-- display trace id for future references
select TraceID=@.TraceID
goto finish
error:
select ErrorCode=@.rc
finish:
go
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Marco Shaw" <marco@.Znbnet.nb.ca> wrote in message news:e2RVkeX4GHA.4352@.TK2MSFTNGP03.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:uGNTi%23U4GHA.2596@.TK2MSFTNGP06.phx.gbl...
>> You should be able to capture this using a server-side trace. Read about
> Profiler in Books Online,
>> and also read about, for instance sp_trace_create (etc).
> Am just using MSDE which doesn't seem to have Profiler. Looking in to
> sp_trace_create.
> Thanks.
>

Logging output in a transaction

We have a publish job that we are trying to automate, the problem is getting the output back to the app. or a file. Originally we had print statements, this worked great when we manually ran the proc in QA and could capture the output, now that we are automating it from an application I am not sure how to capture these Print statements - ideally I would like to find this out.

The App. is doing a Try-Catch block so using something like isql.exe will not do the trick otherwise that is the route we would go.

I tried logging everyting to a table but those inserts get rolled back with XACT_ABORT. What about the xp proc that logs it to the event log? Thought of that but that would make a real mess of the event log with all of our status messages.

Now we are considering using xp_cmdshell that calls a batch file to output our status text, is this my best option? I would prefer to capture all of the print statements so if anyone knows how to do this that would be preferable!

Thanks!:bump:

wrong forum? Should I try in an App Dev forum, perhaps?