motioneye
asked on
bcp argumnet erros
I keep trying with bcp command , but keep on failing with the same erros
C:\Program Files\Microsoft SQL Server\90\Tools\Binn>bcp TestDBA.dbo.LOggingA queryout G:\December.txt "select * from LoggingA with (nolock) where date_time between '2010-12-31 23:59:59.99
9' and '2011-01-31 23:59:59.999'" -S Testserver 4 -T -c -b 100000
Unknown argument 'select * from LoggingA with (nolock) where date_time between '2010-12-31 23:59:59.999' and '2011-01-31 23:59:59.999'' on command line.
C:\Program Files\Microsoft SQL Server\90\Tools\Binn>bcp TestDBA.dbo.LOggingA queryout G:\December.txt "select * from LoggingA with (nolock) where date_time between '2010-12-31 23:59:59.99
9' and '2011-01-31 23:59:59.999'" -S Testserver 4 -T -c -b 100000
Unknown argument 'select * from LoggingA with (nolock) where date_time between '2010-12-31 23:59:59.999' and '2011-01-31 23:59:59.999'' on command line.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you cannot use a query from a text file when using bcp.
for that, you could use the sqlcmd command line tool
for that, you could use the sqlcmd command line tool
ASKER
But If I want to have the query in text file and let the bcp call the files what should be the parameter ? any advise ?