Osql - Blank Space Beginning Of Line
Feb 2, 2007
Hi,
I'm running the osql below from a batch file:
%SQLPath%osql -U%DBUser% -P%DBPswd% -S%SQLServer% -d%Gatewaydb% -w256 -b -n; -c -h-1 -iBatchScriptsSQL_Get_Create_Batch1.sql -oZ:mboxmmis835increate_835_1.bat
My output file comes out fine with one exception, there is a blank space at the beginning of each line. Is there a way to remove this ? One suggestion I have seen is to do this with BCP instaed of osql but I don't know if BCP can "run" my "SQL_Get_Create_Batch1.sql" file above. The ".sql" creates a temporary table and then does a select.
Thanks,
J
View 8 Replies
ADVERTISEMENT
Sep 13, 2004
I want to pass a command line values into an osql run stored procedure.
The commandline values should be are the values to put into the insert stored procedure that writes them to a table.
Is it possible to do this.
View 1 Replies
View Related
Jul 20, 2005
Hi,I have dumped a very large database from mysql (using mysqldump program)as a raw sql file. The reason was, convert this database to a MSSQLdatabase. Since mysqldump creates the file as raw sql file with thedatabase-table structures and the data in it, I thought using OSQL commandline utilities should work to out this whole database in MSSQL server.I have run this command from command line:osql -u sa -i mysqldump.sqlIt is going since yesterday. It has been almost 36 hours that it'sstarted. And in the mssql server, I see no database created yet. On thescreen of the command line, I see bunch of numbers are going in order. Iassume they are row numbers of the tables processed. But, if it is doing it,then where is it saving all this data ? I have checked the tempdb, pub db,other dbs, and I see no tables related to the database I am inserting. Willit populate it at the and of the job ? Or, am I doing something wrong here?Regards.Murtix.
View 2 Replies
View Related
Feb 25, 2008
Is this a known issue - blank spaces caused by KeepTogether property being implicity set for Lists/Subreports/Rectangles in Reporting Services? If so, will there be a fix soon?
View 5 Replies
View Related
Jul 10, 2007
I am using BCP to export the contents of a view into a text file. Everything is running jsut ifne, except the resulting file has a blank first line. Is there a way to preven this?
BCP statement is as follows:
bcp "select pospay from son_db.dbo.vw_pos_pay order by account desc, code asc" queryout D:eliteUSbankPositivePay_Currentx340.d150364i. d100.txt -T -c
Thanks in advance for any help!
View 4 Replies
View Related
Oct 11, 2000
Hi:
I did the following query on SQL Server A and got the following result.
Input: select replace('10/10/00', '/', '')
Result: 101000
(1 row(s) affected)
However, I did the same query on SQL B and got a different result.
Input: select replace('10/10/00', '/', '')
Output: 10 10 00
(1 row(s) affected)
Both Servers are SQL 7.0 with SP2. I checked the setting, it seems to be identical. Does anyone know what could be the problem or have any hint what I need to check?
I beleieve the correct result should be the first result.
Thanks for any help.
View 3 Replies
View Related
Dec 26, 2007
We are using SSRS 2005.We designed one report.This report contains Table and chart controls .
When Table is hidden,chart only is visible, this chart is going to show only on last page.
There is a white space in top of the chart while hiding the table control.
Consider for an Example Report one tables and one chart .
We want to show only chart,So we made Table's visible property is false.
Total Number of pages is five and table has only four pages and chart has only one page that is in last page.
Now the report showing Four pages are empty with header and footer and last page have a chart with header and footer.
We tried putting the whole table inside a list and gave the visibility property,
but the table inside a list shows the same empty pages
Any suggestions how to avoid the empty pages?
Thanks
Shoba
View 3 Replies
View Related
Apr 3, 2007
Hello,
I my dataset is like following
sql:
select quarter, sum(amount) as amount from table1 group by quarter
then I get the dataset
field: quarter,amount
date: quarter1,100
quarter2,500
Is it possible to get my report from the dataset above.
my report:
quarter,amount
quarter1,100
quarter2,500
quarter3,0
quarter4,0
thanks!
View 4 Replies
View Related
Jan 20, 2008
Hello,
Ik have a problem with the free space if I'am hiding textboxes.
I put 2 textboxes in a rectangle and when I hide the rectangle then the textboxes are gone but the space that the rectangle needed is now blank.
Can I suppress the blank space?
Mvg,
Hans
View 3 Replies
View Related
Jun 24, 2006
Hi, I need blank password for user "sa" when I instaling SQL 2005 Express from command line. SAPWD=<strong password> --> SAPWD=<blank password> ?????
View 5 Replies
View Related
Mar 8, 2007
Hi,
I am using DTS for importing a table from FileMaker Pro (a database application) to SQL Server 2000. The problem is that everything gets imported correctly but in some values, it shows a box type character for a blank space. It does not happen for all the blank spaces. Because of this, that value is cannot be checked in the WHERE clause until I use a LIKE and % for that blank space.
I copied the value and pasted in Notepad, it only shows a blank space. What is this character?
Can someone help...
Thanks,
bullpit
View 4 Replies
View Related
Jul 23, 2005
I'm doing a bcp out of a table to a file. Some of the fields in arecord may have an empty string.When I bcp out to the file and examine it, the fields that have anempty string in the database now show up in the file as having oneblank character.Why is bcp doing this? I don't want the blank character in my output.Thanks,Eric
View 4 Replies
View Related
Apr 5, 2007
Hi all,
Report:
-For instance 2 small tables (eg. width 10cm = 3 inch?)
-And one wide table (eg. width 30cm = 10 inch?)
All separated by "insert pagebreak after table".
Problem:
When rendered, the pages with the small tables on have a lot of white blank space at the right of the table. This is probably caused by the big table on page 3.
This report is distributed by email in Excell format. So on sheet 1 and 2 there are a lot of white cells on the right of the tables. When trying to print, they just want to use the "landscape" option and the "fit to page" option. Because of the empty white cells, the fit to page option reduces the first 2 tables to a very small table which covers only 50 % of the page width. The other 50 % is reserved for the empty cells.
Off course, I know that deleting the empty cells offers a solutions, but it would be a lot more handier if there were no empty cells in the first place.
Anybody with a solution?
View 2 Replies
View Related
Jan 4, 2011
When I hide a table based on an expression it leaves a blank space. How do you get rid of the blank space?
View 7 Replies
View Related
Sep 22, 2006
Hello
I have got a script which checks the percentage of free space on the drivers of the servers and mails the DBA when it falls below a certain percentage , which can be set according to our requirements.
But I am getting blank emails even when , there is no issue of low free space.
Please help me out.
The code , 1st part of it is:
use master
go
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
create PROCEDURE usp_diskspace
@Percentagefree int,
@error2 varchar(8000) OUTPUT
AS
SET NOCOUNT ON
DECLARE @hr int, @fso int, @drive char(1), @odrive int, @TotalSize varchar(20), @MB bigint , @COUNT int, @Maxcount int,@error varchar(700), @errordrive char(1),@errortotalspace varchar(20), @errorfreespace varchar(20), @free int, @date varchar(100), @query varchar(1300)
SET @MB = 1048576
set @date = convert(varchar(100), getdate(),109)
set @error2=''
select @query= 'master.dbo.xp_fixeddrives'
set @date = convert(varchar(100), getdate(),109)
set @error2=''
select @query= 'master.dbo.xp_fixeddrives'
CREATE TABLE #drives (id int identity(1,1),ServerName varchar(15),
drive char(1) PRIMARY KEY,
FreeSpace int NULL,
TotalSize int NULL,
FreespaceTimestamp DATETIME NULL)
INSERT #drives(drive,FreeSpace)
EXEC @query
EXEC @hr=sp_OACreate 'Scripting.FileSystemObject',@fso OUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso
DECLARE dcur CURSOR LOCAL FAST_FORWARD
FOR SELECT drive from #drives
ORDER by drive
OPEN dcur
FETCH NEXT FROM dcur INTO @drive
WHILE @@FETCH_STATUS=0
BEGIN
EXEC @hr = sp_OAMethod @fso,'GetDrive', @odrive OUT, @drive
IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso
EXEC @hr = sp_OAGetProperty @odrive,'TotalSize', @TotalSize OUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @odrive
UPDATE #drives
SET TotalSize=@TotalSize/@MB, ServerName = replace( @query , 'master.dbo.xp_fixeddrives',''), FreespaceTimestamp = (GETDATE())
WHERE drive=@drive
FETCH NEXT FROM dcur INTO @drive
END
CLOSE dcur
DEALLOCATE dcur
EXEC @hr=sp_OADestroy @fso
IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso
set @maxcount =(select max(id) from #drives)
set @count=1
while @count <=@maxcount
begin
select @errortotalspace =convert(varchar(20),Totalsize), @errorfreespace =freespace, @free=CAST((FreeSpace/(TotalSize*1.0))*100.0 as int),@errordrive=Drive from #drives where id = @count
if @free<@percentagefree
begin
set @error = 'Server = '+@@servername+': Drive=' + @errordrive+': Percentage free=' +convert(varchar(2),@free)+'% TotalSpace ='+ @errortotalspace +'MB : FreeSpace ='+ @errorfreespace +'MB ate =' +@date
set @error2=@error2+@error+char(13)
end
else
begin
set @error = 'Server = '+@@servername+': Drive=' + @errordrive+': Percentage free=' +convert(varchar(2),@free)+'% TotalSpace ='+ @errortotalspace +'MB : FreeSpace ='+ @errorfreespace +'MB ate =' +@date
end
set @count=@count+1
end
DROP TABLE #drives
set @date = convert(varchar(100), getdate(),109)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
The 2nd step which sends the mail is :
set nocount on
declare @msg varchar(8000)
declare @minimumspace int
set @minimumspace = 10
set @msg = 'Running out of Hard Disk space on the Server: '+@@servername
exec usp_diskspace @minimumspace,@msg OUTPUT
print @msg
if @msg is not null
EXEC master.dbo.xp_smtp_sendmail
@FROM = N'fromaddress',
@TO = N'toaddress',
@server = N'smtp address',
@subject = N'Free Space of Drivers Test sqlserver2000!',
@type = N'text/html',
@message = @msg
How can I change to get the mail only when there is a free space issue.
Thanks
View 3 Replies
View Related
Sep 22, 2006
Hello
I have got a script which checks the percentage of free space on the drivers of the servers and mails the DBA when it falls below a certain percentage , which can be set according to our requirements.
But I am getting blank emails even when , there is no issue of low free space.
Please help me out.
The code , 1st part of it is:
use master
go
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
create PROCEDURE usp_diskspace
@Percentagefree int,
@error2 varchar(8000) OUTPUT
AS
SET NOCOUNT ON
DECLARE @hr int, @fso int, @drive char(1), @odrive int, @TotalSize varchar(20), @MB bigint , @COUNT int, @Maxcount int,@error varchar(700), @errordrive char(1),@errortotalspace varchar(20), @errorfreespace varchar(20), @free int, @date varchar(100), @query varchar(1300)
SET @MB = 1048576
set @date = convert(varchar(100), getdate(),109)
set @error2=''
select @query= 'master.dbo.xp_fixeddrives'
set @date = convert(varchar(100), getdate(),109)
set @error2=''
select @query= 'master.dbo.xp_fixeddrives'
CREATE TABLE #drives (id int identity(1,1),ServerName varchar(15),
drive char(1) PRIMARY KEY,
FreeSpace int NULL,
TotalSize int NULL,
FreespaceTimestamp DATETIME NULL)
INSERT #drives(drive,FreeSpace)
EXEC @query
EXEC @hr=sp_OACreate 'Scripting.FileSystemObject',@fso OUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso
DECLARE dcur CURSOR LOCAL FAST_FORWARD
FOR SELECT drive from #drives
ORDER by drive
OPEN dcur
FETCH NEXT FROM dcur INTO @drive
WHILE @@FETCH_STATUS=0
BEGIN
EXEC @hr = sp_OAMethod @fso,'GetDrive', @odrive OUT, @drive
IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso
EXEC @hr = sp_OAGetProperty @odrive,'TotalSize', @TotalSize OUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @odrive
UPDATE #drives
SET TotalSize=@TotalSize/@MB, ServerName = replace( @query , 'master.dbo.xp_fixeddrives',''), FreespaceTimestamp = (GETDATE())
WHERE drive=@drive
FETCH NEXT FROM dcur INTO @drive
END
CLOSE dcur
DEALLOCATE dcur
EXEC @hr=sp_OADestroy @fso
IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso
set @maxcount =(select max(id) from #drives)
set @count=1
while @count <=@maxcount
begin
select @errortotalspace =convert(varchar(20),Totalsize), @errorfreespace =freespace, @free=CAST((FreeSpace/(TotalSize*1.0))*100.0 as int),@errordrive=Drive from #drives where id = @count
if @free<@percentagefree
begin
set @error = 'Server = '+@@servername+': Drive=' + @errordrive+': Percentage free=' +convert(varchar(2),@free)+'% TotalSpace ='+ @errortotalspace +'MB : FreeSpace ='+ @errorfreespace +'MB :Date =' +@date
set @error2=@error2+@error+char(13)
end
else
begin
set @error = 'Server = '+@@servername+': Drive=' + @errordrive+': Percentage free=' +convert(varchar(2),@free)+'% TotalSpace ='+ @errortotalspace +'MB : FreeSpace ='+ @errorfreespace +'MB :Date =' +@date
end
set @count=@count+1
end
DROP TABLE #drives
set @date = convert(varchar(100), getdate(),109)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
The 2nd step which sends the mail is :
set nocount on
declare @msg varchar(8000)
declare @minimumspace int
set @minimumspace = 10
set @msg = 'Running out of Hard Disk space on the Server: '+@@servername
exec usp_diskspace @minimumspace,@msg OUTPUT
print @msg
if @msg is not null
EXEC master.dbo.xp_smtp_sendmail
@FROM = N'fromaddress',
@TO = N'toaddress',
@server = N'smtp address',
@subject = N'Free Space of Drivers Test sqlserver2000!',
@type = N'text/html',
@message = @msg
How can I change to get the mail only when there is a free space issue.
Thanks
View 1 Replies
View Related
Apr 4, 2014
I am dealing with what I believe is Oracle that is the source of a SQL View.
I am seeing a data type of Integer in the View, but I am not able to see what makes up that View. When I query the View, I can see that an Integer data type column is storing a blank space. I use ISNUMERIC(ColumnName) = 0 and there are a lot of rows that show as a zero length blank space, or text, or something. I just know that it is not an Integer.
I have attempted to CAST and Convert this value, but it will not. I have changed the data type on the table that is being inserted in too, and it still fails with a Conversion error. I have tried REPLACE(), but still the same conversion error.
View 1 Replies
View Related
May 15, 2015
I am using SQL Server report 2008/2012 (SSRS) and my report viewer contains body content with 3 Row groups.
While printing the report, data print with blank space and move to continue data to next page.
Departure flight : 70 rows
First Page : 42 rows printed
Second Page : 23 rows printed [ Supposed to be print 28 , if the total count of records more than 23 and less than 42 then the page print only 23 records ]
Third Page : 5 rows printed
Departure flight : 42 rows
First Page : 42 rows printed [Report max. record allowed to print 42 rows so if total record is 42 then print perfectly ]
Departure flight : 26 rows
First Page : 23 rows printed [Supposed to be print 26, if the total count of records more than 23 and less than 42 then the page print only 23 records ]
Second Page : 3 rows printed
View 3 Replies
View Related
Apr 15, 2008
In SRSS 2005 (SP2) my page header seems to take up the same amount of space on the
1st page it would take if it were to print; I have PRINT ON FIRST PAGE set to
false - the header doesn't print - it just leaves the same amount of space.
How do you get the report to ignore that. I do have a report header built
into the body of my report. I have tested this by increasing the size of my
page header and it does move the report up or down on the 1st page by that
amount.
View 8 Replies
View Related
Sep 23, 2005
Hi,I'm using isql to query data and output the same to a flat file.The isql has the following command options ' -h-1 -w500 -n -b -s"" '.In the SQL_CODE, the first two lines before the select statement areuse dbnameset nocount ongoWhen I run this, an additional blank line is put into the output file.Actually, there are two lines after the last result set in the outputfile. This file is being fed into another system and the blank line iscausing validation issues.How can I supress this blank line?This script is run from windows and the isql is called from a batscript.Batch script ...================================================== ========.....isql -Uuserid -Ppassword -Sserver -i"%SQL_CODE%" -h-1 -w500 -n -b -s""[color=blue][color=green]>>"%OUT_FILE%"[/color][/color]IF ERRORLEVEL 0 SET RC=0IF ERRORLEVEL 1 exit 4================================================== ========SQL code ...================================================== ========use punclaimset NOCOUNT ONGOselect * from XYZ;GO================================================== ========Your help is greatly appreciated.Yash
View 3 Replies
View Related
Apr 29, 2008
Hi,
I receive blanks for a column called value and i need to represent it as a blank or NA into a colum whose datatype is float in the datawarehouse.
how is this possible because in current schenario a blank is being converted to 0
which is not the right thing.
i would like to retain the blank in conversion from char to float ,
please explain me if it can be done or how to overcome this issue.
Thanks
View 1 Replies
View Related
Mar 5, 2001
Hello,
I have been using Access for quite some time now, and am very comfortable with it. I would like to take the next step though, and start working with SQL server.
What do I need to begin? Windows NT? Which version of SQL? enterprise or professional? (I noticed it's very expensive) Any other things I need to know before I begin?
Thank you,
Carrie
View 1 Replies
View Related
Jan 10, 2007
I'm pretty new at Mdx , so bare with me. I want to make a calculated member called Occupant Fatalities.
The occupant fatalities looks like this right now:
( [Measures].[Fatalities] , [Crash Person].[Person Type].&[Driver])
Now the question is , How do i add another person type to this calculated member. It wont work when i do this.
( [Measures].[Fatalities] , [Crash Person].[Person Type].&[Driver].&[Passenger])
whats the code for having more then one member from a hierachy? or having 2 members from different hierarchies?
any help is appreciated.
View 1 Replies
View Related
Mar 2, 2006
I purchased SQL Server 2005 and intend to take a class this month. I have installed it. How do I get started trying it out? I took an online tutorial, but I don't understand the mechanics of accessing the db to start with or if I even have a db to work with. Any suggestions?
View 1 Replies
View Related
Aug 2, 2007
Hello, I would like to be able to construct a small SQL data base with Visual Basic.Net code for practice. I want to be able to add to the data base, subtract from the data base, perform all Sql procedures ( Select, delete, etc.) I would also like to include the ExecuteNonQuery, ExecuteScalar, and ExecuteReader methods. Can anybody out there recommend a good tutorial for me? Thank you so much. MarcAbelson_2000@yahoo.com
View 1 Replies
View Related
Dec 22, 2006
Dan Tuohy writes "Hi Guys, im working for a company who have asked me to create a database to store there client information. They have totally left everything up to me and are aware that i know little about SQL server. I have downloaded SQL Server Express edition for use as the database engine. The server that the company have is a Linux server but the workstation machines are Windows :s
I am overwhelmed by the pro's and cons of SQL Server, Oracle blah blah blah lol.
Can you give me some pointers, ie books that would guide me step by step, or just some helpfull points to get me started?
Thanks ever so much,
Dan Tuohy"
View 2 Replies
View Related
Jul 23, 2005
How to learn sql from beginning?I would like to learn sql but don't have a clue.can you help me?where would I start?
View 1 Replies
View Related
Oct 10, 2006
Hi everyone,
I want to set a database which will be made of two parts:
- One main set of files which is shared among users
- Another set of files which is proper to each users and will be mainly used for processing infos.
Because I must support Windows 2000 and XP as O/S platforms, I can't use SQL Everywhere. It seems that I'm stuck with SQL Express. My questions are the following:
- Can SQL Express manage database files with variable namepath?
- How can I configure SQL Express so that such a file may reside on a dynamically configurable path, I mean, which would be configured by application?
Many thanks in advance for your help,
Stéphane
View 12 Replies
View Related
Feb 27, 2007
Hi,
for some AP issue, the file I upload must be without the line feed/carriage return in the last line.
for example:
original fixed-length file (exported from SSIS)
line NO DATA
1 AA123456 50 60
2 BB123456 30 40
3 CC123456 80 90
4 <-- with line feed/carriage return in the last line
The file format that AP request. The file only has 3 records, so it should end in the third line.
line NO DATA
1 AA123456 50 60
2 BB123456 30 40
3 CC123456 80 90
Should I use script component to do it ? I am new for VB . Anyone would help me ?
Thank you all.
View 1 Replies
View Related
May 4, 2012
I need the Trend line for the following data in Line chart they are the following data. The following are the graph are my output and i need the trend line for these Key_gap value.
This is the link [URL] ....
I need the same trend line for the Bar-Chart in SSRS 2005.
View 5 Replies
View Related
Aug 31, 2007
I hope I'm posting this in the correct forum (forgive me if I'm not) since I'm not sure if this is an issue with inserting an item into a db or the processing of what I get out of it. I wrote a basic commenting system in which someone my post a comment about something written on the site. I wanted to keep it very simple, but I at least want the ability for a user to have newlines in their comment without having to hardcode a <br /> or something like that. Is there a way for me to detect a newline if someone, for example, is going to their next paragraph?
Let me know if you need a better explanation.
Thanks in advance!
View 4 Replies
View Related
Aug 7, 2004
I have a table .. has 3 fields.. first is ID (Autoincrement) the other two are texts like
ID | Text1 |Text2
1 |aaa |aaa2
2 |bbb |bbb2
3 |ccc |ccc2
etc..
now there is a change in my requrement I need to add 4 more rows at the beginning like.
ID | Text1 | Tex2
1 |xxx |xxx2
2 |yyy |yyy2
.,
.
5 |aaa |aaa2
6 |bbb |bbb2
How can I add rows in the beginning by auto adjusting the ID colum.
I'm using the enterptice manager to do this>.
HELP!
View 1 Replies
View Related
Jul 23, 2005
Greetings:I would like to ask for recommendations for a good beginning book onSQL Server. My web host offers a 100MB SQL Server database as part ofthe package, and I'd like to use the feature to learn.I am proficient in Access and familiar with basic connectivity to itvia ASP. I don't have my own license for SQL Server (and currentlycan't afford one) so all development will need to be done byinterfacing with the remote database. As such, I won't need a lot ofexplanation regarding installation and software setup.Does anyone here know of a good study resource for someone in thisscenario?Many thanks in advance,Kay
View 5 Replies
View Related