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

2012年3月11日星期日

BCP Help

I'm tryping to use BCP to transfer some data to a file. In an effort ot learn about it, I'm trying some simple stuff with the pubs database and some examples from BOL. However, none of them are working.

I'm trying this command:

bcp "SELECT au_fname, au_lname FROM pubs..authors ORDER BY au_lname" queryout Authors.txt -c -Sservername -Usa -Ppassword

Of course i'm changing servername, sa, and password to the appropriate stuff..

I get the following error:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'queryout'.

Any ideas why this example from BOL isn't working for me?

Thanks in advance!

MarkThat looks right. If you are doing this from within SQL (constructing a statement and executing xp_cmdshell, are you sure this is the statement being formed?|||Originally posted by bpdWork
That looks right. If you are doing this from within SQL (constructing a statement and executing xp_cmdshell, are you sure this is the statement being formed?

I'm actually using Query Analyzer and getting that error. Would that make any difference?|||Ah, yes.

BCP is a command line utility, not a SQL command. To run it from QueryAnalyser, you need to shell the command to the operating system with xp_cmdshell.

Try running it froma Command Prompt.

-b|||Originally posted by bpdWork
Ah, yes.

BCP is a command line utility, not a SQL command. To run it from QueryAnalyser, you need to shell the command to the operating system with xp_cmdshell.

Try running it froma Command Prompt.

-b

Awesome. Thanks so much.. Worked great. I feel like an idiot now.

Thanks again|||You mean, you feel smarter now.|||Originally posted by bpdWork
You mean, you feel smarter now.

Something like that. Maybe one day i'll beable to get a job as a DBA.|||DBA is boring. Programming is where it's at man! (Let the hell-fire begin!)|||DBA is boring. Programming is where it's at man! (Let the hell-fire begin!)

Am having a different kinda
discussion (http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=31111) right now.

BTW ... there is a difference between a support DBA and a development DBA.

2012年2月11日星期六

Basic, perhaps silly SQLServer 2005 question

I've previously used version 7 and 2000.

I've recently started to learn ASP.net. I've installed
Visual Web Developer 2005 Express and this includes
SQLServer 2005 in the installation. The task manager
and and the list of services definitely show I've got
SQLServer running on my computer.

Here's the problem: how do I actually use it? I can't
find any tools to create and access databases.

I've tried installing the Enterprise Manager from 2000
but this gives me an error message saying I must use the 2005
tools to connect.

So, is there an Enterprise Manager (or similar) for 2005?
Where do I find it?Download Microsoft SQL Server Management Studio Express from
http://www.microsoft.com/downloads/...&DisplayLang=en

Denis the SQL Menace
http://sqlservercode.blogspot.com/|||"SQL" <denis.gobo@.gmail.com> wrote in message
news:1145465194.532705.252780@.u72g2000cwu.googlegr oups.com...
> Download Microsoft SQL Server Management Studio Express from
> http://www.microsoft.com/downloads/...&DisplayLang=en

Thanks, thats great