Insert Line Feed In Query

Aug 13, 2007

Hi,

    I want to insert line feed. I have used char(10) and char(13) function. But I could not  insert line feed.
 
  Ex: set error1= 'error description' + char(10)+ 'Employee'

Output must be: error description
                Employee


Any suggestions are welcome.

View 8 Replies


ADVERTISEMENT

How Can I Remove The Line Feed/carriage Return In The Last Line Of The Exported Text File ?

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

2 Matrices, Line Feed

Mar 4, 2008

I have two matrices aligned on one line (side by side). When I preview the report in BIS, the output shows the two matrices on the same line.

When I run the report from report manager, the output shows the two matrices with a line feed (the second matrix is on line 2). All of the rest of the report is aligned properly until I put two matrices next to each other. Then it seems to randomly throw in a line feed. The page width for the report layout seems to be more than enough to accomodate the matrices.

Why is this happening?

View 3 Replies View Related

Need Line Feed In ToolTip Text - How?

Mar 28, 2007

Hello,



I am displaying a complex formula in a column header tool tip. The formula is generated in a stored procedure. (I do not enter the tool tip text directly in the column header expression.)



Within the stored procedure, how do I generate a string that contains a carriage return/line feed?



Thanks,

BCB

View 6 Replies View Related

Specifying Carriage Return/line Feed In An SQL Statement

Oct 19, 2001

Hi there, I hope you can help us.

We're using this statement to import some values into a database:
SQLStatement = "INSERT MyTable (ID, VALUE) VALUES ('" & IDString & "', '" & VALUEString & "')"

The problem is that the strings might contain carriage returns/line feeds, i.e.
VALUEString = "Line 1." & vbCrLf & "Line 2."

It only imports up until the first vbCrLf. We have tried replacing vbCrLf with "", but this doesn't work either. What is the correct format for inserting a value that contains new line characters?

Thanks for your time,
Lasse.

View 3 Replies View Related

Problem With Mailing Labels And Line Feed

Aug 15, 2007

I am trying to print mailing labels and suppress optional address lines to eliminate white space while maintaining label alignment. This is what I am trying but it does not work.

I create a function that determines the length of a field (i.e. street) and increments a counter if the length is zero. It also takes a second parameter that detremines whether to reset the counter. I then use the function in the visibility each row of the label table. Example iif(Code.LineLen(Fields!Street.Value)=0,True,False). I place this on the visibility of each row except the last as that is City,State,Zip and is required. On this last row the expession I use is

=Fields!city.Value & ", " & Fields!state.Value & " " & Fields!zip.Value & iif(Code.LineCount<5,StrDup(5-Code.LineCount,vbCRLF),""). What this is intended to do is print a carraige return and line feed for every row that did not print. Instead no line feeds occur. I have verified that the Code.LineCount is indeed calculating correctly (I printed the value). I've removed the conditional to make sure it has no issues but again nothing. For clarification the code block I am using is this.

Public LineCount as Integer=0

Function LineLen(byval LineIn as string,byval IsFirst as boolean) as Integer
if IsFirst=True then
LineCount=1
end if
If len(LineIn)>0 then
LineCount=LineCount+1
end if
LineLen=Len(LineIn)
end Function
So if anyone either knows why the line feeds do not occur or a better way to handle this please let me know. Thanks.

View 1 Replies View Related

Replace Carriage Return And Line Feed In A Text Column?

May 18, 2004

Hi,

I've a text column (text datatype) that contains carriage return and line feed.

Syntax-wise, how can I replace these by a space?

Thanks.

View 1 Replies View Related

Remove The Last Carriage Return And Line Feed From Sql Text Field

Jun 12, 2007

I am trying to write a user defined function that will allow me tostrip off the last carriage return and line feed from a text field.We have address fields stored in a text field for our ERP system andsome of them have an extra carriage return and line feed at the end ofthem. This causes havoc when we sync between our ERP system and CRMsystem. If anyone knows a way to solve this problem the help would beappreciated.Examples:Existing Text field with CR:1234 Blah Street<CR>Suite 2345<CR>Corrected Text field:1234 Blah Street<CR>Suitr 2345

View 4 Replies View Related

Transact SQL :: FOR XML To Write Data With Carriage Return / Line Feed At End Of Elements?

Sep 30, 2015

I am trying to use FOR XML under SQL Server 2014 to write out a large XML data set. I want it to look like

<CVS_Member_Add_Change>
    <RecordType>3</RecordType>
    <Carrier>1266</Carrier>
    <MultiBirthCode>0000000</MultiBirthCode>
    <MemberType></MemberType>

[Code] ....

That's how it looks when you click on the results of a small subset of the query.  Just what I want.  Unfortunately when you try to right click and save it you get 

<dataroot><CVS_Member_Add_Change><RecordType>3</RecordType><Carrier>1266</Carrier<MultiBirthCode>0000000</MultiBirthCode><MemberType></MemberType<LanguageCode>1</LanguageCode><DURFlag></DURFlag><DURKey></DURKey><SocialSecurityNumber>000000000</SocialSecurityNumber</CVS_Member_Add_Change>

Everything being on one line blows up the translator application that reads the data.

The FOR XML statement copied out of the query is below.

FOR XML RAW ('CVS_Member_Add_Change'), ROOT('dataroot'), ELEMENTS 
GO

Is there a way in the T-SQL to force it to break lines neatly?

Is there a way to force it to a specific file name or directory?

View 3 Replies View Related

SSIS Flat File Connection Manager Not Seeing Carriage Return-line Feed

Apr 29, 2006

I have a csv file as follows:

"100,002.01","200,00.01",10.98,aaaaaaa,bbbbbbbbbb
"100,002.01","200,00.01",10.98,aaaaaaa,bbbbbbbbbb
"100,002.01","200,00.01","1,000.98",aaaaaaa,bbbbbbbbbb

Note that the third column in the third line is also qualified by quotes whereas the previous two are not. I think this is because of Excel formatting. Is there any way to import this file correctly?

My main problem is that I never know whether a column will be qualified or not because this depends on the value. I need to loop through and import many of these files so a manual workaround is not a option for me.

View 22 Replies View Related

Use Query Results To Feed Data Flow

Sep 24, 2007

Greetings,

I need some help determining the best way to accomplish my task. The workflow starts by generating a list of unique ID's from a local table. Then take that list of unique ID's and query an Oracle table for all matching records.

My thought was to first use an Execute SQL task with the following SQL:

select projectid from projectlist group by projectid

with Result Set configured as follows:

Result Name = projectid
Variable Name = varProjectIDList

Then in the Data Flow Task add a DataReader Source to pull the matching data. Here's where I'm getting hung up. I'd like to pass the result set from the Execute SQL task. I tried the following SQL but it doesn't work.

select * from masterlist where projectid = @[User::varProjectIDList]

I'm open to any suggestion on the best way to take my unique list and use it as input for a query against my Oracle DB.

Thank you for your ideas.

Rob


View 4 Replies View Related

Command Line And Insert

Sep 22, 2005

I'm trying to insert into a table 2 values one of which is an

exec master..xp_cmdshell @command where I have assigned @command with a value

this statement gives me the result into a 1 col. table fine:

insert into mytable99(col1) exec master..xp_cmdshell @command

now what I want to do is put col2 in there as well!!

ie. insert into mytable99(col1,col2) values (exec master..xp_cmdshell @command, '123')

I get a sytax error ... on the exec ??

Could anyone help re the proper way of doing this ... thanks in advance

View 1 Replies View Related

MS SQL Command Line Insert

Oct 13, 2005

I use a similar command below to insert into a temp table the result of a large command line call to an exectable with many parameters passed in the command of which the result passed back contains many items. I then parse the response string to get my results...

set @command = 'dir'
insert into tsverisign(response) exec master..xp_cmdshell @command


My question is our can I insert two values at the same time to this same table one of which is my "exec master..xp_cmdshell @command"

similar to insert into tables (field_a, feild_b) values ('1','2')

Something like (and I know this does not work):

insert into tsverisign(response,trans_id)
values (exec master..xp_cmdshell @command, '123')

Any help would be greatly appreciated .... PS I'm new to MS SQL 2000 and proper syntax etc. etc. so I need full example so I can try. :rolleyes:

View 1 Replies View Related

IS It Possible To Insert A Blank Line In My Report

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

Bulk Insert Truncate The Actual Line

Apr 29, 2008

Hi all,

I have a problem during the bulk insertion. SQL truncated each line of the file.

The format file is:
9.0
1
1 SQLCHAR 0 8000 "
" 1 if1 ""

Table:

CREATE TABLE #if1 (
[if1] [varchar] (8000) NULL
)

Query:
SET @sqlstr = 'BULK INSERT #if1 FROM ''' + @inputfilepath + '.if1'' WITH (FORMATFILE = ''' + @ifformat + '.fmt1'')'
EXEC(@SQLSTR)

Everything is fine. The only problem is the lines are truncated.

Any ideas?

View 1 Replies View Related

HELP! Cannot Use Enter Key To Insert Line Breaks In Table

Oct 15, 2007

Hello,

Since SQL 2005 Express doesn't appear to let you paste multiple lines of data into a cell -- a task as "basic" as the Commodore 64 -- I'm forced to enter the data for 2 records directly. I'm trying to insert line breaks, which SQL 2000 allowed you to do by simply pressing the Enter key. However, 2005 just moves you to another record. How do I do this extremely simple task?

Many thanks for a speedy reply!

View 6 Replies View Related

SQL 2012 :: Insert Entire Line Into One Column Of The Table

Oct 21, 2014

I convert EBCDIC file to text file at C:orderorder.txt. There are about 1400000 rows. The length of line is 1500.

How to insert entire line into one column of the table? (only one column, named as [LineDetail])

View 1 Replies View Related

Insert Varbinary Data Using Command-line Sqlcmd

May 23, 2008



Hi,

I have a SQL script file which creates a table and and inserts all data required by the client app into the table.

The table also holds images in a varbinary field. How do I insert an image held on the file system (e.g. "C:ImagesMyImage.gif") into a varbinary field using a script that is run using sqlcmd on the command line?


Any pointers greatly appreciated!

Mike

View 8 Replies View Related

Skip The First Line Of The Data File - Bulk Insert

Oct 1, 2007

Hi,
I have a data file and the contents of it are as follows

2 -- This is the header indicating the no of records in my files
1001|s1
1006|s2

The content of format file is as follows. This is to skip first column of the all the rows and get only Subs (i.e s1 and s2 )


9.0

2
1 SQLCHAR 0 100 "|" 0 ID ""

2 SQLCHAR 0 100 "
" 1 Subs ""


Here is my query to get all the Subs from my data file


SELECT * FROM OPENROWSET( BULK 'datafile.txt',

FORMATFILE = 'FormatFile.fmt',

FIRSTROW = 2 ) AS a

But this query retuns only s2 where i was expeting s1 and s2. The reason being is that the firts row i.e header doesn't follow the format
Can any one please let me know how to skip the first line in the data file and get the result as required

~Mohan

View 6 Replies View Related

There Was An Error Parsing The Query. [ Token Line Number = 1,Token Line Offset = 43,Token In Error = C]

Jul 27, 2007


Hello all
Trying to delete some data from a SSCE (2005) DB produces the exception:
SqlCeException
There was an error parsing the query. [ Token line number = 1,Token line offset = 43,Token in error = C]
Here is the code I am using

string dsc = Application.StartupPath + "\FCDB07.sdf";

conn = new SqlCeConnection("DataSource = " + dsc);

conn.Open();

cmd = conn.CreateCommand();

cmd.CommandText = "DELETE FROM DataContainer WHERE FileName =" + dgContainers[0, SelRowIndex].Value.ToString();

cmd.ExecuteNonQuery(); //There was an error parsing the query. [ Token line number = 1,Token line offset = 43,Token in error = C ]

conn.Close();

Any Idea on What causes this?

TIA
Trophus

View 3 Replies View Related

Error Parsing Query: [ Token Line Number = 1,Token Line Offset = 83,Token In Error = 5 ]

Nov 23, 2007

Hey all-

I'm trying to insert some values into an SQL Compact database on a WM6 device but there is something apparently wrong with my SQL statement...

The program is going to allow users to schedule an SMS message to be sent at a certain date and time. I'm using a database to keep track of the scheduled SMS messages. The database has 3 rows: phone number, message, and the date/time to be sent.

Here is the relevent code:


private void scheduleMenu_Click(object sender, EventArgs e)

{

//connect to DB and do our scheduling magic



string message = messageBox.Text; //should rename messageBox...

string phoneNum = phoneNumBox.Text;



string dataBase = @"Program FilesSMS_Scheduler2SMSDatabase.sdf";

//SqlCeEngine eng = new SqlCeEngine(dataBase);

SqlCeConnection conn = new SqlCeConnection("Data Source=" + dataBase);

conn.Open();



//insert phone number, message text, and date/time into DB
string cmd = "INSERT INTO Scheduler(phoneNum, message, date) VALUES("+ phoneNum + ", "+ message + ", "+ dateTimePicker1.Value +")";

SqlCeCommand cmdPhone = new SqlCeCommand(cmd,conn);





cmdPhone.ExecuteNonQuery(); //error occures here...



messageBox.Text = "";

MessageBox.Show("Message Scheduled!");

}



I'm guessing it doesn't like how I am trying to get the data from the different text boxes and the DateTimePicker to go inside the SQL command. Does anyone have any ideas on how to fix my SQL command or how to get data from a textbox and DateTimePicker to be inserted into a database a different way?

View 3 Replies View Related

New Line In Query

Oct 5, 2006

Hi,
I was wondering if there is any way I can place a new line inside a query...

e.g.

select field1 + 'NEWLINE' + field2 from tablename


I want to place a new line between field1 and field2

Thanks in advance

View 9 Replies View Related

How To Retrieve Id From That Query Line

May 30, 2008

Hey.
I have two sets of tables.
Machine Warranty table (primary key=machine_warranty_id) 
("INSERT into machine_warranty(Job_No, Cust_ID, Machine_SerialNo, Product_ID, Unit_Price, Payment_Type, Date_Installed, Freebies, Remarks, Unit_Location, Date_Paid_MW, Cheque_CC_No, Date_TrialStart, Waterblock, Pressure_Regulator, Rental) VALUES ('" + job + "','" + txt_CustID.Text + "','" + txt_MachineSerialNo.Text + "','" + txt_ProductID.Text + "','" + txt_UnitPrice.Text + "','" + dd_PaymentType.SelectedValue + "','" + txt_DateInstalled.Text + "','" + txt_Freebies.Text + "','" + txt_Remarks.Text + "','" + txt_UnitLocation.Text + "','" + txt_DatePaid_MW.Text + "','" + txt_ChequeCCNo.Text + "','" + txt_DateTrialStart.Text + "','" + dd_WaterBlock.SelectedValue + "','" + dd_PressureRegulator.SelectedValue + "','" + dd_Rental.SelectedValue + "')", connectionOne);
//machine warranty id is a primary key is auto generated already therefore not in the query line.
 
Warranty Period table (primary key=warranty_period_id/ foreign key=machine_warranty_id)("INSERT into warranty_period(Warranty_Period_ID, Warranty_Start) VALUES ('"+ txt_Warranty.Text +"','"+ txt_Warranty_Start.Text +"')", );
 
How to retrieve the machine_warranty_id from the first sql query line? So that I could use it for Warranty Period Insert statement.

View 2 Replies View Related

SQL To RSS Feed?

Nov 6, 2006

Hi,
Not sure if this is the right board as it could be in the XML one aswell...
I'm fairly ok with ASP2.0 and used it to build a database driven website: www.trailandtrack.co.uk however, I want to create an RSS feed of the trails that are on the site.
The trails are all in a MSSQL2000 database, and are all keyed on a unique ID which is used to retreive the trail info from the database (using querystrings)
 I want to create an automatic RSS feed that gets updated automatically from the database whenever new trails are added. Giving the Title as the Trail Name, Link But using the standard URL: http://www.trailandtrack.co.uk/usertrail.aspx?trailid=123 (if you go this this page you'll see the feidl placeholders)
Only thing is Ive not got a clue how to go about creating an RSS feed to do this, can anyone help?? (I can do a manual one fine, no probs, but automatically - it's a bit out of my debth)
 Thanks
 
 

View 1 Replies View Related

Database Off Line; How Do I Detect With A Query

Jul 20, 2005

How do I detect with a query which database is off-line.And how do I detect with a query the recovery model of a database.ByeArno de Jong

View 2 Replies View Related

XML Feed Into Database

Apr 7, 2006

Hi everyone

I have been tasked on importing an xml feed into a sql server 2005 database. Now I am a network guy so I am completely clueless here.

Could anyone help?

http://www.iafrica.com/content_feeds/business/worldatsix.xml

Need to bring that into a database table (not created yet)

Any help would be appreciated

Thanks

View 3 Replies View Related

What Is Data Feed?

Mar 12, 2004

Hello Friends,

I would like to know what Data Feed means while working as an Administrator on Ms SQL Server 2000?
Also what do you mean by integrating feed of data?
I would appreciate it if anyone could help me out with this queries...
Also I was wondering which would be best book to refer while learning about ms sql server 2000.

View 6 Replies View Related

Create RSS Feed

Sep 4, 2007

Is it possible to create an RSS file from directly MS SQL 2005? I'd like to create a task to produce a file daily and place it on a web server.

Ryan

Ryan Everhart
The New AT&T

View 4 Replies View Related

XML Data Feed

Dec 29, 2005

Hello,I have an XML data feed that I would like to use to create tables inSQL Server. The xml data feed consists of a large amount ofinformation that changes on a regualar basis. Is there a way toautomatically create SQL Server tables using the data feed?ThanksBilly

View 7 Replies View Related

TablesList Feed

Mar 29, 2007

Hi,


if I have one table to transfer I can use the following to amend the tableslist





Imports System.Collections.Specialized

Public Sub Main()

Dim application As Microsoft.SqlServer.Dts.Runtime.Application = New Application()

Dim packagename As Object = Dts.Connections("Tables").AcquireConnection(Nothing)

Dim package As Microsoft.SqlServer.Dts.Runtime.Package = application.LoadPackage(packagename.ToString(), Nothing)

Dim th As TaskHost

th = package.Executables("TablesToMove")

Dim sc As StringCollection = New StringCollection()

sc.Add(Dts.Variables("Tables1").Value.ToString())




th.Properties("TablesList").SetValue(th, sc)

application.SaveToXml(packagename, package, Nothing)

Dts.TaskResult = Dts.Results.Success

End Sub







now if I have a list of tables (as an SSIS object time ) how can amend this script to table the objetc rather than feeding each table





Thanks

View 7 Replies View Related

Extra Line Between Header And Data In Query?

Mar 24, 2015

I need to have an automated process to generate and send out csv data on a set schedule. Using the sp_send_dbmail routine is working great except for one small problem I am having trouble getting around.

I am specifying a query to be run and including the results as a file attachment. The customer wants a csv file with column names.

The attachment always includes a 'separator line' of dashes between the column header and the actual data. Is there any way to eliminate this line of dashes? When I use @query_result_header = 0 flag, it removes the line of dashes, but the column names are also removed as well.

I want to keep the column names, but just remove the line of dashes.

View 1 Replies View Related

Reporting Services :: Draw Trend Line For SSRS Line Chart 2005

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

Storing And Retrieving Line Breaks/newlines From Multi-line Textbox (C#)

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







Copyrights 2005-15 www.BigResource.com, All rights reserved