PowerShell Query for SQL

%3CLINGO-SUB%20id%3D%22lingo-sub-2515871%22%20slang%3D%22en-US%22%3EPowerShell%20Query%20for%20SQL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2515871%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3CBR%20%2F%3EI'm%20running%20a%20query%20in%20PowerShell.%20the%20query%20has%20two%20commas%3CBR%20%2F%3EOne%20wraps%20the%20query%20and%20the%20other%20(inside)%20wraps%20the%26nbsp%3B%20DB_Name%3CBR%20%2F%3Ewhen%20Running%20get%20an%20error%3C%2FP%3E%3CP%3E%220%22%20argument(s)%3A%20%22Invalid%20column%20name%20'%20DataBaseName'%3C%2FP%3E%3CP%3E%22Load%22%20with%20%221%22%20argument(s)%3A%20%22Value%20cannot%20be%20null.%3C%2FP%3E%3CP%3E%3CU%3Ethe%20same%20query%20running%20Perfect%20in%20SQL%20Management%20at%20the%20same%20Sql%20Comp%20same%20DB.%3C%2FU%3E%3CBR%20%2F%3EWhat%20do%20I%20need%20to%20do%20to%20make%20the%20query%20run%20without%20errors%3F%3C%2FP%3E%3CP%3ELast%20one...i'm%20not%20a%20DBA%20Person%20...%20and%20can't%20expose%20the%20hall%20Query%26nbsp%3B%3C%2FP%3E%3CP%3Ethank%20you%3C%2FP%3E%3CP%3ECBH%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2515871%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2531695%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Query%20for%20SQL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2531695%22%20slang%3D%22en-US%22%3EWithout%20some%20idea%20of%20the%20command%20that%20you%20are%20trying%20to%20execute%20we're%20just%20going%20to%20be%20randomly%20guessing.%3CBR%20%2F%3EWhen%20you%20say%20commas%2C%20do%20you%20mean%20quotes%3F%3CBR%20%2F%3EIf%20so%2C%20put%20the%20double%20quotes%20%22%20around%20the%20outside%20and%20use%20single%20quotes%20'%20on%20the%20inside%3A%20'DB_Name'.%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi All,
I'm running a query in PowerShell. the query has two commas
One wraps the query and the other (inside) wraps the  DB_Name
when Running get an error

"0" argument(s): "Invalid column name ' DataBaseName'

"Load" with "1" argument(s): "Value cannot be null.

the same query running Perfect in SQL Management at the same Sql Comp same DB.
What do I need to do to make the query run without errors?

Last one...i'm not a DBA Person ... and can't expose the hall Query 

thank you

CBH

1 Reply
Without some idea of the command that you are trying to execute we're just going to be randomly guessing.
When you say commas, do you mean quotes?
If so, put the double quotes " around the outside and use single quotes ' on the inside: 'DB_Name'.