.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to fetch user account type in sql server

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

Hello Mates,

I appreciate if some one tell me how it is possible to fetch the "account_type" of a SQL Server user wheter its a domain account to SQL bases account through an T-SQL statement? My rquired output is below:

User Id Role Id Role Name Account Type

View Complete Post

More Related Resource Links

Creating a table-valued function on a user defined type in SQL Server CLR

We would like to be able to create a table-valued function on a user defined type.  We would like the syntax in SQL to look like it works for the XML nodes function:   DECLARE @myXml XML = '<a><b>1</b><b>2</b><b>3</b></a>' ; SELECT  node.query('text()') FROM    @myXml.nodes('a/b') nodes (node) ;   In other words, in the FROM clause, we can access the "nodes" method of the xml variable and it returns a rowset. Thanks!

Login failed for user 'XXX'. Reason: Attempting to use an NT account name with SQL Server Authenti


Under a network service account. I want to perform some operations on the SQL server DB.

I am passing the user id and password of the admin on that box. Still I am getting Login failed for user 'XXX'. Reason: Attempting to use an NT account name with SQL Server Authentication.

Is there any way i can connect to Sql server with user id and password?

Connection string i am using is Data Source=imdbstrs22;Initial Catalog=DataStore;Integrated Security=false;user Id=XXX;password =Imdbaug#10;





The login already has an account under a different user name. (Microsoft SQL Server, Error: 15063)





I have two databases xxx and yyy.

I added a new user to xxx named as "Admin". It ownes some schemas.

Afterwards I added a new user to yyy named as "Admin". It ownes the same schemas.

Then I pressed ok button, got the error:" The login already has an account under a different user name. (Microsoft SQL Server, Error: 15063)".



Could you please give me some advice?



Adding Certificates for SSL connection for a user account in Windows 2008 Server


Hi All, I have a windows service running on Windows 2008 server, when I set the service to log on as Local System account, it works fine and does the ssl certificate authentication.

Where as when I change the service to log on to a different account it fails with the authentication error.

Could some one please help me here.


MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Configuring User Profiles in SharePoint Server 2010

Note: I've added the necessary links relating to SharePoint Server 2010 prerequisites, along with instructions for configuring the user profile synchronization service, at the end of this

User Defined Functions in Microsoft SQL Server

User Defined Functions are compact pieces of Transact SQL code, which can accept parameters, and return either a value, or a table. They are saved as individual work units, and are created using standard SQL commands. Data transformation and reference value retrieval are common uses for functions. LEFT, the built in function for getting the left part of a string, and GETDATE, used for obtaining the current date and time, are two examples of function use. User Defined Functions enable the developer or DBA to create functions of their own, and save them inside SQL Server.

"Type ASP.x is not defined" error for dynamic user control when publishing updateable


I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave


<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

    Simple control


Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class


<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

No ASPNET User in Windows Server 2008?


I have been looking everywhere online regarding this, but have not found a clear answer.


I have an ASP.Net app running on Windows Server 2008, it's basically a reporting app using Crystal Reports. I have encountered a roadblock in regards to rendering some pages. When I run the app in Visual Studio(on the same 2008 machine) everything works perfectly. Yet when I publish it and run it live the reports will not display correctly, I get a message saying Failed to render page.


I looked this error up in the Crystal Reports website and the fixes they have there refer to giving the windows "aspnet" user full access rights to certain folders on the machine. I would be happy to do this, however there is no aspnet user in Windows Server 2008.


I installed the server and set its role to be Web Server. I also checked all the options regarding ASP.Net and IIS 6 compatibility. Yet there is no ASPNET username anywhere.


Did I set the server up wrong? or do I have to do something within ASP.Net to  create this user and then give it rights? 

Least Privilege: Teach Your Apps To Play Nicely With Windows Vista User Account Control


User Account Control in Windows Vista keeps the OS safe from intentional and accidental configuration changes.

Chris Corio

MSDN Magazine January 2007

Reporting: Deliver User-Friendly Reports from Your Application with SQL Server Reporting Services


SQL Server 2000 Reporting Services--a server-based reporting platform built on the .NET Framework and integrated with SQL Server 2000--lets you easily add reporting from diverse data sources. Using Visual Studio and Reporting Services you can integrate reports from any data source that has an OLE DB, ODBC, or ADO.NET provider into your Web applications. This article explains how it's done.

John C. Hancock

MSDN Magazine August 2004

Types in Yukon: Managed UDTs Let You Extend the SQL Server Type System


The next version of SQL Server, code-named "Yukon," will offer enhanced support for user-defined types (UDTs). Because UDTs can be managed by the CLR, you can represent a wide variety of data structures to create types not possible with previous versions of SQL Server. With UDTs you can more precisely control the kind of data your type accepts, resulting in better data management. This article explores UDTs in "Yukon" and covers their design and implementation.

Peter W. DeBetta

MSDN Magazine February 2004

What is the best way to create user account for big group of people?


I need to create individual account for a big group of people (around 200) from an Excel spreadsheet. What is the best practice? It will take too much time to create account using web form. I think there must be a way to do it. Please advice. I tried to use Stored procedures created by ASP.NET. NOT SURE whether it is a good idea.


User Account Corrupted



I'm having this problem for quite sometime now. I'm using SQL Express for my DB.

First i thought it's because of Web Server 2003 so i migrated to 2008 but it did'nt solve the problem.

Some of my users suddenly cannot login anymore not All were affected and almost same user

encounter account corruption. My solution right now is to delete their account and create a new one.

I dont know if it's how they use the web service or something wrong with the browser.

My plan right now is to create a new "ASPNETDB" if i cant find any solution.

Hope some can asist me if in case you have already encountered this. Also thought that maybe

because i'm using SQL Express MS intended to do this to force me to buy licensed version.

BTW, normally i only have 20 users accessing Web at the same time.



Creating SharePoint Server 2010 External Content Type Associations with SharePoint Designer 2010

Learn how to use Business Connectivity Services (BCS) to create associations between external content types in SharePoint Designer 2010 without using code.

Need help with setting up SQL Server 2008 for role/user management


I've posted my problem in a few other categories.  Sorry for that.  I didn't see the security category until now.

I'm trying to use ASP.NET's built-in role/user management for a couple ASP.NET MVC 2 sites.  I'm using the MVCMusicStore as my guide.  I click on the Configuration Tool as the tutorial suggests, which launches the site administration page.  Unfortunately when I click on the security tab, I get an error that it cannot connect to the data store.  Attempting to test the AspNetSqlProvider gives me a similar error.

I've run the aspnet_regsql program as the error message suggested, and I have a role/user management database ready to go on the server.  The proper tables are constructed, and all that.  The configuration tool still doesn't see the data store.

As a test, I ran the MVCMusicStore demo in the debugger.  Its role/user management functionality worked.  I was able to add myself as a customer, and add/remove items from my cart with no errors or exceptions.  However, when I attempted to access its security tab in the configuration tool, I received the same error as I get for my own project.  How is it possible that role/user management works, but the configuration tool cannot change its settings?

Any suggestions on how I can get the configuration t

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend