惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
TaoSecurity Blog
TaoSecurity Blog
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题
T
Troy Hunt's Blog
N
News and Events Feed by Topic
雷峰网
雷峰网
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
PCI Perspectives
PCI Perspectives
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 三生石上(FineUI控件)
Schneier on Security
Schneier on Security
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 最新话题
V
V2EX
T
Threat Research - Cisco Blogs
人人都是产品经理
人人都是产品经理
C
Cisco Blogs
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
I
Intezer
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
月光博客
月光博客
Recent Commits to openclaw:main
Recent Commits to openclaw:main
N
News | PayPal Newsroom
Cyberwarzone
Cyberwarzone
B
Blog
博客园 - 聂微东
P
Palo Alto Networks Blog
A
About on SuperTechFans
The Last Watchdog
The Last Watchdog
Scott Helme
Scott Helme
Google DeepMind News
Google DeepMind News
Webroot Blog
Webroot Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
O
OpenAI News
C
Check Point Blog
Hacker News: Ask HN
Hacker News: Ask HN
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
A
Arctic Wolf

博客园 - 天蝎

两岸三地在线编程学习网站 WebinoImageThumb - ZendFramework 2中操作图片的API PHP依赖管理器- Composer Local Temporary Tables and Table Variables Logging with SQL Server SQL Server Database Partitioning Myths and Truths 转载:什么是SHELL 转载:Plan freezing and other plan guide enhancements in SQL Server 2008 - 天蝎 转载:Breaking ownership chaining within a schema in SQL Server 转载:如何正确理解自动化测试技术 存储过程 SOA的设计理念 转载: The DBA as Detective: Troubleshooting Locking and Blocking 转载:锁的概述 转载: Microsoft SQL Server roles Execution plans, estimated vs actual Finding the causes of poor performance in SQL Server Enabling Dedicated Administrator Connection Feature in SQL Server 2008 .net中应用程序域的概念
Why BCP connects to SQL Server instance which start with account of Network Service fail?
天蝎 · 2009-08-05 · via 博客园 - 天蝎

Q:
Environment: SQLEXPRESS with start account of Network Service, SQLCMD tool.
When run following BCP utility with XP_cmdshell environment, it will report login failure:    

--1, turn on 'xp_cmdshell'
use master
go

exec sp_configure 'show advanced options','1'
go

reconfigure with override
go

exec sp_configure 'xp_cmdshell', 1
go

reconfigure
go

-- 2, use AdventureWorksDW
go

CREATE TABLE [dbo].[talltypes](
 [rec] [smallint] NOT NULL,
 [cbinary] [binary](255) NULL,
 [cvbinary] [varbinary](255) NULL,
 [cchar] [char](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 [cvchar] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 [cdatetime] [datetime] NULL,
 [csmalldatetime] [smalldatetime] NULL,
 [cdecimal17] [decimal](38, 8) NULL,
 [cdecimal172] [decimal](38, 38) NULL,
 [cnumeric5] [numeric](8, 2) NULL,
 [cnumeric10] [numeric](20, 4) NULL,
 [cfloat8] [float] NULL,
 [creal] [real] NULL,
 [cint] [int] NULL,
 [csmallint] [smallint] NULL,
 [ctinyint] [tinyint] NULL,
 [cmoney] [money] NULL,
 [csmallmoney] [smallmoney] NULL,
 [ctext] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 [cimage] [image] NULL,
 [cbit] [bit] NOT NULL,
 [timestamp] [timestamp] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
go

exec master..xp_cmdshell 'bcp  AdventureWorksDW..talltypes in E:\MYAUTO~1\INSTAL~1\MSSQL1~1.SQL\MSSQL\Data\talltypes.bcp -n -T -E -SSQLPOD065-15\SQLEXPRESS'
go


A:
When you run BCP from SQL Env, using XP_CMDShell , its run in the context of Startup Account, which was Network Service and have very limited prvilage . When you run from OS ENV, its run in the context of  windows user which i assumed that a member of Administrator Group. If the server was configured mixed mode you could have passed -Usa -Ppassword instead of -T. -T is for trusted connection

Refer:

Service Account (SQL Server Express): http://msdn2.microsoft.com/en-us/library/ms143170.aspx
Security Considerations for a SQL Server Installation: http://msdn.microsoft.com/en-us/library/ms144228.aspx