SQLContext.WindowsIdentity.Impersonate() Fails
Dec 26, 2007
I am calling SqlContext.WindowsIdentity.Impersonate() within a CLR Stored Procedure and getting the following error:
System.InvalidOperationException: Data access is not allowed in this context. Either the context is a function or method not marked with DataAccessKind.Read or SystemDataAccessKind.Read, is a callback to obtain data from FillRow method of a Table Valued Function, or is a UDT validation method.
The CLR Routine does not do any kind of data accees (as far as SQL is concerned).
Here is the routine:
[SqlFunction(
DataAccess = DataAccessKind.Read,
SystemDataAccess = SystemDataAccessKind.None )] public static int CallService( string sServer, int iPort, string sPath, SqlXml cSqlXmlRequest, out SqlXml cSqlXmlResponse ) { string sXmlResponse = string.Empty; WindowsImpersonationContext cImpersonationContext = null; try {
cImpersonationContext = SqlContext.WindowsIdentity.Impersonate(); sXmlResponse = SoapTransport.CallService( sServer, iPort, sPath, cSqlXmlRequest.Value );
...
} catch (...) { throw; } finally { if ( cImpersonationContext != null ) cImpersonationContext.Undo(); } return SQL_SUCCESS; }
The only SQLContext method/properties that are called is the WindowsIdentity. Further, if I "push" the SqlContext.WindowsIdentity.Impersonate(); call inside CallService, everything work. (It also works correctly if I leave the call of and change the execution identity of SQLServer).
Any ideas as to why this error is occurring and how to resolve it?
Thanks.
View 1 Replies
ADVERTISEMENT
Mar 24, 2008
We are building some new reports using SSRS and one of the reports we are building is trying to use a stored procedure that is a wrapper for an assembly.
When creating the results we are using using SqlContext and SqlDataRecord, and we are creating the column meta data (e.g. List<SqlMetaData>).
We are able to deploy the assembly and stored proc, we see the recordset coming back in the management studio, but we can not see the field's in the SSRS report designer.
Does anyone know how to return the metadata in such a way that my reporting analyst can see the available fields in the IDE?
Thanks in advance.
AG
View 1 Replies
View Related
Oct 2, 2006
I don't want to use "network service" account for app poll identity for asp.net applications because of security reason. But I try to use sqlexpress I receive following error message.
"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."
But when I try to connect master db with same account (test) there is no problem. Then I create to user profile for "test" account but same error occurred.
Does anyone know how I can resolve this? Thanks!
View 5 Replies
View Related
Sep 24, 2007
Say i have two login accounts in sql server 2005,I want to do context switch operation for two accounts.
I want to know to get impersonate permission....
any suggestions?
thanks
View 5 Replies
View Related
Mar 14, 2007
I am currently logged in as local admin on my laptop, and I want to connect to clients SQL Server 2005.
I can't use my local admin and have to use company network login.
How can I impersonate my network login when connecting to the SQL Server when using local admin account?
Peter Larsson
Helsingborg, Sweden
View 4 Replies
View Related
Mar 17, 2004
Hello,
On my SQL Server 2000, I have successfully created a linked server to my Exchange 2000 server (located on the same physical computer). I can't send request and everything is fine.
But now, I would like to apply the "Impersonate" setting. The big problem I've got is that Exchange doesn't use a login and password for the authentification but use the Windows credentials.
I have try things like :
login : <domain name><username> with the real password
login : <username>@<internet domain name> with the real password
but that doesn't work.
I would like to know if there is a way to "impersonate" user log on the SQL Server when they try to use the linked server to Exchange Server.
Thank a lot
Felix Pageau
fpageau@NOSPAM.str.ca
Print | Copy URL of this post
Expand All Collapse All
View 3 Replies
View Related
Dec 26, 2006
Hello all,
I have a quick question. The sql reporting server is on server A, and the actual data for the report is on a sql server 2005 called server B. When I am actually developing my report and click preview, everything works perfectly using windows authentication. However, whenever I publish and try to view the report, i get this error:
An error has occurred during report processing.Cannot create a connection to data source 'serverB'.Login failed for user 'NT AUTHORITYANONYMOUS LOGON'.How do I change the login for this datasource while still using windows authentication and not mixed mode?
Thanks
View 1 Replies
View Related
May 26, 2008
Hi all,
I encountered a problem when I tried to generate .rdl report in my PWA website integrated with report server. In the "Manage Data Source", when I set the credential type to "Windows authentication (integrated)", it works.
However, when I changed it to "Stored credentials" with the windows account as the Login, the following error occurs:
An error has occurred during report processing. (rsProcessingAborted)
Cannot impersonate user for data source 'CustomizedDB'. (rsErrorImpersonatingUser)
Logon failed. (rsLogonFailed)
Logon failure: the user has not been granted the requested logon type at this computer. (Exception from HRESULT: 0x80070569)
Does anyone know the reason behind? Thanks in advance.
The problem also happens when "Prompt for credentials (use as Windows Credential)" is used.
View 1 Replies
View Related
Aug 15, 2006
Hi,
I have a string almost 11006 length.. when i try to send back from SQLCLR procedure
it says cannot send ..
here is Exception Text "Message length 11060 exceeds maximum length supported of 4000."
Max limit to send a string using pipe is 4000
How I can send a string which is large in size than 4000.
Thanks
View 6 Replies
View Related
Jun 11, 2007
I did a small package with only one ODBC connection (Merant 3.70 32-Bit Progess). This package runs well in Visual Studio and fails when runs by SQL Server Agent.
Configuration:
SQL Server Agent on a 32Bit server.
The ODBC connection configuration in available on System DSN on this server.
The user of Server Agent have full access (Admin).
Connect Manager Provider: ".Net ProvidersOdbc Data Provider"
SQL Server version: 9.0.3042
Error Message:
Executed as user: TEKCON cadmin. ...ion 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 16:50:33 Error: 2007-06-11 16:50:33.62 Code: 0xC0047062 Source: Data Flow Task DataReader Source [1] Description: System.Data.Odbc.OdbcException: ERROR [HYC00] [MERANT][ODBC PROGRESS driver]Optional feature not implemented. ERROR [HY000] [MERANT][ODBC PROGRESS driver]msgOpen: unable to open message file: PROMSGS ERROR [IM006] [MERANT][ODBC PROGRESS driver]Driver's SQLSetConnectAttr failed. ERROR [HYC00] [MERANT][ODBC PROGRESS driver]Optional feature not implemented. ERROR [HY000] [MERANT][ODBC PROGRESS driver]msgOpen: unable to open message file: PROMSGS ERROR [IM006] [MERANT][ODBC PROGRESS driver]Driver's SQLSetConnectAttr failed. at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcCon... The package execution fa... The step failed.
I created a .bat file with this instruction and It's run well:
dtexec /f "C:Program FilesMicrosoft SQL Server90DTSPackagesIntegration Services Project estcom.dtsx"
pause
Why it's not running with SQL Server Agent???
View 7 Replies
View Related
May 8, 2008
We are trying to install the Standard Edition of SQL Server 2005. We already have SQL Express installed. Standard won't install and Express won't uninstall.
We have tried every suggestion we can find and some we made up. When we try to install Standard, we get to the bit where you choose what you want to install and the only thing available is workstation components.
There are so many cases of this on the Internat that I can't believe MS have not solved the issue. And I am stunned that they want to charge us more money to talk to us about how to fix something we just paid them an arm and a leg for!
What do I need to tell you to get some idea of where to go next with this?
View 11 Replies
View Related
May 21, 2001
Hi,
I have suddenly run into a problem. I have a DTS which was running well till few days ago. Now when ever it runs, it crashes the server, any body
have any idea why???
Thanks in Adv.
Nirmal
View 2 Replies
View Related
Feb 25, 2004
Hi all,
Sql server 7
I have created a Web assistant job which select
and displays data from a table (very small amt of data)
on to the webpage. the job is schedule to run
every 1 minute. the job is not running, in job view
history its gives the error msg
"could not open the output file" 16821 Error no.
pls suggest
Awaiting for ur reply
TIA
Adil
View 1 Replies
View Related
Mar 17, 2004
I have a DTS job that runs every hour.
it truncates destination table and copies from the source table.
it has failed with the following error in view job history
"error-214721900(80040E14);provider error 14262.(37B6)"
error source Microsoft ole db provider error
pls help in this
how can i solve this, i tried restarting the job but its failing again.
View 3 Replies
View Related
Apr 15, 2004
Good Morning,
I've been running into a small problem. There are two people that usually create local packages to be executed by the DTS. Either my boss or I. The problem that I have been running into is, there are some local packages that will not execute when I try to run them. These packages are that my boss has created. When she runs them they work fine. But when I run them they just don't run. The only way I can run the local package is if I log in into the server and run it from there.
The error that I keep getting is:
Unspecified Error
[Microsoft][ODBC Driver Manager] Data Source Name not found and no default driver specified.
What would I be able to do so that I can execute this local package from my computer?
View 7 Replies
View Related
Apr 24, 2007
Hey guys,
I'm trying to run a job that will convert a load of data but it keeps failing at the first step. If I run the scripts in each step on their own then they run fine. The error message I get is 'The process did not produce any output. Process exit code 1. The step failed'. I think this may be some kind of security problem but I cannot see where. The command I'm using for the first step is as follows:
OSQL -SCRLONSQL01 -DINPRO -Usysadm -Pcarpmaels -i"C:Program FilesCPA Inpro DatabaseScriptsdropinteg.sql" -o"C:conversionoutputdropinteg.txt" -n
Any pointers would be most helpful.
View 11 Replies
View Related
Nov 6, 2007
Hi,
I am trying to create a job to run a ssis package.
The job fails. Looking at the history log, there is no proper information on why the job failed. It just says: The job failed. The job was invoked by user ...
please note that the ssis package runs fine on it's own i.e. in the designer by pressing the run button.
Thanks
View 3 Replies
View Related
Jul 10, 2007
I have a package which works fine when i ru if from VS but when i schedule it iam getting an error on one of the data reader source. I am not able to figure it why its giving error when its working fine from VStudio
Message
Executed as user: NAdbasvc-alticor. ... 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 11:28:25 AM Error: 2007-07-10 11:28:26.21 Code: 0xC020838F Source: Staging LKPDataReader Source [1] Description: An error occurred executing the provided SQL command. End Error Error: 2007-07-10 11:28:26.21 Code: 0xC004706B Source: Staging DTS.Pipeline Description: "component "LKPDataReader Source" (1)" failed validation and returned validation status "VS_ISBROKEN". End Error Error: 2007-07-10 11:28:26.21 Code: 0xC004700C Source: Staging DTS.Pipeline Description: One or more component failed validation. End Error Error: 2007-07-10 11:28:26.21 Code: 0xC0024107 Source: Staging Description: There were errors during task validation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 11:28:25 AM Finished: 11:28:26 AM Elapsed: 0.906 seconds. The package execution fai... The step failed.
has anyone come across same issue, help
View 5 Replies
View Related
Apr 13, 2004
Hello,
I'm trying to get a handel on ASP.NET and I've put together a new SQL connection to display a view inside of a datagrid.
When I go to run it (before or after compile) I get the error:
------------------------------------------------------------------------------------------------------
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
Line 57: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 58: Dim ds As New DataSet
Line 59: SqlDataAdapter1.Fill(ds)
Line 60:
Line 61: DataGrid1.DataSource = ds
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.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
jtio8.WebForm1.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootjtio8WebForm1.aspx.vb:59
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Here is the connection string I am using:
Me.SqlConnection1.ConnectionString = "workstation id=MyWorkstation;packet size=4096;integrated security=SSPI;data source=MyServer;" & _
"persist security info=False;initial catalog=Northwind"
-------------------------------------------------------------------------------
Now, I've created a new login to the SQL server using the ASPNET user id (as well as several others for testing), set up the premissions for each UID and I'm still getting this error.
I have also tried to setup the user info in the connection string by doing the following:
Me.SqlConnection1.ConnectionString = "user id=aspnet;password=;workstation id=MyWorkstation;packet size=4096;integrated security=SSPI;data source=MyServer;" & _
"persist security info=False;initial catalog=Northwind"
Any ideas?
Thanks,
Dale
View 2 Replies
View Related
Jan 11, 2005
Hi all;
I am getting the following error when I try to connect to my local SQL server from my ASP.NET application
Server Error in '/pelin' Application.
Cannot open database requested in login 'pelin'. Login fails. Login failed for user 'sa'.
for other users also
my connection string is in web.config file:
<appSettings>
<add key="constr" value="server=ARGE057VSDOTNET2003;UID=sa;pwd=sa;database=Test;"></add>
</appSettings>
can you help me please thanks..
View 1 Replies
View Related
Jan 27, 2006
Hello,I'm trying to create a new SQL Express database in VWD, and I get the error: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.What is this error all about? I don't understand it.Thanks.
View 1 Replies
View Related
Feb 1, 2006
I have this line of db connection code that works in vb.net but not in c#:
con = new ADODB.ConnectionClass(); //for vb.net I used ADODB.Connection() instead and it workscon.Open("Provider=SQLOLEDB;" + ConfigurationSettings.AppSettings["connectionString"]);
Error message:CS1501: No overload for method 'Open' takes '1' arguments
Searched the web but can't find the answer... Does anyone have a clue?
View 2 Replies
View Related
Jun 25, 2002
This is a proc that was working on production 7.0 server but is being tested on a 2000, what's changed?
TIA
JeffP....
View 2 Replies
View Related
Apr 23, 2001
I trying to FTP Files about 37 files each 3 GB. The FTP is just stuck. It fails half way through. I use IIS 4.0 in Clustered Network and MSSQL 7.0. IIS 4.0 does not support transfer of files more than 4 GB.Is there any other tools that I can use to FTP the dump files. Does anyone have any ideas.
View 1 Replies
View Related
Sep 17, 2001
SQL SERVER 7.0
==============
Hi All!
I have a job that has 2 steps.In the first step iam using a group by clause.The column on which I use group by, sometimes has null values.During such case the job is failing at the first step throwing a warning.
Warning: Null value eliminated from aggregate. [SQLSTATE 01003]
1)If i want to override this, is it appropriate to use set ansi_warnings off for my session?
2)If there is some other error will that be detected or will that be overridden too?
Any help appreciated!
TIA
Regards,
kinnu
View 1 Replies
View Related
Jun 7, 2000
I have a script that is generated from main frame.
This script updates about 113,000 rows.
I keep getting an error message 225, 16.
From Books on line
225 "Refrenced object (name %*.s) dropped during query optimization"
16 Too many table names in the query. The maximum allowed is %d. knowing that it updates only one table this message does not make sense.
It is on sql server 6.5.
Any help will be very much appreciated.
Thanks in advance
Al
View 1 Replies
View Related
Oct 23, 2000
When I schedule a DTS export job,I am getting this error. But if I run it with 'run immediately' option while creating the job,it runs fine! Any clue??
Thanks.
''DTSRun: Loading... DTSRun: Executing... DTSRun OnStart: Transfer SQL Server Objects DTSRun OnError: Transfer SQL Server Objects, Error = -2147221504 (80040000) Error string: Error source: Help file: Help context: 0 Error Detail Records: DTSRun OnFinish: Transfer SQL Server Objects DTSRun: Package execution complete. Process Exit Code 1. The step failed.''
View 2 Replies
View Related
Oct 18, 2000
when I create a DTS export job,it is running o.k when I select 'run immediately' option.But the same job is not running as a job.Any idea???
Thanks for any help.
View 1 Replies
View Related
Feb 24, 2000
Hi ,
While running the load cmd - 'Load database dbname1 from disk='c:empdump1.dat'
through ISQL I am getting the following error
1 transaction rolledback dbid error 7.But when I tried restoring using enterprice manager UI it is working fine.Any body knows why it is happening like this .
Thanks in advance
Jiji
View 1 Replies
View Related
Sep 2, 1999
I set up a DTS package to run every night on my SQL 7 Server.
It is supposed to write a text file of modified rows every night.
It was working fine until I changed the password for sa, now it
fails. Also in Enterprise Manager, when I try to look a the package
properties, I get a "login failed for user sa" package error.
What to do?
View 1 Replies
View Related
Mar 2, 2001
I have stored procedure that uses the xp_cmdshell procedure to use the dts run to run some dts packages. This package exports data into an Access 97 database. When I run it I get this error:
Error: -2147467259 (80004005); Provider Error: -533791822 (E02EFBB2)
Error string: Could not update; currently locked by user '(unknown)' on machine ''.
Error source: Microsoft JET Database Engine
Help file:
Help context: 5003218
If I right click on the local package and select execute it runs with no problem. Any ideas what is going on?
View 2 Replies
View Related
Nov 8, 2002
I have a DTS package set up to push data out to several sites. When I execute the package it runs perfectly. When I schedule it as a job it fails.
I checked the proxy account in the SQLAGent properties and there is a check mark there. But the job still fails.
Does anyone have any ideas?
View 8 Replies
View Related
Nov 30, 2005
Ok I had a server crash the master was bad or corrupted. I tried to rebuild the master but that failed. I had to reinstall sql and then attach the databases.
I need to know why the master all of a sudden just stopped working. Any ideas where to look or what would cause this?
Thanks.
:eek:
View 9 Replies
View Related