Proper Syntax For Adding Object Name Owned By Domain User

Aug 11, 2005

I am receiving an error based on my query that is giving me the following error:


Code:


[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'Config'.



I'm assuming that this is because the table was not made by dbo, but my domain account.

The query is currently defined as:


Code:


SQL = "SELECT * FROM Config"



but I'm assuming it needs to be defined with the syntax of ownername.objectname. My problem is when I change the string to this:


Code:


SQL = "SELECT * FROM sanm.APHinzeE.Config"



I get this error:

Code:


[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ''.



I tried to escape the slash using / but then I get the error on that. How do I specify my account name with the slash?

View 1 Replies


ADVERTISEMENT

Dbo Owned Stored Procedure Hitting Another User Owned Table

Aug 13, 2007

I am trying to come up with a solution that does not involve having a version of every stored procedure for every user I have...
Here is the problem...

I am going to have multiple users that need to have their own "product table". The structures are going to be the same for all. We currently only have one user and it is a DBO... all stored procedures are dbo.[sp name]... is there any way to get it so that the product table in the SP will be the user owned product table and not the dbo table??

I have tried just taking out the dbo prefix with no luck... the user's default schema will match the table they own so when they do a straight select they get the right information but it is just the SPs that I can't seem to get to work...

The only thing that I have come up with is making the SPs dynamic with having the username as parameter.

Is there anything else I can try??


and SQL 2005 SP2 on Win 2003 SP2

View 2 Replies View Related

Making Restricted User To See Only The Database That Is Owned By It.....!

Feb 7, 2008

How would I hide the sa account to be accessible under Logins for a restricted User in sql server 2005 and also other folders like Replication, Managment, etc need to be hidden too.



any idea,

thank,s

View 1 Replies View Related

How To Find Out The List Of All Tables And Views Owned By A Particular User In Any Database?

Oct 15, 2001

How to find out the list of all tables and views owned by a particular user in any database by querying the system tables?Thanks.

View 2 Replies View Related

Proper Syntax For Bulk Insert?

Sep 28, 2004

Hi,

I'm working in vb.net and want to use a stored procedure to insert all employees from one db into my db. I can insert one by one, but I would like to get them all in without looping.

How would I do this? I've tried bulk insert, but I keep getting syntax errors; I've read the books online, but don't quite understand what they mean. I don't want to use DTS, should I?

Here is what I'm doing so far:

CREATE Procedure Insert_From_Personnel
@emp_num char(10),
@Frst_Name char(10),
@Last_Name char(10),
@DivisionID char (4)

as

INSERT into individual (IndividualID,FirstName,LastName,DivisionID)

VALUES (@emp_num,@Frst_Name,@Last_Name,@DivisionID)
GO

Thanks for any help,

View 14 Replies View Related

User On Trusted Domain Does Have Permission To Access Linked Server On AD Deployed In Another Domain

Sep 28, 2007

Hi,
We have the followoing:

-A "master domain" AD, a "sub domain" AD, a trust relationship between the two (sub trust master)
-A sql server 2005 on a win server 2003 in "sub domain" AD
-A linked server to "sub domain" AD
-A linked server login using a "sub domain" admin acccount
-A view to this linked server
-A grant on masterDomain/Domain Users to the database
-A grant on subDomain/Domain Users to the database
-We want all connections done through "Windows Authentication" not "Database Authentication".

Queries on the view work fine using "sub domain" user accounts.
Queries on the view fail using "master domain" user accounts (including master domain admin accounts)


"Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "ADsDSOObject" for linked server "ADSI" reported an error. The provider indicates that the user did not have the permission to perform the operation."

All connections are done through "Windows Authentication" not "Database Authentication".

Can we establish cross domain connectivity with "Windows Authentication" ?


Below are details of the implementation:

SELECT TOP (100) PERCENT *
FROM OPENQUERY(ADSI,
'SELECT displayname, givenName, sn, cn (etc...)
FROM ''LDAP://OU=PEOPLE,DC=subDomain,DC=com''
WHERE objectCategory = ''Person'' AND objectClass = ''user'' ')

EXEC sp_addlinkedsrvlogin @rmtsrvname ='ADSI', @useself='false',
@rmtuser='subDomainAdminAccnt', @rmtpassword='sunDomainAdminAccntPassword';

In SQL Server Mngt Studio in Server Objects/Linked Servers/Providers/ ADSI properties security tab I have:

"connections will: <be made using this security context> Remote login:'subDomainAdminAccnt' With password: 'subDomainAdminAccntPassword'

Error:
Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "ADsDSOObject" for linked server "ADSI" reported an error. The provider indicates that the user did not have the permission to perform the operation.

Msg 7320, Level 16, State 2, Line 1

Cannot execute the query "SELECT displayname, givenName, sn, cn

FROM 'LDAP://OU=PEOPLE,DC=subDomain,DC=com'

WHERE

objectCategory = 'Person'

AND objectClass = 'user'

" against OLE DB provider "ADsDSOObject" for linked server "ADSI".

View 7 Replies View Related

Problems With Change Sql Permissions After Migrating Domain User/group Accounts Into Root Domain

Apr 5, 2007

I have a root domain and child domain.



After using ADMT to migrate the domain user or group into the root domain, when I use enterprise manager to try and change the permissions allocated to that domain user/group, i get the 'Error 15401 NT user or Group not found'.



This is a correct error as the user is now in the root domain, however sql (in sysxlogins) still thinks its in the child domain.



Is there a simpler way, other than collecting the users permissions, deleting the user from SQL then adding back in with the correct domainusername format, then adding the permissions back?



I tried renaming the 'name' in sysxlogins (not recommended) and while that worked, whenever I tried to add the migrated user to another database, the login name was missing and would not resolve.



I believe it is something to do with the SID not matching.



Any ideas on how to fix this ?

View 1 Replies View Related

In Code Behind, What Is Proper Select Statement Syntax To Retrieve The @BName Field From A Table?

Apr 8, 2006

In Code Behind, What is proper select statement syntax to retrieve the @BName field from a table?Using Visual Studio 2003SQL Server DB
I created the following parameter:Dim strName As String        Dim parameterBName As SqlParameter = New SqlParameter("@BName", SqlDbType.VarChar, 50)        parameterBName.Value = strName        myCommand.Parameters.Add(parameterBName)
I tried the following but get error:Dim strSql As String = "select @BName from Borrower where BName= DOROTHY V FOWLER "
error is:Line 1: Incorrect syntax near 'V'. 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: Line 1: Incorrect syntax near 'V'.
Source Error:
Line 59: Line 60: Line 61:         myCommand.ExecuteNonQuery()   'Execute the query

View 2 Replies View Related

Error 15401 Adding Domain Group To SQL Server

Nov 9, 2006

I have tried rebooting the system, I have ran the script to look for duplicate sids and am still having the issue when trying to add a domain group to SQL. I get the Error 15401: Windows NT user or group'miTrust Legal' not found. Check the name again. Running SQL 2000 Std, with SP3a, and the collation is set to SQL_Latin1_General_CP850_BIN, which makes this instance case sensitive, and the group name is spelt right and am following the case sensitivity of the name as well.

View 10 Replies View Related

EVENT ID 18456 STATE: 16 Login Failed For User 'DOMAIN/user'. [CLIENT: &&<local Machine&&>] Every Minute In Event Log.

Oct 22, 2007

We recently upgraded to SQL 2005 from SQL 2000. We have most of our issues ironed out however about every 1 minute there is a message in the Application Event log and the SQL log that states:

EVENT ID 18456 Login Failed for the users DOMAIN/ACCOUNT [CLIENT: <local machine>]

This is a state 16 message which I thought meant that the account does not have access to the default database. The account is actually the account that the SQL services run under.

Any ideas? We can't seem to figure this one out. We actually upgraded to 2005 from 2000 and had an error appear after every reboot that prevented the SQL Agent from running(This application has failed to start because GAPI32.dll was not found. Re-installing the application may fix this problem.) We did a full uninstall of SQL and reinstalled fresh and restored the databases from .bak files and that is when the EVENT ID 18546 started occuring every minute.

We don't have any SQL heavy hitters here so please be detailed with any possible solutions. That you very much for any help you can provide!

David

View 5 Replies View Related

Programmatically Adding A User To The System User Role

Dec 27, 2006

We have been working on an application that will be using a forms-authenticated report server (RS2005) as a reporting back-end. Using the reporting services web service I have been able to assign permissions to objects in reporting services no problem. The issue is that each user needs to be added to the System User role to be able to use the report builder properly. I can't seem to find a way to do this programmatically. Any idea?

View 1 Replies View Related

Run SQL As Domain User

Sep 10, 2002

SQL2K SP2 on Win2K Server in single native-mode domain

I'm trying to change MSSQLServer and SQLServerAgent to run under a domain account instead of LocalSystem. SQL is not running on the DC. I get Error 22042:xp_SetSQLSecurity() returned error -2147023564, 'No mapping between account names and security ID's was done'.

The SQL machine is part of the domain. I'm logged in as a Domain Admin.

What is the problem?

View 2 Replies View Related

How Do I Get A User's Domain?

Jul 27, 2006



I need to provide a UI to get the information to add a windows login to a SqlServer database. The CREATE LOGIN Sql statment requires the user name as "DomainNameUserName". I can get a list of users in XML using the following code:

public static XmlDocument GetAllADDomainUsers(string DomainPath)
{
string domain;
XmlDocument doc = new XmlDocument();
doc.LoadXml("<users/>");
XmlElement elem;

DirectoryEntry searchRoot;

ArrayList allUsers = new ArrayList();

if (DomainPath.Length == 0)
{
DirectoryEntry entryRoot = new DirectoryEntry("LDAP://RootDSE");
domain = entryRoot.Properties["defaultNamingContext"][0].ToString();
}
else
domain = DomainPath;

searchRoot = new DirectoryEntry("LDAP://" + domain);

DirectorySearcher search = new DirectorySearcher(searchRoot);
search.Filter = "(&(objectClass=user)(objectCategory=person))";
search.PropertiesToLoad.Add("samaccountname");
search.PropertiesToLoad.Add("distinguishedname");
search.Sort.PropertyName = "samaccountname";
search.Sort.Direction = SortDirection.Ascending;

SearchResult result;
SearchResultCollection resultCol = search.FindAll();
if (resultCol != null)
{
for(int counter=0; counter < resultCol.Count; counter++)
{
result = resultCol[counter];
if (result.Properties.Contains("samaccountname"))
{
elem = doc.CreateElement("user");
doc.DocumentElement.AppendChild(elem);
elem.SetAttribute("name", (String)result.Properties["samaccountname"][0]);
elem.SetAttribute("distinguishedName", (String)result.Properties["distinguishedname"][0]);
}
}
}
return doc;
}


This works for listing the names but how do I get the NetBIOS domain name for a selected user as required by SqlServer? I have tried using TranslateName from secur32.dll. That works on some machines but for some reason on other machines, it returns a blank. Is there another way?

Thanks for your help,
Rob

View 3 Replies View Related

Changing Object Owner Syntax

Jul 20, 2005

Hi there,We have a user name convention here that specifies users in thefollowing way:jane.doejohn.smithIn order to change a database object I must specify the owner name alongwith the object name. Does anyone know the proper syntax for doing thiswith a user name that contains a period? When I put the user namefollowed by the object name in quotes such as 'jane.doe.tb_test_table',SQL Server can not find the object.Any help is appreciated.Kelly

View 1 Replies View Related

Adding A User/role To All User Database

Jan 23, 2001

Hi everyone,

I try to add a db_role or a user to all my databases with one script. Although parsing doesn't report any problem I get a Syntax error during execution.
I first select the database names into a #temp table which has two columns, ID and dbname.
After that I use the following code:

DECLARE @Count smallint
declare @dbVarchar(20)

SET @Count = 1

WHILE (@Count <=(SELECT MAX(ID) FROM #temp))

BEGIN

Exec ("USE @db")

EXEC sp_adduser 'test'
EXEC sp_addrolemember 'my_role', 'testrole'


SET @COUNT = @COUNT + 1
SET @db = (SELECT dbname FROM #temp WHERE ID = @Count)
END

It seems that the "Use @db" part has no value for the variable @db.
Does anybody knows how to solve this?

View 1 Replies View Related

Changing User Domain

Feb 12, 2001

My SQL servers are using integrated windows nt security. Our user account is changing to a new domain. Is there an easy way to change the server logins to point to the new domain instead of removing the user and adding a new login from the new domain.

View 1 Replies View Related

Domain User Groups

Mar 25, 2004

Hi

Im currently working on a intranet and trying to set up some security. The intranet acesses a SQL server 2000 database. I would like to know if there is a stored procedure(or other way) of returning all the domain groups that a user belongs to when passed the users NT login. I found xp_enumgroups which returns all the groups on the domain and also xp_logininfo which returns the users of a passed domain group. These are usful but i need to just pass the NT username and return all the Domain Groups. Any thoughts, ideas would be great!

Cheers

View 1 Replies View Related

Password For The Domain User

Apr 7, 2004

My SQL Server is running as a Domain user account and it asked me to enter the password for thr Domain user account when I was changing the Startup account from Local to Domain user.
My QUESTION here is:
Is there a way or command for me to change the password automatically on the Services account, if I change the password for the Domain User account/.

View 5 Replies View Related

Domain User Account

Nov 3, 2006

New to SQL Server. Plan to install SQL Server 2005 standard edition on Windows 2k3. After searched a lot of places, still don't understand what exactly "domain user account" is. Could someone explain it to me?
1. Is this a OS account where SQL Server is running?
2. Or, is this an account under domain controller on other machine? Is this an account on DNS srver? How do I create it?
3. Or, is this an account in SQL Server?

Where is this account located? How do I manage it?

TIA.

View 4 Replies View Related

Changing The Domain User Password

Apr 8, 2004

Is there an automatic way of changing the Domain user password getting used for running the SQL Server as a Domain user account? I'm taking about EM---Security----Domain User name and the password getting used for running the SQL Server?

View 1 Replies View Related

Domain User Access Check

Jun 20, 2008

How to find out whether a domain user has access to sql server or not?

Many domain groups have access to my sql server. I need to check whether a user has access to server or not.

Probably I need to check which windows group the user belongs. This looks more like an o/s question than DB. How do you guys manage this scenario?


------------------------
I think, therefore I am - Rene Descartes

View 4 Replies View Related

Permissions For Domain User Account

Jun 8, 2007

Hi,
I want to use a domain user account not belonging to local admin or domain admin groups in SQL 2000/2005 Enterprise edition. This is what I've done so far..
On the machine that is the Domain Controller:
- installed SQL 2005 as a domain admin

- created a domain user account using Active Directory Users and Computers. This user is only


"Member of" domain users; not any Administrators group.


- added this user to SQL Server Management Studio->Logins and in Server Roles assigned


sysadmin role.
Question 1: Do I need to give any additional permissions to this user to work with SQL?
Question 2: How can I test this user for basic SQL operations like database creation? Can I use Osql?
Question 3: Can I use this user account to login to my domain controller using remote desktop? I tried adding this user to remote users, but in vain.



Thanks!

View 3 Replies View Related

Domain - User Data Types

Apr 22, 2006

Hi,
I'm new in MS SQL Server; comming from Firebird and PostgreSQL. I'm trying to import the SQL Script of a database I have in PostgreSQL 8; one basic SQL functionality is the "domain", as the way to create a user datatype; in my database I have one basic domain: OID:

CREATE DOMAIN dom_oid AS numeric(18,0) DEFAULT nextval('oid_secuence');

Is there a similar way to create this kind of types in SQL Server?

Thank you,
Guillermo

View 1 Replies View Related

Syntax Error In Accessing An Object (table Value Function)

Aug 29, 2007

I am trying to access data from a database to print a report. The code I am using says I have a syntax error regarding the object person_info. Person_Info is a table value function on the SQL Server (2005). Does anybody see a problem with this line of code? Thanks for your help! Regards, Steve
 "INNER JOIN (SELECT * Person_Info FROM (" & Session("current_project") & ")) ON pc.personID_fk=pe.personID_pk " & _
 

View 4 Replies View Related

Login Failed For User &<DOMAIN&>&<MACHINE&>$'

Apr 4, 2003

Folks,

I have read the posts concerning login failures for the ASPNET user. I have a slightly different problem, as you can see from the title of this post.

My environment is a private domain that has two machines:

1) Windows 2000 server on which SQL Server is running. Let's call it FOO_SERVER.

2) Windows XP Professional on which I am running my IIS and .NET development environment. Let's call it FOO_WORK.

3) Let's call the domain, FOO_DOMAIN.

The user, ASPNET, is not a domain user, but a local user, so I do not know how to establish it as a valid login for SQL Server. But this is beside the point, anyway, as the error I am getting has nothing to do with the ASPNET user. It appears that a different username is being used to access SQL Server.

My connection string is:

"server=FOO_SERVER;database=pubs;Trusted_Connection=yes"

The error I receive is:

"Login failed for user FOO_DOMAINFOO_WORK$"

I am using the default settings in machine.config. Specifically <processModel> userName="machine" password="AutoGenerate" </processModel>

Thanks in advance for any suggestions.

-Joel

View 5 Replies View Related

ASPNET User With Network Resources Elsewhere On A Domain

Dec 6, 2004

I've been trying to workout how, without impersonation, I can allow an application running under the default ASPNET user to access a network resource (SQL Server/ADAM) not on the same physical machine.

It seems that because the ASPNET user is a local user not a domain user I can't setup windows authentication on the network resource. That seems to leave impersonation which MS et al say is unwise.

Have I mised something here?

Regards,

Steve.

View 1 Replies View Related

Domain Change (User Logins Broken)

Jan 22, 2008

Is there a way to change a logins based on domain users, we just changed domains so all the domainlogin logins are not working anymore. Do I have to reapply every security on every database object? There has to be a fix for this, its a common thing.

Any help is greatly appreciated, everything i googled applied to SQL Server 2000 and system tables that dont exist in 2005

View 3 Replies View Related

Domain User Or Local System Account ?

Jul 20, 2005

Hello,My server is part of a W2K domain. What do you advice me as account torun my SQL*Server, service started with a domain user account or aslocal system ?I need advices from a security point of view.Thank's in advance

View 4 Replies View Related

Problem In Report Viewing By User Not From Domain

May 25, 2007

I m facing problem in order to publish my reports on the web. the anonymous person will not be able to see my reports, I do not why might be Reporting service restriction for anonymous person. My reports can only see by the person who are my domain user. I want to publish these reports to web. Can you please help me and tell me how to permit anonymous person to view my reports on the web out side domain


Many thanks

View 2 Replies View Related

SA Login Fails Under Domain User Context

Nov 2, 2015

I have setup a SQL 2014 server with mixed authentication. Below is sequence.

1. Created a server. Added server to a domain & logged out.

2. RDP to the server using a local account. Installed SQL 2014. Kept the services to run using default NT Authority accounts during initial setup. SQL was installed in mixed mode (SQL & windows authentication). a specific 'sa' pwd was set.

3. After initial setup, I changed all SQL services Logon account to be respective domain accounts. Made sure all services restarted, up & running.

Now, for the same 'sa' SQL login account -

--> if I RDP to the server using local system admin & connect to SQL studio with 'sa' (SQL authentication) - it works.
but --> if I RDP to the server using my domain account (which is already an admin on SQL & windows), but connect SQL studio with the Same 'sa' (SQL authentication) - it fails & gives - unable to login 'sa'... ; standard error code : 18456.

Question : How can be the same 'sa' login, is acting different based on with what user context I RDP to the server ?

View 3 Replies View Related

Login Failed For User '&&<DOMAIN&&>&&<COMPUTER&&>$'

May 20, 2008



In an attempt to improve security for our web server/db server setup, we have a SQL Server 2005 server set for Windows authentication only and a web server (both behind a firewall together on a single local domain).

The web server is using IIS7, and the default NetworkService account to run the ASP.NET processes.

I've given the NT AUTHORITYNETWORK SERVICE account access to the database in question.

The SQL authentication fails, but the account failing is NOT the NetworkService account, but the <DOMAIN><COMPUTER>$ account.

Note that if I use identity impersonation with a specific domain account, I can get the app to work. However, I do NOT want to use impersonation, I want the default NetworkService account to work.

Does anyone know why IIS, which is supposed to be using NetworkService, is instead using the <DOMAIN><COMPUTER>$ account to connect to SQL, which is then failing?

JK

View 4 Replies View Related

Odbc Errors After Joining New Domain With New User

Jun 14, 2007

Hi



I am new to this forum so I hope I have got the right one.



The problem I am having is I installed a new server into an office with 25 users. I joined the users to the new domain with new logins.



The server process then installed outlook 2003 onto each machine. Most machines are windows 2000



Problems arose in sage I have tied this down to the report designer and odbc.



On every machine bar 1 the report designer crashed when running a report. The problem like I said was that you cannot now connect to the odbc driver for sage and when you go into odbcad and try to look at the driver you get an error saying



The setup routines for the sage line 50 odbc driver could not be loaded due to system error 127



Then after that comes



Could not load the setup or translator library



I have looked on the net for this error and it tells you to look in the registry to make sure that the odbcinst is pointing to the correct location, I have checked this and it is. I ahve also checked the security and this seems ok aswell.



The next step was I loaded a fresh copy of windows 2000 into a new folder and tried to load the odbc driver again. This failed with the same as above.



This points to the software settings but I cannot find out where.



Iwas wondering if anyone has had the same problem and they could point me in the right direction.

View 4 Replies View Related

Login Failed For User &&<&&<domain&&>&&>&&<&&<server Name&&>&&>$

Aug 2, 2005

 am working on asp application which basically is an interface to the report server. I am currently unable to determine the source of the problem so it may have nothing to do with reporting services.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved