显示标签为“ihave”的博文。显示所有博文
显示标签为“ihave”的博文。显示所有博文

2012年2月23日星期四

Bcp and Bulk Insert not working

Hello,

I have been trying to load a delimited data file to SQL Server. I
have tried both of the options that are available: each time, I get
different errors. This is on an eval version of SQL Server 2K, with
SP 3a on a Windows XP box.

First, I tried to load the data with Bulk Insert. This didn't go
through as it requires sysadmin/bulkadmin privileges. I am the only
person using the SQL Server, and I wanted to grant myself those
privileges. But I cannot find them using the Enterprise Manager. All
I see is privileges like datareader, datawriter, etc.

Then I tried to use bcp. This doesn't seem to work either as it gives
the following error:

ERROR: DB Code: (CR001): SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does
not exist or access denied.
SQLState = 01000, NativeError = 53
Warning = [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen
(Connect()).
child process exited abnormally

Anybody with a solution to make this work? For reference, I am using
the following bcp command. I can login to the database using the
server/user/password combination with no problem:

C:/Program Files/Microsoft SQL Server/80/Tools/Binn/bcp.exe
testUser.products
IN
"C:/Documents and Settings/testUser/products.txt"
-f "C:/Documents and Settings/testUser/prodformat.txt"
-t "-" -r "\r\n"
-S"sqlserver_eval" -U"testUser" -P"password" -R -k -h TABLOCK"php newbie" <newtophp2000@.yahoo.com> wrote in message
news:124f428e.0406150753.42e65c9b@.posting.google.c om...
> Hello,
> I have been trying to load a delimited data file to SQL Server. I
> have tried both of the options that are available: each time, I get
> different errors. This is on an eval version of SQL Server 2K, with
> SP 3a on a Windows XP box.
> First, I tried to load the data with Bulk Insert. This didn't go
> through as it requires sysadmin/bulkadmin privileges. I am the only
> person using the SQL Server, and I wanted to grant myself those
> privileges. But I cannot find them using the Enterprise Manager. All
> I see is privileges like datareader, datawriter, etc.
> Then I tried to use bcp. This doesn't seem to work either as it gives
> the following error:
> ERROR: DB Code: (CR001): SQLState = 08001, NativeError = 17
> Error = [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does
> not exist or access denied.
> SQLState = 01000, NativeError = 53
> Warning = [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen
> (Connect()).
> child process exited abnormally
>
> Anybody with a solution to make this work? For reference, I am using
> the following bcp command. I can login to the database using the
> server/user/password combination with no problem:
> C:/Program Files/Microsoft SQL Server/80/Tools/Binn/bcp.exe
> testUser.products
> IN
> "C:/Documents and Settings/testUser/products.txt"
> -f "C:/Documents and Settings/testUser/prodformat.txt"
> -t "-" -r "\r\n"
> -S"sqlserver_eval" -U"testUser" -P"password" -R -k -h TABLOCK

Regarding the bulkadmin role, it sounds like you may be looking at database
roles, not server roles - bulkadmin is in EM under Security, Server Roles.
If you can't access it there, then you're not connected as a sysadmin, so
you should connect as a sysadmin and add testUser to that role.

As for the connection issue, there are a few possible reasons - see "Client-
or Application-Related Causes" in this article:

http://support.microsoft.com/defaul...KB;EN-US;328306

If the article doesn't help to resolve your issue, I suggest you post again
with some more information, in particular if your XP box is on a network or
not, which protocols you configured the server to listen on (see Server
Network Utility), and which tools you have successfully connected to the
server with as testUser (eg. Query Analyzer, osql.exe).

Simon|||another thing to try is to create a DTS package to insert the data for
you.
1.) connect to the server with a login, pw
2.) select file(source)
3.) highlight both, left click onthe server icon, and pick "transform
data".
4.) double click on teh blue line
5.) verify tab one is pointing to the text file. hit preview to verify
that it will insert as desired. if not, go to properties of text file
icon.
6.) create table by "create table from source"
7.) make sure each column is represented and has an arrow pointing to
each other.
click on go.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

2012年2月12日星期日

Bastion Host running SQL server 2000

I'm experimenting with a bastion host running SQL server. I have
implemented the SQL server bastion inf from the W2K3 security guide and i
have an issue logging in with a member of the local administrators group. I
guess the lookup of group membership is somehow disabled. Does anyone know
the setting that allows this?
Thank youI'm not sure what you mean by:
"I guess the lookup of group membership is somehow disabled. Does anyone
know
the setting that allows this?"
The account that starts the MSSQLServer doen't need to be an admin account.
What account are you logging into the machine with?
What NT groups does it belong to?
Are you referring to Group Membership contained in Logins?
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||Thanks for your reply,
The local admin on the server (W2K3) does not have an SQL login individually
but does have one due to it's membership of the BUILTIN\ADMINISTRATORS
group. Loging in to the server does not grant me access to SQL server (EM,
QA). When I log in with a local account created as the service account for
SQL server and that is a member of the BUILTIN\ADMINISTRATORS and also has
an individual mamping to an SQL server login works just fine. So somehow
windows can't figure out and tell SQL server that the local admin account is
a member of the BUILTIN\ADMINISTRATORS group. The only problem I have with
this reasoning is that if Windows can't tell SQL server that, how come I
knows it's the local admin for the machine? Purely on the SID so that it
doesn't even bother looking up the group memberships ...? The error I get
is as follows:
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL
erver connection."
The user is 'null', so that means that Windows could not pass the
authentication through and the failure is occurring in windows not SQL
Server.
So my gues is that their is an issue with the Security Acount Mananger
Service or another security related service or a registry setting in the
.inf file of the W2K3 security guide. I've noticed that some user right
assignments that are neccessary for SQL server to work had to be enabled
(log on as a service etc ...) but I'm still looking for a solution for this
one. Funny thing is, we normally would remove the BUILTIN\ADMINISTRATORS
from SQL server but I first want to figure out the reason of this behaviour.
Best regards
Kevin McDonnell [MSFT]" <kevmc@.online.microsoft.com> wrote in message
news:ty$5a2nvDHA.2332@.cpmsftngxa07.phx.gbl...
quote:

> I'm not sure what you mean by:
> "I guess the lookup of group membership is somehow disabled. Does anyone
> know
> the setting that allows this?"
> The account that starts the MSSQLServer doen't need to be an admin

account.
quote:

> What account are you logging into the machine with?
> What NT groups does it belong to?
> Are you referring to Group Membership contained in Logins?
>
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>
|||Hi John,
///
-from prev thread-
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL
erver connection."
The user is 'null', so that means that Windows could not pass the
authentication through and the failure is occurring in windows not SQL
Server.
///
Exactly. What I would check first to see if the client has any aliases
defined. You can review this using
the Client Network Utility or check the local registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\Client\ConnectTo
You should have an entry that says; DSQUERY: REG_SZ: DBNETLIB
If there are any others, remove them and retest.
If that still doesn't work, try forcing a Named Pipe connection, by
creating one alias specifying Named Pipes.
Hope this helps
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.