Friday, March 30, 2012

print Go in NEw line through Isql command

i have to print Go statement in new line through isql command
my isql command is
isql /Q -SServername -dDatabasename -Usa -PPassword -h-1 -n -q "set nocount on Select ' grant execute on ' + name + ' to user go ' from sysobjects where type = 'U' and name not like 'dt%'" -o SFGRants.sql >> Deploy.log

and out is like
select grant execute tablename to user go

but i want in different format like
select grant execute tablename to user
go

like that
thanking in anticipationUSe char(13)
isql /Q -SServername -dDatabasename -Usa -PPassword -h-1 -n -q "set nocount on Select ' grant execute on ' + name + ' to user' + char(13)+' go ' from sysobjects where type = 'U' and name not like 'dt%'" -o SFGRants.sql >> Deploy.log

When u paste the output of the this commands output to query analyzer GO will print in separate linesql

No comments:

Post a Comment