467,894 Members | 1,586 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

Powershell questions??

1. Is there a dedicated discussion group for Windows Powershell? I couldn't
find one, but that doesn't necessarily mean there isn't :-)

2. I'm just starting in on learning to use Powershell and doing so by slowly
(very slowly) attempting to port some existing CMD and Perl scripts. I'm
blocked right now on something that should be very simple (I would think)...

I want to use SQLCMD to issue a query and parse/format the return string.
But when I enter the command to the Powershell prompt:

sqlcmd -S server -d database -E -Q"query"

It just returns to a ">>" prompt as if its waiting for the completion of the
command and nothing I enter seems to "complete" the command. A Ctrl+C
returns me to the main Powershell prompt without executing the command.

What am I missing??

Thanks,
-- TB
Jun 14 '07 #1
  • viewed: 2396
Share:
3 Replies
Thomas W. Brown wrote:
1. Is there a dedicated discussion group for Windows Powershell? I
couldn't find one, but that doesn't necessarily mean there isn't :-)
news://msnews.microsoft.com/microsof...ows.powershell

Andrew
Jun 14 '07 #2
"Thomas W. Brown" <th************@countrywide.NOSPAM.comwrote in message
news:F2**********************************@microsof t.com...
1. Is there a dedicated discussion group for Windows Powershell? I
couldn't
find one, but that doesn't necessarily mean there isn't :-)
microsoft.public.windows.powershell
>
2. I'm just starting in on learning to use Powershell and doing so by
slowly
(very slowly) attempting to port some existing CMD and Perl scripts. I'm
blocked right now on something that should be very simple (I would
think)...

I want to use SQLCMD to issue a query and parse/format the return string.
But when I enter the command to the Powershell prompt:

sqlcmd -S server -d database -E -Q"query"

It just returns to a ">>" prompt as if its waiting for the completion of
the
command and nothing I enter seems to "complete" the command. A Ctrl+C
returns me to the main Powershell prompt without executing the command.

What am I missing??
What's the whole command? I don't have that problem.

Here's the SQL command that works for me:

PS C:\sqlcmd -S server -E -d DB -Q "select * from table"

Jun 14 '07 #3
"John Vottero" wrote:
"Thomas W. Brown" <th************@countrywide.NOSPAM.comwrote in message
news:F2**********************************@microsof t.com...
1. Is there a dedicated discussion group for Windows Powershell? I
couldn't
find one, but that doesn't necessarily mean there isn't :-)

microsoft.public.windows.powershell

2. I'm just starting in on learning to use Powershell and doing so by
slowly
(very slowly) attempting to port some existing CMD and Perl scripts. I'm
blocked right now on something that should be very simple (I would
think)...

I want to use SQLCMD to issue a query and parse/format the return string.
But when I enter the command to the Powershell prompt:

sqlcmd -S server -d database -E -Q"query"

It just returns to a ">>" prompt as if its waiting for the completion of
the
command and nothing I enter seems to "complete" the command. A Ctrl+C
returns me to the main Powershell prompt without executing the command.

What am I missing??

What's the whole command? I don't have that problem.

Here's the SQL command that works for me:

PS C:\sqlcmd -S server -E -d DB -Q "select * from table"
Doh!!! I was not adding whitespace between the -Q and quoted query. From
the regular CMD shell no space is necessary, but in Powershell I guess it is
:-/

Thanks,
-- TB

Jun 14 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Neil Chambers | last post: by
6 posts views Thread by Mesan | last post: by
1 post views Thread by Alexander Vasilevsky | last post: by
5 posts views Thread by josepharmbruster | last post: by
3 posts views Thread by sridhard2406 | last post: by
reply views Thread by =?Utf-8?B?SmVycnk=?= | last post: by
1 post views Thread by =?Utf-8?B?YXVsZGg=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.