Quantcast
Channel: bcp utility
Browsing latest articles
Browse All 11 View Live

bcp utility

You need not only the single quotes around the variable, but the double quote at the end.  The best thing to do is to PRINT out the @SQL variable so you can look at it before execution, and make sure...

View Article



bcp utility

ok, I finally got it!  Here is the syntax:SELECT  @SQL ='bcp "Select * From Table A Where File_Name = '''+ @FileName +''' " queryout "C:\Production_Test\Folder\'+ @FileName +'.htm" -c -T -x' exec...

View Article

bcp utility

I would concatenate the string in the cursor definintion this way you only have to execute in the body of the cursor.DECLARE @sql NVARCHAR(500) DECLARE curCreateFiles CURSOR FAST_FORWARD FOR SELECT...

View Article

bcp utility

yes, i was using double quotes when I needed to be using single quotes around the variable and I changed that but now I get this!  haha.usage: bcp {dbtable | query} {in | out | queryout | format}...

View Article

bcp utility

Your quotes look a little wonky.  Try something like this for the select:SELECT@SQL ='bcp "Select * From Table A Where File_Name ='''+ @FileName +'''" queryout "C:\Production_Test\Folder\Test.htm" -c...

View Article


bcp utility

SELECT  @SQL ='bcp "Select * From Table A Where File_Name ="'+ @FileName +' queryout "C:\Production_Test\Folder\Test.htm" -c -T -x' exec master..xp_cmdshell @SQLResults:Copy direction must be either...

View Article

bcp utility

Can you post your code?Michael Asher

View Article

bcp utility

I'm getting some kind of syntax error.  I've never used this bcp utility before but If I execute with a name instead of variable it works fine.Mike

View Article


bcp utility

You can concatenate the file name variable and then execute:DECLARE @cmd SYSNAME;SET @cmd = 'bcp "Select * From dbo.Table A Where File_Name = ''' + @FileName + '''" queryout...

View Article


bcp utility

You can't pass a variable through EXEC; the scope is local to the procedure itself.However, you can pass the contents of that variable in a number of ways, for instance dynamic SQL:SET @sql =...

View Article

bcp utility

Hi, How can I pass a variable in as part of my bcp command in this cursor?DECLARE  @FileName varchar(50)DECLARE  EXPORT_CURSOR CURSORFORSELECT  [File_Name]FROM  Table AOPEN  EXPORT_CURSORFETCH NEXTFROM...

View Article
Browsing latest articles
Browse All 11 View Live




Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Re:

Re:

Re:

Re: