Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Sunday, March 25, 2012

bulk insert vs CLR stored proc doing transactioned insert

I have 1) a windows application (which was the test bed used for
building this code) that takes some data and expands them into much
larger datasets and inserts them into another table. An input table of
81 rows produces 12,000 resulting rows. I then created a CLR Stored
procedure to do the equivalent task, based on this code,which rather
than using the bulk insert, creates inserts within a transaction.
The windows application completes this operation in 1.9 secs on
average.
The CLR stored procedure completes this operation in 3.2 secs on
average.
I want to optimise this as much as possible, as it is a crucial
operation processing large amounts of data (30 million rows output/
day) - is it possible to re-produce the bulk insert type performance
levels achieved by the vanilla .net Win app within a CLR stored
procedure? I realise bulk insert is highly optimised, but i would be
disappointed if it were not to produce better performance from a CLR
stored procedure running within the sql server context.
Thanks for reading.
easyfx,
Actually, there is no reason to expect the CLR to be faster than an
optimized special purpose statement like BULK INSERT. In general, for data
intensive work the CLR is not as fast as pure T-SQL.
The CLR is best used for things that are difficult in TSQL. See the
following article for a brief discussion:
http://www.microsoft.com/technet/technetmag/issues/2006/01/BoostPerformance/default.aspx
RLF
"easyfx" <easyforexsignals@.gmail.com> wrote in message
news:1174984934.074902.172730@.o5g2000hsb.googlegro ups.com...
>I have 1) a windows application (which was the test bed used for
> building this code) that takes some data and expands them into much
> larger datasets and inserts them into another table. An input table of
> 81 rows produces 12,000 resulting rows. I then created a CLR Stored
> procedure to do the equivalent task, based on this code,which rather
> than using the bulk insert, creates inserts within a transaction.
> The windows application completes this operation in 1.9 secs on
> average.
> The CLR stored procedure completes this operation in 3.2 secs on
> average.
> I want to optimise this as much as possible, as it is a crucial
> operation processing large amounts of data (30 million rows output/
> day) - is it possible to re-produce the bulk insert type performance
> levels achieved by the vanilla .net Win app within a CLR stored
> procedure? I realise bulk insert is highly optimised, but i would be
> disappointed if it were not to produce better performance from a CLR
> stored procedure running within the sql server context.
> Thanks for reading.
>
|||"easyfx" <easyforexsignals@.gmail.com> wrote in message
news:1174984934.074902.172730@.o5g2000hsb.googlegro ups.com...
>I have 1) a windows application (which was the test bed used for
> building this code) that takes some data and expands them into much
> larger datasets and inserts them into another table. An input table of
> 81 rows produces 12,000 resulting rows. I then created a CLR Stored
> procedure to do the equivalent task, based on this code,which rather
> than using the bulk insert, creates inserts within a transaction.
> The windows application completes this operation in 1.9 secs on
> average.
> The CLR stored procedure completes this operation in 3.2 secs on
> average.
> I want to optimise this as much as possible, as it is a crucial
> operation processing large amounts of data (30 million rows output/
> day) - is it possible to re-produce the bulk insert type performance
> levels achieved by the vanilla .net Win app within a CLR stored
> procedure? I realise bulk insert is highly optimised, but i would be
> disappointed if it were not to produce better performance from a CLR
> stored procedure running within the sql server context.
>
Well considering that Bulk Insert was written by the same team that wrote
the engine, has survived a lot of optimizations, I suspect you'll have a
hard time matching its performance.
Why not use bulk insert itself?

> Thanks for reading.
>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

bulk insert vs CLR stored proc doing transactioned insert

I have 1) a windows application (which was the test bed used for
building this code) that takes some data and expands them into much
larger datasets and inserts them into another table. An input table of
81 rows produces 12,000 resulting rows. I then created a CLR Stored
procedure to do the equivalent task, based on this code,which rather
than using the bulk insert, creates inserts within a transaction.
The windows application completes this operation in 1.9 secs on
average.
The CLR stored procedure completes this operation in 3.2 secs on
average.
I want to optimise this as much as possible, as it is a crucial
operation processing large amounts of data (30 million rows output/
day) - is it possible to re-produce the bulk insert type performance
levels achieved by the vanilla .net Win app within a CLR stored
procedure? I realise bulk insert is highly optimised, but i would be
disappointed if it were not to produce better performance from a CLR
stored procedure running within the sql server context.
Thanks for reading.easyfx,
Actually, there is no reason to expect the CLR to be faster than an
optimized special purpose statement like BULK INSERT. In general, for data
intensive work the CLR is not as fast as pure T-SQL.
The CLR is best used for things that are difficult in TSQL. See the
following article for a brief discussion:
http://www.microsoft.com/technet/technetmag/issues/2006/01/BoostPerformance/default.aspx
RLF
"easyfx" <easyforexsignals@.gmail.com> wrote in message
news:1174984934.074902.172730@.o5g2000hsb.googlegroups.com...
>I have 1) a windows application (which was the test bed used for
> building this code) that takes some data and expands them into much
> larger datasets and inserts them into another table. An input table of
> 81 rows produces 12,000 resulting rows. I then created a CLR Stored
> procedure to do the equivalent task, based on this code,which rather
> than using the bulk insert, creates inserts within a transaction.
> The windows application completes this operation in 1.9 secs on
> average.
> The CLR stored procedure completes this operation in 3.2 secs on
> average.
> I want to optimise this as much as possible, as it is a crucial
> operation processing large amounts of data (30 million rows output/
> day) - is it possible to re-produce the bulk insert type performance
> levels achieved by the vanilla .net Win app within a CLR stored
> procedure? I realise bulk insert is highly optimised, but i would be
> disappointed if it were not to produce better performance from a CLR
> stored procedure running within the sql server context.
> Thanks for reading.
>|||"easyfx" <easyforexsignals@.gmail.com> wrote in message
news:1174984934.074902.172730@.o5g2000hsb.googlegroups.com...
>I have 1) a windows application (which was the test bed used for
> building this code) that takes some data and expands them into much
> larger datasets and inserts them into another table. An input table of
> 81 rows produces 12,000 resulting rows. I then created a CLR Stored
> procedure to do the equivalent task, based on this code,which rather
> than using the bulk insert, creates inserts within a transaction.
> The windows application completes this operation in 1.9 secs on
> average.
> The CLR stored procedure completes this operation in 3.2 secs on
> average.
> I want to optimise this as much as possible, as it is a crucial
> operation processing large amounts of data (30 million rows output/
> day) - is it possible to re-produce the bulk insert type performance
> levels achieved by the vanilla .net Win app within a CLR stored
> procedure? I realise bulk insert is highly optimised, but i would be
> disappointed if it were not to produce better performance from a CLR
> stored procedure running within the sql server context.
>
Well considering that Bulk Insert was written by the same team that wrote
the engine, has survived a lot of optimizations, I suspect you'll have a
hard time matching its performance.
Why not use bulk insert itself?
> Thanks for reading.
>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

bulk insert vs CLR stored proc doing transactioned insert

I have 1) a windows application (which was the test bed used for
building this code) that takes some data and expands them into much
larger datasets and inserts them into another table. An input table of
81 rows produces 12,000 resulting rows. I then created a CLR Stored
procedure to do the equivalent task, based on this code,which rather
than using the bulk insert, creates inserts within a transaction.
The windows application completes this operation in 1.9 secs on
average.
The CLR stored procedure completes this operation in 3.2 secs on
average.
I want to optimise this as much as possible, as it is a crucial
operation processing large amounts of data (30 million rows output/
day) - is it possible to re-produce the bulk insert type performance
levels achieved by the vanilla .net Win app within a CLR stored
procedure? I realise bulk insert is highly optimised, but i would be
disappointed if it were not to produce better performance from a CLR
stored procedure running within the sql server context.
Thanks for reading.easyfx,
Actually, there is no reason to expect the CLR to be faster than an
optimized special purpose statement like BULK INSERT. In general, for data
intensive work the CLR is not as fast as pure T-SQL.
The CLR is best used for things that are difficult in TSQL. See the
following article for a brief discussion:
http://www.microsoft.com/technet/te...l
t.aspx
RLF
"easyfx" <easyforexsignals@.gmail.com> wrote in message
news:1174984934.074902.172730@.o5g2000hsb.googlegroups.com...
>I have 1) a windows application (which was the test bed used for
> building this code) that takes some data and expands them into much
> larger datasets and inserts them into another table. An input table of
> 81 rows produces 12,000 resulting rows. I then created a CLR Stored
> procedure to do the equivalent task, based on this code,which rather
> than using the bulk insert, creates inserts within a transaction.
> The windows application completes this operation in 1.9 secs on
> average.
> The CLR stored procedure completes this operation in 3.2 secs on
> average.
> I want to optimise this as much as possible, as it is a crucial
> operation processing large amounts of data (30 million rows output/
> day) - is it possible to re-produce the bulk insert type performance
> levels achieved by the vanilla .net Win app within a CLR stored
> procedure? I realise bulk insert is highly optimised, but i would be
> disappointed if it were not to produce better performance from a CLR
> stored procedure running within the sql server context.
> Thanks for reading.
>|||"easyfx" <easyforexsignals@.gmail.com> wrote in message
news:1174984934.074902.172730@.o5g2000hsb.googlegroups.com...
>I have 1) a windows application (which was the test bed used for
> building this code) that takes some data and expands them into much
> larger datasets and inserts them into another table. An input table of
> 81 rows produces 12,000 resulting rows. I then created a CLR Stored
> procedure to do the equivalent task, based on this code,which rather
> than using the bulk insert, creates inserts within a transaction.
> The windows application completes this operation in 1.9 secs on
> average.
> The CLR stored procedure completes this operation in 3.2 secs on
> average.
> I want to optimise this as much as possible, as it is a crucial
> operation processing large amounts of data (30 million rows output/
> day) - is it possible to re-produce the bulk insert type performance
> levels achieved by the vanilla .net Win app within a CLR stored
> procedure? I realise bulk insert is highly optimised, but i would be
> disappointed if it were not to produce better performance from a CLR
> stored procedure running within the sql server context.
>
Well considering that Bulk Insert was written by the same team that wrote
the engine, has survived a lot of optimizations, I suspect you'll have a
hard time matching its performance.
Why not use bulk insert itself?

> Thanks for reading.
>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Thursday, March 22, 2012

Bulk insert silently does nothing

Hi.. I am using a simple bulk insert statement which works on all our
servers except one. The servers are windows 2000 and are running
Sql Server SP4.
The bulk insert statement simply does nothing.
In query analyser, it returns
"The command(s) completed successfully." and yet returns no rowcount, error
etc
There are no events in the event log and no errors in the sql log
DTS bulk insert happily completes without doing a thing.
bcp of the same file does work however (from the server ) ..
Can someone point me in the right direction regarding DLL's etc to be
checkig please ?
Thanks Dave
Did you try:
-o output_file
Specifies the name of a file that receives output from bcp redirected from
the command prompt.
"gilkida" <gilkida@.discussions.microsoft.com> wrote in message
news:894DB758-93BC-432D-8167-F05F83B2467C@.microsoft.com...
> Hi.. I am using a simple bulk insert statement which works on all our
> servers except one. The servers are windows 2000 and are running
> Sql Server SP4.
> The bulk insert statement simply does nothing.
> In query analyser, it returns
> "The command(s) completed successfully." and yet returns no rowcount,
> error
> etc
> There are no events in the event log and no errors in the sql log
> DTS bulk insert happily completes without doing a thing.
> bcp of the same file does work however (from the server ) ..
> Can someone point me in the right direction regarding DLL's etc to be
> checkig please ?
> Thanks Dave
|||Sorry Chris.. probably not clear.. I am running the Sql Command Bult Insert
BULK INSERT t_BulkLoad FROM 'Some Filename"
works on every server but one... t
"ChrisR" wrote:

> Did you try:
> -o output_file
> Specifies the name of a file that receives output from bcp redirected from
> the command prompt.
>
>
> "gilkida" <gilkida@.discussions.microsoft.com> wrote in message
> news:894DB758-93BC-432D-8167-F05F83B2467C@.microsoft.com...
>
>
|||Woops, sorry.
"gilkida" <gilkida@.discussions.microsoft.com> wrote in message
news:C20BE904-1DDD-4511-ADBD-11C98CB62A98@.microsoft.com...[vbcol=seagreen]
> Sorry Chris.. probably not clear.. I am running the Sql Command Bult
> Insert
> BULK INSERT t_BulkLoad FROM 'Some Filename"
> works on every server but one... t
>
> "ChrisR" wrote:
|||I have the same issue. I found this posted today.
http://support.microsoft.com/?kbid=896425
It says it's applicable to Standard Edition SP3, I too have Enterprise
Edition SP4 + hotfix.
"ChrisR" wrote:

> Woops, sorry.
>
> "gilkida" <gilkida@.discussions.microsoft.com> wrote in message
> news:C20BE904-1DDD-4511-ADBD-11C98CB62A98@.microsoft.com...
>
>

Bulk insert silently does nothing

Hi.. I am using a simple bulk insert statement which works on all our
servers except one. The servers are windows 2000 and are running
Sql Server SP4.
The bulk insert statement simply does nothing.
In query analyser, it returns
"The command(s) completed successfully." and yet returns no rowcount, error
etc
There are no events in the event log and no errors in the sql log
DTS bulk insert happily completes without doing a thing.
bcp of the same file does work however (from the server ) ..
Can someone point me in the right direction regarding DLL's etc to be
checkig please ?
Thanks DaveDid you try:
-o output_file
Specifies the name of a file that receives output from bcp redirected from
the command prompt.
"gilkida" <gilkida@.discussions.microsoft.com> wrote in message
news:894DB758-93BC-432D-8167-F05F83B2467C@.microsoft.com...
> Hi.. I am using a simple bulk insert statement which works on all our
> servers except one. The servers are windows 2000 and are running
> Sql Server SP4.
> The bulk insert statement simply does nothing.
> In query analyser, it returns
> "The command(s) completed successfully." and yet returns no rowcount,
> error
> etc
> There are no events in the event log and no errors in the sql log
> DTS bulk insert happily completes without doing a thing.
> bcp of the same file does work however (from the server ) ..
> Can someone point me in the right direction regarding DLL's etc to be
> checkig please ?
> Thanks Dave|||Sorry Chris.. probably not clear.. I am running the Sql Command Bult Insert
BULK INSERT t_BulkLoad FROM 'Some Filename"
works on every server but one... t
"ChrisR" wrote:
> Did you try:
> -o output_file
> Specifies the name of a file that receives output from bcp redirected from
> the command prompt.
>
>
> "gilkida" <gilkida@.discussions.microsoft.com> wrote in message
> news:894DB758-93BC-432D-8167-F05F83B2467C@.microsoft.com...
> > Hi.. I am using a simple bulk insert statement which works on all our
> > servers except one. The servers are windows 2000 and are running
> > Sql Server SP4.
> >
> > The bulk insert statement simply does nothing.
> >
> > In query analyser, it returns
> > "The command(s) completed successfully." and yet returns no rowcount,
> > error
> > etc
> >
> > There are no events in the event log and no errors in the sql log
> >
> > DTS bulk insert happily completes without doing a thing.
> > bcp of the same file does work however (from the server ) ..
> >
> > Can someone point me in the right direction regarding DLL's etc to be
> > checkig please ?
> >
> > Thanks Dave
>
>|||Woops, sorry.
"gilkida" <gilkida@.discussions.microsoft.com> wrote in message
news:C20BE904-1DDD-4511-ADBD-11C98CB62A98@.microsoft.com...
> Sorry Chris.. probably not clear.. I am running the Sql Command Bult
> Insert
> BULK INSERT t_BulkLoad FROM 'Some Filename"
> works on every server but one... t
>
> "ChrisR" wrote:
>> Did you try:
>> -o output_file
>> Specifies the name of a file that receives output from bcp redirected
>> from
>> the command prompt.
>>
>>
>> "gilkida" <gilkida@.discussions.microsoft.com> wrote in message
>> news:894DB758-93BC-432D-8167-F05F83B2467C@.microsoft.com...
>> > Hi.. I am using a simple bulk insert statement which works on all our
>> > servers except one. The servers are windows 2000 and are running
>> > Sql Server SP4.
>> >
>> > The bulk insert statement simply does nothing.
>> >
>> > In query analyser, it returns
>> > "The command(s) completed successfully." and yet returns no rowcount,
>> > error
>> > etc
>> >
>> > There are no events in the event log and no errors in the sql log
>> >
>> > DTS bulk insert happily completes without doing a thing.
>> > bcp of the same file does work however (from the server ) ..
>> >
>> > Can someone point me in the right direction regarding DLL's etc to be
>> > checkig please ?
>> >
>> > Thanks Dave
>>|||I have the same issue. I found this posted today.
http://support.microsoft.com/?kbid=896425
It says it's applicable to Standard Edition SP3, I too have Enterprise
Edition SP4 + hotfix.
"ChrisR" wrote:
> Woops, sorry.
>
> "gilkida" <gilkida@.discussions.microsoft.com> wrote in message
> news:C20BE904-1DDD-4511-ADBD-11C98CB62A98@.microsoft.com...
> > Sorry Chris.. probably not clear.. I am running the Sql Command Bult
> > Insert
> >
> > BULK INSERT t_BulkLoad FROM 'Some Filename"
> > works on every server but one... t
> >
> >
> > "ChrisR" wrote:
> >
> >> Did you try:
> >>
> >> -o output_file
> >>
> >> Specifies the name of a file that receives output from bcp redirected
> >> from
> >> the command prompt.
> >>
> >>
> >>
> >>
> >>
> >> "gilkida" <gilkida@.discussions.microsoft.com> wrote in message
> >> news:894DB758-93BC-432D-8167-F05F83B2467C@.microsoft.com...
> >> > Hi.. I am using a simple bulk insert statement which works on all our
> >> > servers except one. The servers are windows 2000 and are running
> >> > Sql Server SP4.
> >> >
> >> > The bulk insert statement simply does nothing.
> >> >
> >> > In query analyser, it returns
> >> > "The command(s) completed successfully." and yet returns no rowcount,
> >> > error
> >> > etc
> >> >
> >> > There are no events in the event log and no errors in the sql log
> >> >
> >> > DTS bulk insert happily completes without doing a thing.
> >> > bcp of the same file does work however (from the server ) ..
> >> >
> >> > Can someone point me in the right direction regarding DLL's etc to be
> >> > checkig please ?
> >> >
> >> > Thanks Dave
> >>
> >>
> >>
>
>

Bulk insert silently does nothing

Hi.. I am using a simple bulk insert statement which works on all our
servers except one. The servers are Windows 2000 and are running
Sql Server SP4.
The bulk insert statement simply does nothing.
In query analyser, it returns
"The command(s) completed successfully." and yet returns no rowcount, error
etc
There are no events in the event log and no errors in the sql log
DTS bulk insert happily completes without doing a thing.
bcp of the same file does work however (from the server ) ..
Can someone point me in the right direction regarding DLL's etc to be
checkig please ?
Thanks DaveDid you try:
-o output_file
Specifies the name of a file that receives output from bcp redirected from
the command prompt.
"gilkida" <gilkida@.discussions.microsoft.com> wrote in message
news:894DB758-93BC-432D-8167-F05F83B2467C@.microsoft.com...
> Hi.. I am using a simple bulk insert statement which works on all our
> servers except one. The servers are Windows 2000 and are running
> Sql Server SP4.
> The bulk insert statement simply does nothing.
> In query analyser, it returns
> "The command(s) completed successfully." and yet returns no rowcount,
> error
> etc
> There are no events in the event log and no errors in the sql log
> DTS bulk insert happily completes without doing a thing.
> bcp of the same file does work however (from the server ) ..
> Can someone point me in the right direction regarding DLL's etc to be
> checkig please ?
> Thanks Dave|||Sorry Chris.. probably not clear.. I am running the Sql Command Bult Insert
BULK INSERT t_BulkLoad FROM 'Some Filename"
works on every server but one... t
"ChrisR" wrote:

> Did you try:
> -o output_file
> Specifies the name of a file that receives output from bcp redirected from
> the command prompt.
>
>
> "gilkida" <gilkida@.discussions.microsoft.com> wrote in message
> news:894DB758-93BC-432D-8167-F05F83B2467C@.microsoft.com...
>
>|||Woops, sorry.
"gilkida" <gilkida@.discussions.microsoft.com> wrote in message
news:C20BE904-1DDD-4511-ADBD-11C98CB62A98@.microsoft.com...[vbcol=seagreen]
> Sorry Chris.. probably not clear.. I am running the Sql Command Bult
> Insert
> BULK INSERT t_BulkLoad FROM 'Some Filename"
> works on every server but one... t
>
> "ChrisR" wrote:
>|||I have the same issue. I found this posted today.
http://support.microsoft.com/?kbid=896425
It says it's applicable to Standard Edition SP3, I too have Enterprise
Edition SP4 + hotfix.
"ChrisR" wrote:

> Woops, sorry.
>
> "gilkida" <gilkida@.discussions.microsoft.com> wrote in message
> news:C20BE904-1DDD-4511-ADBD-11C98CB62A98@.microsoft.com...
>
>

Thursday, March 8, 2012

bulk insert fails

I'm setting up a new 2005 server and bulk insert from a client workstation (using windows authentication) is failing with:

Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "\\FILESERVERNAME\sharedfolder\filename.txt" could not be opened. Operating system error code 5(Access is denied.).

Here's my BULK INSERT statement (though I'm pretty sure there's nothing wrong with it):

BULK INSERT #FIRSTROW FROM '\\FILESERVERNAME\sharedfolder\filename.txt'
WITH (
DATAFILETYPE = 'char',
ROWTERMINATOR = '\n',
LASTROW = 1
)

If I run the same transact SQL when remote desktopped into the new server (under the same login as that used in the client workstation), it imports the file without errors.

If I use the sa client login from the client workstation (sql server authentication) the bulk insert succeeds.

My old SQL 2000 server lets me bulk insert the file without errors even from my client workstations using windows authentication.

I have followed the instructions on this site: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=928173&SiteID=1
, but still no luck and same error.

I'm pretty sure it is being caused by the increased constraints on bulk insert in 2005. Hoping someone can help. The more specific the better. If you need more info, let me know.

Oh and I've also made sure that the SQL service uses a domain logon account rather than the local system account (this would work on the 2000 server, but not 2005).

Note that the file server (source file resides there) is a DIFFERENT machine than the 2005 SQL server. If I move the source file to the sql server machine the error goes away (not a preferred solution though).


I'm almost positive that what I need to do is make sure that the SQL server is setup for delegation when a windows authenticated user attempts to bulk load a file from a second server.

Can someone provide instructions?



Thanks!

Can you access the file using thew full path \\FILESERVERNAME\sharedfolder\filename.txt ?

of course, with the user who execute the bulk insert.

Did you alread verify the share and NTFS permition?

|||Yes, I can access file. I have given both that user and the sql service user account full access.

Note that this user has no problem running the same bulk load from my old 2000 server.

I'm pretty sure that my user is not being delegated through to the file server.
Is there a way to catch the user information that BULK INSERT is using to access a file? A SQL trace doesn't catch it.

I'm not a windows system admin, so forgive my ignorance, but what's an ntfs permission? I thought NTFS was just the hard drive file system format.
.
Do you know how to setup delegation for users?

|||

When a told NTFS permission I,d mean the file system permission.

|||Yes, the user has full network and local permission to the file.
|||

Can you try to make lower the authentication level of NTLM protocol?

I saw this posts, try to verify your solution: http://forums.microsoft.com/msdn/showpost.aspx?postid=270868&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1

bulk insert fails

I'm setting up a new 2005 server and bulk insert from a client workstation (using windows authentication) is failing with:

Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "\\FILESERVERNAME\sharedfolder\filename.txt" could not be opened. Operating system error code 5(Access is denied.).

Here's my BULK INSERT statement (though I'm pretty sure there's nothing wrong with it):

BULK INSERT #FIRSTROW FROM '\\FILESERVERNAME\sharedfolder\filename.txt'
WITH (
DATAFILETYPE = 'char',
ROWTERMINATOR = '\n',
LASTROW = 1
)

If I run the same transact SQL when remote desktopped into the new server (under the same login as that used in the client workstation), it imports the file without errors.

If I use the sa client login from the client workstation (sql server authentication) the bulk insert succeeds.

My old SQL 2000 server lets me bulk insert the file without errors even from my client workstations using windows authentication.

I have followed the instructions on this site: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=928173&SiteID=1
, but still no luck and same error.

I'm pretty sure it is being caused by the increased constraints on bulk insert in 2005. Hoping someone can help. The more specific the better. If you need more info, let me know.

Oh and I've also made sure that the SQL service uses a domain logon account rather than the local system account (this would work on the 2000 server, but not 2005).

Note that the file server (source file resides there) is a DIFFERENT machine than the 2005 SQL server. If I move the source file to the sql server machine the error goes away (not a preferred solution though).


I'm almost positive that what I need to do is make sure that the SQL server is setup for delegation when a windows authenticated user attempts to bulk load a file from a second server.

Can someone provide instructions?



Thanks!

Can you access the file using thew full path \\FILESERVERNAME\sharedfolder\filename.txt ?

of course, with the user who execute the bulk insert.

Did you alread verify the share and NTFS permition?

|||Yes, I can access file. I have given both that user and the sql service user account full access.

Note that this user has no problem running the same bulk load from my old 2000 server.

I'm pretty sure that my user is not being delegated through to the file server.
Is there a way to catch the user information that BULK INSERT is using to access a file? A SQL trace doesn't catch it.

I'm not a windows system admin, so forgive my ignorance, but what's an ntfs permission? I thought NTFS was just the hard drive file system format.
.
Do you know how to setup delegation for users?

|||

When a told NTFS permission I,d mean the file system permission.

|||Yes, the user has full network and local permission to the file.
|||

Can you try to make lower the authentication level of NTLM protocol?

I saw this posts, try to verify your solution: http://forums.microsoft.com/msdn/showpost.aspx?postid=270868&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1

Thursday, February 16, 2012

builtin\admin

Our servers are in mixed mode.

I have about 10 Window NT accounts.

if i log in domain\myacocunt into windows NT then i bring up SQL Query and do connect with Windows NT i can do what ever i like inside of sql i can delete add etc just like being the sa.

We have the builtin\admin enabled.

The question is i thought i had to have domain\myaccount in sql server logins regardless so that it goes windows nt authentication then sql authentication but it looks like i don't.

In order to take control....i need to have domain\myaccount only access DatabaseA

So to get this working.........do i just remove builtin\admin from security, server roles, system adminsitration......

Also i would like to know why not having a nt login inside can allow user to do what they like.

If you are a local administrator, you will get SQL Server access by virtue of being a member of Builtin\Administrators. It is sufficient for a group you are a member of to be granted access to SQL Server, for you to get access as well. This allows administrators to grant access to a Windows group instead of individually granting access to each group member.

Removing the Builtin\Administrators login will prevent local administrators from getting in, unless a login was created for them or some group they belonged to was given access. But note that a local administrator can always connect, if he can start the server in single-user mode - this is allowed to prevent an administrator from locking himself out.

Thanks
Laurentiu

|||

Thanks for replying.

So if i put the new login domain/startupsql as the administrator on the SQL server.

In sql server i create a new login domain/startupsql add server role of system administrator and then

remove builtin/admin from security server roles system administrator...do i have to delete from security logins or ok to leave here if done remove above.

So the start up will be domain/startupsql.

Do i change the properties on EM or can i stop and start by chainging connections in windows ....services.

Is that about all i have to do.........do you know what this NT Authority server account is and why i need that and what are the server roles.

When i view details of builtin/adimin it have evey server roles selected and every database do i need to do that with the new domain/startupsql

|||

I'm not sure I understand what you are trying to do.

You can remove builtin\administrators if you don't want other local administrators to connect.

Do you want to change the service account as well? I don't understand what you mean by "So the start up will be domain/startupsql."

The NT Authority account is most likely the entry for your current service account. Server roles are explained here: http://msdn2.microsoft.com/en-US/library/ms188659.aspx.

Thanks
Laurentiu

|||

Right now all our server administrators can go into SQL and do everything...so i need to remove builtin/administrators from security, server roles, system administrators and remove builtin

From what i understand is that...when you click on SERVER properites in EM under, Security you have start up service account and it should not be the system account but be a account that is a domain/newaccount to start up SQL.

I am wondering what else i need to be aware of before turning this off...i read it may not start SQl and such..

Thanks

|||

If you don't want to have administrators accessing your server, just remove the Builtin\Administrators builtin. This will prevent direct access to the server. You don't need to worry about server roles, just removing the group with "DROP LOGIN [Builtin\Administrators]" is sufficient.

The service account is a different thing - it's the account under which the SQL Server service is running. Configuring this is external to SQL Server and is unrelated to whether you have or not the Builtin\Administrators login present.

Of course, you should try all these ideas in a test environment until you're happy with the result, before attempting to do configuration changes on your main system.

I assume you're using SQL Server 2000 - if that's the case, note that if you remove Builtin\Administrators and you have no other sysadmin access, you may lock yourself out of the server.

Thanks
Laurentiu

|||

drop...u mean just go to security, server roles, system administrations and do remove buitlin/administrators.....does sql need this for anything else...do i need to replace it with a new login ? what does this do except allow the administrators of windows to do use sql like sa.

Yes the part u mention re to sysadmin access....- i have set up the domain/sql account as system administrators and myself aswell...do i need a just a regular sql account that has security, server roles, system administrators flag set aswell.

I was under the impression in the server properties the start up settings that it should not be a system account (not sure what system account the default sql uses) but i need to change that to domain/sql.

how is your server configured.

BUILTIN/ADMINISTRATORS

Hi all
If sql server2005(yucon) is configured to windows authentication only and
builin/administrators group is removed manually, how to connect to sql serve
r.
No other user account is available.
--
Thanks in Advance
Regards
SuparichituduIn the registry under HKLM\SOFTWARE\Microsoft\MSSQLServer\MSSQ
LServer
change loginmode to 2. This enables mixed mode (after SQL Server
restarts) and you can log on with sa (if you know the password).
Markus

Sunday, February 12, 2012

Building a new database on SQL Server 2000 cluster

The environment: Windows Server 2003, SQL Server 2000 Enterprise Edition Clu
ster (2 boxes)
The I attach th the SQL Server Thru Enterprise Manager, right -click databas
es, and select new database...I can type the name of the new database, but w
hen I go to look for the other drives in the cluster I can only see the (Mas
ter) drive ...where SQL Ser
ver is installed. How can I view all of the current resources (drives) owne
d by that node in the cluster?
Thanks,
WarrenYou have to add them to the cluster ... This is in cluster administrator.
"Warren Tyler" <anonymous@.discussions.microsoft.com> wrote in message
news:41DA8BCE-72D7-41AF-9A9A-5DD06DBCF760@.microsoft.com...
quote:

> The environment: Windows Server 2003, SQL Server 2000 Enterprise Edition

Cluster (2 boxes)
quote:

> The I attach th the SQL Server Thru Enterprise Manager, right -click

databases, and select new database...I can type the name of the new
database, but when I go to look for the other drives in the cluster I can
only see the (Master) drive ...where SQL Server is installed. How can I
view all of the current resources (drives) owned by that node in the
cluster?
quote:

> Thanks,
> Warren
|||Thanks Wayne.
I can see all the drive within the cluster administrator. Is there another
step that i didn't do? The fail-over works perfectly and each node owns it'
s own resources. But I can view the different drives within Enterprise Manag
er...
Thanks,
Warren Tyler|||Correction on the above entry..
I can't view any of the drive from within Enterprise Manager

Building a new database on SQL Server 2000 cluster

The environment: Windows Server 2003, SQL Server 2000 Enterprise Edition Cluster (2 boxes
The I attach th the SQL Server Thru Enterprise Manager, right -click databases, and select new database...I can type the name of the new database, but when I go to look for the other drives in the cluster I can only see the (Master) drive ...where SQL Server is installed. How can I view all of the current resources (drives) owned by that node in the cluster?
Thanks
WarrenYou have to add them to the cluster ... This is in cluster administrator.
"Warren Tyler" <anonymous@.discussions.microsoft.com> wrote in message
news:41DA8BCE-72D7-41AF-9A9A-5DD06DBCF760@.microsoft.com...
> The environment: Windows Server 2003, SQL Server 2000 Enterprise Edition
Cluster (2 boxes)
> The I attach th the SQL Server Thru Enterprise Manager, right -click
databases, and select new database...I can type the name of the new
database, but when I go to look for the other drives in the cluster I can
only see the (Master) drive ...where SQL Server is installed. How can I
view all of the current resources (drives) owned by that node in the
cluster?
> Thanks,
> Warren|||Thanks Wayne
I can see all the drive within the cluster administrator. Is there another step that i didn't do? The fail-over works perfectly and each node owns it's own resources. But I can view the different drives within Enterprise Manager..
Thanks
Warren Tyler|||Correction on the above entry..
I can't view any of the drive from within Enterprise Manager