Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

Wednesday, March 28, 2012

Problems with SQLXML bulk load

Hi all,

I am newbie in all the stuff about xml importing into sql server.

What I try to do is simple. It is take an xml file and drop it into a
table. I am using VS2005, SQLXML 4.0 and SQL Server 2000 (I think
there is no problem of compatibility)

When I run my program using the SQLXMLBulkLoad4Class class,
everythings seems to run perfect and there is no errors. But when I
check my DB there isnt any record inserted.

My schema is:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="table1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ele1" type="xsd:string"/>
<xsd:element name="ele2" type="xsd:string"/>
<xsd:element name="ele3" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

My xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ENGROLE>
<EROLE>
<ele1>dieg01p</ele1>
<ele2>IE01</ele2>
<ele3>IEL01</ele3>
</EROLE>
.
.
.
</ENGROLE>

and my table definition where I try to insert:

CREATE TABLE [dbo].[table1](
[ele1] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ele2] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ele3] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
) ON [PRIMARY]

As you see it is very simple, but I cannot get it work. Can anyone
give a hand?

Thanks!!If your data is involved in a DataSet, try to use
SQLBulkCopy class.|||It is not. I receive the data from a process that generates the data into XML format, and I cannot change the process.|||Try also to post the question on the .Net forum, you may get the right answer quicker.|||Ok, thanks!

Monday, March 26, 2012

Problems with sp_droplogin in SQL 2005

I have a script that must run in both SQL 2005 and SQL 2000. So beforehand,I want to tell
that I cannot use "DROP LOGIN" since SQL 2000 does not support it.
The SQL 2005 documentation states that "sp_droplogin" calls "DROP LOGIN"
I'm currently logon on the SQL server (DEVDSL1) using the local administrator account.
When I attempt to run:
EXEC sp_droplogin [DEVDSL1\LCL ADS Service]
I receive the following error message:
Msg 15007, Level 16, State 1, Procedure sp_droplogin, Line 26
'DEVDSL1\LCL ADS Service' is not a valid login or you do not have permission.
However the statement "DROP LOGIN [DEVDSL1\LCL ADS Service]" works no problem.
What could possibly be the rason why "sp_droplogin" do not work?
> What could possibly be the rason why "sp_droplogin" do not work?
sp_drop_login is intended to be use only be used for SQL-authenticated
logins, although SQL 2000 apparently didn't enforce the requirement. Use
sp_revokelogin to remove Windows-authenticated logins. That should work in
both versions.
Hope this helps.
Dan Guzman
SQL Server MVP
"Gaetan Simard" <gaetan.simard@.eds.com> wrote in message
news:ms1fv19mkrc8m9ri54st01bv3crc8901n8@.4ax.com...
>I have a script that must run in both SQL 2005 and SQL 2000. So
>beforehand,I want to tell
> that I cannot use "DROP LOGIN" since SQL 2000 does not support it.
> The SQL 2005 documentation states that "sp_droplogin" calls "DROP LOGIN"
> I'm currently logon on the SQL server (DEVDSL1) using the local
> administrator account.
> When I attempt to run:
> EXEC sp_droplogin [DEVDSL1\LCL ADS Service]
> I receive the following error message:
> Msg 15007, Level 16, State 1, Procedure sp_droplogin, Line 26
> 'DEVDSL1\LCL ADS Service' is not a valid login or you do not have
> permission.
> However the statement "DROP LOGIN [DEVDSL1\LCL ADS Service]" works no
> problem.
>

Problems with sp_droplogin in SQL 2005

I have a script that must run in both SQL 2005 and SQL 2000. So beforehand,I
want to tell
that I cannot use "DROP LOGIN" since SQL 2000 does not support it.
The SQL 2005 documentation states that "sp_droplogin" calls "DROP LOGIN"
I'm currently logon on the SQL server (DEVDSL1) using the local administrato
r account.
When I attempt to run:
EXEC sp_droplogin [DEVDSL1\LCL ADS Service]
I receive the following error message:
Msg 15007, Level 16, State 1, Procedure sp_droplogin, Line 26
'DEVDSL1\LCL ADS Service' is not a valid login or you do not have permission
.
However the statement "DROP LOGIN [DEVDSL1\LCL ADS Service]" works no pr
oblem.
What could possibly be the rason why "sp_droplogin" do not work?> What could possibly be the rason why "sp_droplogin" do not work?
sp_drop_login is intended to be use only be used for SQL-authenticated
logins, although SQL 2000 apparently didn't enforce the requirement. Use
sp_revokelogin to remove Windows-authenticated logins. That should work in
both versions.
Hope this helps.
Dan Guzman
SQL Server MVP
"Gaetan Simard" <gaetan.simard@.eds.com> wrote in message
news:ms1fv19mkrc8m9ri54st01bv3crc8901n8@.
4ax.com...
>I have a script that must run in both SQL 2005 and SQL 2000. So
>beforehand,I want to tell
> that I cannot use "DROP LOGIN" since SQL 2000 does not support it.
> The SQL 2005 documentation states that "sp_droplogin" calls "DROP LOGIN"
> I'm currently logon on the SQL server (DEVDSL1) using the local
> administrator account.
> When I attempt to run:
> EXEC sp_droplogin [DEVDSL1\LCL ADS Service]
> I receive the following error message:
> Msg 15007, Level 16, State 1, Procedure sp_droplogin, Line 26
> 'DEVDSL1\LCL ADS Service' is not a valid login or you do not have
> permission.
> However the statement "DROP LOGIN [DEVDSL1\LCL ADS Service]" works no
> problem.
>

Problems with sp_droplogin in SQL 2005

I have a script that must run in both SQL 2005 and SQL 2000. So beforehand,I want to tell
that I cannot use "DROP LOGIN" since SQL 2000 does not support it.
The SQL 2005 documentation states that "sp_droplogin" calls "DROP LOGIN"
I'm currently logon on the SQL server (DEVDSL1) using the local administrator account.
When I attempt to run:
EXEC sp_droplogin [DEVDSL1\LCL ADS Service]
I receive the following error message:
Msg 15007, Level 16, State 1, Procedure sp_droplogin, Line 26
'DEVDSL1\LCL ADS Service' is not a valid login or you do not have permission.
However the statement "DROP LOGIN [DEVDSL1\LCL ADS Service]" works no problem.
What could possibly be the rason why "sp_droplogin" do not work?> What could possibly be the rason why "sp_droplogin" do not work?
sp_drop_login is intended to be use only be used for SQL-authenticated
logins, although SQL 2000 apparently didn't enforce the requirement. Use
sp_revokelogin to remove Windows-authenticated logins. That should work in
both versions.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Gaetan Simard" <gaetan.simard@.eds.com> wrote in message
news:ms1fv19mkrc8m9ri54st01bv3crc8901n8@.4ax.com...
>I have a script that must run in both SQL 2005 and SQL 2000. So
>beforehand,I want to tell
> that I cannot use "DROP LOGIN" since SQL 2000 does not support it.
> The SQL 2005 documentation states that "sp_droplogin" calls "DROP LOGIN"
> I'm currently logon on the SQL server (DEVDSL1) using the local
> administrator account.
> When I attempt to run:
> EXEC sp_droplogin [DEVDSL1\LCL ADS Service]
> I receive the following error message:
> Msg 15007, Level 16, State 1, Procedure sp_droplogin, Line 26
> 'DEVDSL1\LCL ADS Service' is not a valid login or you do not have
> permission.
> However the statement "DROP LOGIN [DEVDSL1\LCL ADS Service]" works no
> problem.
>