A couple of more questions oh mighty SQL admins! What do the
following command(s) do? Is this one command or several different
ones? And can I execute this in the same manner as the previous
command (OSQL)?
sysname, Object sysname, Grantee sysname, Grantor sysname,
ProtectTypeuse msdb
CREATE TABLE #ProcPermissions
( Owner nvarchar(10),
eAction nvarchar(20), eColumn sysname)
INSERT INTO #ProcPermissions EXEC sp_helprotect 'sp_add_dtspackage'
INSERT INTO #ProcPermissions EXEC sp_helprotect 'sp_add_job'
INSERT INTO #ProcPermissions EXEC sp_helprotect 'sp_add_jobstep'
INSERT INTO #ProcPermissions EXEC sp_helprotect 'sp_enum_dtspackages'
SELECT * FROM #ProcPermissions
DROP table #ProcPermissions
Thank you so much for your time!
On Jul 26, 7:50 am, "Tibor Karaszi"
- Hide quoted text -
- Show quoted text -
<tibor_please.no.email_kara...@hotmail.nomail.com> wrote:
> All is in what datatype that function (SERVERPROPERTY) returns. It returns an sql_variant, which can
> *potentially* be a varchar(8000), then the client tool (OSQL) plays it safe by having the output as
> 8000 characters wide. What you can do is to surround the function call with CAST, and pick a
> suitable datatype and length. Something like:
> osql -E -w 5000 -O -Q "SELECT CAST(SERVERPROPERTY('productversion') AS varchar(50)) as version,
> CAST(SERVERPROPERTY('productlevel') AS varchar(50)) as SP, CAST(SERVERPROPERTY('edition') AS
> varchar(50)) as edition"
> --
> Tibor Karaszi, SQL Server MVPhttp://www.karaszi.com/sqlserver/default.asphttp://sqlblog.com/blogs/...
> "pand0ra.usa" <pand0ra....@gmail.com> wrote in message
> news:9967d254-ca72-4a2e-a6cc-6051fb9bc6bd@z72g2000hsb.googlegroups.com...
> > Hello all,
> > I am trying to create a batch file that will pull a list of hosts from
> > a text file and then connect to each host and run some designated SQL
> > commands against those MS SQL hosts. I have been trying to use
> > OSQL.EXE but it pads the output with thousands of training spaces for
> > each column. Is there a way to trim those spaces off in the SQL
> > statement (I don't know SQL at all) or another program that would work
> > better? It's a pain to have each column 8000+ characters wide (~7950
> > of those characters are spaces).
> > osql -S <ipaddress> -U user -P password -w 50 -O -Q "SELECT
> > SERVERPROPERTY('productversion') as version, SERVERPROPERTY
> > ('productlevel') as SP, SERVERPROPERTY ('edition') as edition" >
> > sql1.txt
Hugo Kornelis - 31 Jul 2008 19:15 GMT
>Thank you so much for your time!
I just replied to the first version of this message.

Signature
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis