Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2011-01-12 : 06:23:08
|
| I have an application where I am trying to use Windows integrated authenticationIn one of the stored procedure where i am truncating one of my table I am getting error Could not obtain information about Windows NT group/user 'KamranUser', error code 0x5.My stored procedure is given belowCREATE PROCEDURE [dbo].[usp_EmptyReferecneData] WITH EXECUTE AS SELFAS TRUNCATE TABLE ReferecneData;Fromt he same credentail i am able to broswe other screen do insert update delete easily.Only problem is in with [WITH EXECUTE AS SELF AS TRUNCATE TABLE ..]Kamran ShahidSr. Software Engineer(MCSD.Net,MCPD.net) |
|
|
Sachin.Nand
2937 Posts |
Posted - 2011-01-12 : 06:30:46
|
| try thisCREATE PROCEDURE [dbo].[usp_EmptyReferecneData] WITH EXECUTE AS 'YourUserName'AS TRUNCATE TABLE ReferecneData;PBUH |
 |
|
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2011-01-12 : 06:34:05
|
| What should be at 'YourUserName' should it be the user name of the machine? I don't think so that it could be possible to give me such a script where Machine user name should be hardcoded.Could there be any other work around?Kamran ShahidSr. Software Engineer(MCSD.Net,MCPD.net) |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2011-01-12 : 06:37:56
|
I just need to know whether the above script works.It is the username with the one you are the user for the database where the table is present with i.e kamranuser.Also have you checked whether you have TRUNCATE permission for the table.Also what do you mean by other screenquote: Fromt he same credentail i am able to broswe other screen do insert update delete easily.
PBUH |
 |
|
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2011-01-12 : 06:42:47
|
| I mean same web application where this truncate storep procedure is calling have some other web pages.Where there is no problem encounteredKamran ShahidSr. Software Engineer(MCSD.Net,MCPD.net) |
 |
|
|
Sachin.Nand
2937 Posts |
|
|
|
|
|