Junk Characters Added On Log Files
Sep 18, 2006
Hi
We are generating the log file using SSIS built in logging feature. It is generating a text file as "log.txt".
Again we need to add few string values like "Files Loaded Successfully". So i tried adding this string using the following 2 ways.
1. Using Script Task in SSIS
2. Using SQL Stored procedure.
The following are the code:
Through SSIS Script:
Contents = "File Loaded Successfully"
'Get a StreamReader class that can be used to read the file
Dim objStreamWriter As IO.StreamWriter
objStreamWriter =
IO.File.AppendText("\Chnbslsql2k3shareLoglog.txt")
objStreamWriter.Write(Contents)
'Close the stream
objStreamWriter.Close()
Through Stored Proc:
CREATE PROCEDURE [dbo].[LG_Create_LogFile]
AS
BEGIN
SET NOCOUNT ON
DECLARE
@cmdstr as nvarchar(1000),
@Msg AS varchar(1000)
BEGIN TRY
BEGIN
-- Create move command
set @Msg = 'File Loaded by Kumaran '
set @cmdstr = 'echo ' + @Msg + ' >>
\Chnbslsql2k3shareLoglog.txt'
END
-- Execute command
EXEC master..xp_cmdshell @cmdstr
END TRY
BEGIN CATCH
RAISERROR('FILE NOT MOVED SUCCESSFULL', 16, -1)
RETURN -1
END CATCH
END
In the both ways, it is giving me junk characters as like in the below output log.txt file...
PackageStart,CHNBSLSQL2K3,NT AUTHORITYSYSTEM,pkgExtract,{93BE582E-EDDD-4EBD-97A4-8A2E39E839A9},{605B2ED1-D794-4455-BD9E-F32D4CFF1196},9/18/2006 8:43:40 PM,9/18/2006 8:43:40 PM,0,0x,Beginning of package execution.
OnError,,,pkgExtract,,,9/18/2006 8:43:43 PM,9/18/2006 8:43:43 PM,-1071636466,0x,Cannot open the datafile "\Chnbslsql2k3shareRawCPSExtract.dat".
PackageEnd,CHNBSLSQL2K3,NT AUTHORITYSYSTEM,pkgExtract,{93BE582E-EDDD-4EBD-97A4-8A2E39E839A9},{605B2ED1-D794-4455-BD9E-F32D4CFF1196},9/18/2006 8:43:48 PM,9/18/2006 8:43:48 PM,1,0x,End of package execution.
æ¥†æ•¬ä° æ…¯æ•¤?¤ç¥¢ä¬ 浵牡湡€ à¨?
This is a issue which i am struggling and looking on..Please help me out with some gud
solutions.
Thanks
Kumaran
View 1 Replies
ADVERTISEMENT
Feb 23, 2006
Back Story...
i am building a new deployment routine for one of our products using NANT (.net version of ANT). I takes all of .sql files out of vault for all non table objects and concatenates them into larger .sql files with IF EXISTS .... DROP ... GO CREATE statements which will then be fired off by osql batch files that will log the errors.
Problem...
When I open the resulting files in notepad I have junk characters (microsoft OEM stuff) in some of my object definitions which you do not see in the QA or if you opnen the file in Vault. I need to get this stuff out of there and I do not want to write a bunch of filesystem code to do it because I need this tested and ready by Friday COB. I know I can solve this by opening the problematic files in ultraedit and saving them one by one but I do have that kind of time.
Any ideas?
It's going to be a long couple of days.
View 14 Replies
View Related
Sep 26, 2007
Hi,
I am Suhasini. While saving data from front end(Asp.net) to back end(Sql server 2005 express edition) i am getting junk characters also added to the database. This character just look like a checkbox. Basically i am adding options using a multiline text box, is there any thing wrong with that. options are saved in the database as junk character followed by option1...... etc. Kindly suggest me on this.
View 3 Replies
View Related
Aug 24, 2007
How to find and replace the Junk Characters which is accidently stored in the "TEXT" data type column of one table.
View 5 Replies
View Related
Jun 3, 2007
Hai all,
We have quite a strange problem, we have some SP's in our project which is functioning quite well all these days. Suddenly one day we got an error in the SP stating "Invalid Table Name", when we opened the SP and saw in some places the Tablename was replaced with Junk Characters inside the SP !!!!!!!
For Ex: Inside the SP we have the following SELECT query
"SELECT F1 FROM SampleTable"
the above query is getting replaced with
"SELECT F1 FROM SampleTa?le"
The junk character actually appears like a box!!!.. we were absolutely clueless why this was happening. Then if we change the SP once agin and run it starts to execute but only for a short time and the problem comes back once again. When we went through the SQL logs we got this error repeatedly:
"Error: 17805, Severity: 20, State: 3
Invalid buffer received from clients"
We came to know a little about this problem from kb articles in MS that when you are calling an SP from .Net u should specify the parameter data types explicitly and u should not use SQL Client in Finalise method all which we have not done in the application.
Tha SP was using #Table which we replaced to @Tablevariables but still we got the problem once, we are monitoring with the same Table Variables.
We are using SQL Server 2000 SP4. We have got stuck with this problem for days now . Any help is greatly appreciated.
Thanks in advance.
View 1 Replies
View Related
Mar 12, 2012
I have a table and one of the column have junk characters in it, how can I remove the junk characters?.
Eg : Employee
Eid Ename
1 a�
2 �ddd
how can i remove Junk characters and get only Enames from above table.
View 4 Replies
View Related
Jul 20, 2005
Hi All,I am using command line bcp utility of SQL Server to import data from a textfile to database.I have some german words in the text file and afterimport the German characters are lost.see eg below.Input : Kühner, Klaus -> Text file valueOutPut: K?hner, Klaus -> Table data, after import.I am using unicode in the commad line.The collation setting is LATINcan anyone show some light.Thanks in advanceManoj.
View 1 Replies
View Related
Mar 12, 2008
I have a strange situation in an Message queue task in SSIS.
I serialize an object in a C# application and add that to an MSMQ as a string. I also ensure that I set the label to "String Message" so that my Message Queue Task can actually receive the message as a String message to variable.
I created an SSIS package that has an Message Queue listener that feeds into a Script task inside a for-each loop.
For each message that I obtain, I invoke a script task that retrieves the value of the variable and then processes this information.
When I enter the entry into the MSMQ, it goes in perfectly fine (since I also tested retrieving this entry from a C# app). However when I use the same logic on the SSIS package using the Script task, I get junk chinese characters.
Has this happened to anyone else?
Any feedback would be great!
Anup
Here is the code for the script task:
mports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Public Class ScriptMain
Public Sub Main()
Dim statusMessage As String
statusMessage = CType(ReadVariable("ReviewerHealthXmlMessage"), String)
System.Windows.Forms.MessageBox.Show(statusMessage)
Dts.TaskResult = Dts.Results.Success
End Sub
Private Function ReadVariable(ByVal varName As String) As Object
Dim result As Object
Try
Dim vars As Variables
Dts.VariableDispenser.LockForRead(varName)
Dts.VariableDispenser.GetVariables(vars)
Try
result = vars(varName).Value
Catch ex As Exception
Throw ex
Finally
vars.Unlock()
End Try
Catch ex As Exception
Throw ex
End Try
Return result
End Function
Private Sub WriteVariable(ByVal varName As String, ByVal varValue As Object)
Try
Dim vars As Variables
Dts.VariableDispenser.LockForWrite(varName)
Dts.VariableDispenser.GetVariables(vars)
Try
vars(varName).Value = varValue
Catch ex As Exception
Throw ex
Finally
vars.Unlock()
End Try
Catch ex As Exception
Throw ex
End Try
End Sub
End Class
View 1 Replies
View Related
Aug 2, 2007
I am using Reporting Services 2000 and therefore VS 2003 and am having a problem editing the T-SQL query in the data view of Visual Studio.
Basically if I manually edit the T-SQL query or touch anything in the designer view of the query I get odd characters added in the T-SQL and the query no longer works. I have tried re-installing VS2003 and RS 2000 but it's still happening.
FYI I also have SQLServer 2005 and VS 2005 on my machine as all applications we develop are in .Net 2.0 and 3.0. We only use VS2003 for RS.
Does anyone have a clue how to fix this? Thanks
View 3 Replies
View Related
Jun 7, 2002
Hi!
I need to transfer data from a textfile file.txt to a table in SQL.
Words like "Köping" looks like "K÷ping" in the database and I can´t use them when I compare. Do you know how to handle this problem????
Regards
//Carina
View 2 Replies
View Related
Jul 6, 2012
string starts with 3 digit same number
111 H,777GGG,9999 H etc
string starts with NULL
string that starts with sequential digits
123g,897 k
string that starts with sequential alphabets
abcmki12, ghimkkk, rst123 5 etc
string only one character (digit or letter)
string only has same character repeated 3 times except for OOO
string only has three characters, 1 digit and two letters or 2 digit one letter
string that has only two characters one digit and one letter
View 1 Replies
View Related
Aug 29, 2007
sample Data: "061107"
Every flat file ends with the junk character
How to remove this using "Derived Component" or "Script Component" ?
Pls provide the sample code for this task. Thank you.
View 6 Replies
View Related
Mar 30, 2012
I developed a mass mailing tools, but all mails received in junk and spam folder
I use an store procedure 'sp_send_dbmail' which is by default in sql server, when i send an testing mail using object explorer ->Database mail -> right click -> send testing mails, then this mail received in inbox, but when i call 'sp_send_dbmail' this procedure using job with 2 min intervals then mails received in junk or spam folder of recipients..
I configured correctly all information of smtp details ip address...
Why mails r received as junk or spam folder ??
View 2 Replies
View Related
Apr 18, 2012
i got stuck, while sending emails using store procedure sp_send_dbmail, when i m sending simple text format then mail received in inbox but whenever i m trying to send an html format emails with links of images and href tags mails received in spam.. i store procedure is given below..
DECLARE @tableHTML varchar ;
SET @tableHTML =
'<table border="1" >
<tr>
<td width="187"><a href="http://printbooth.in/product-list.php?cat_id=16&subcat_id=265" target="_blank"><img
[code]...
View 1 Replies
View Related
Mar 31, 2008
Is there a way to tell SQL Server 2005 Management Studio that I don't want it to include "USE [dbname]" and "/****** Object: Table [dbo].[TBL_NAME] Script Date: [date] ******/" when it creates scripts? I searched the forums and couldn't find an answer, and I don't see it in Tools->Options.
View 5 Replies
View Related
Jan 17, 2007
I have a varchar field which should contain dates but unfortunately it is fill with all sorts of imaginary formats which only the one who has typed may understand.
9+03/24/2006
3/16/2006
11:15AM
5-Oct
8/8/2006
9
.
`06/27/2006
12505
1/9/2007
1/12/2007
1/12/2007
1/15/2007
in a data set of 15000 rows most of them are like '1/15/2007'
and 305 roes are like the rest in the sample.
can you sugest ma a simple way to convert posible data to format '1/15/2007' format which i can use in a SELECT...INSERT STATEMENT and convert the rest to NULL
View 7 Replies
View Related
Feb 19, 2008
In my application I must store over 16000 character in a sql table field . When I split into more than 1 field it gives "unclosed quotation mark" message.
How can I store over 16000 characters to sql table field (only one field) with language specific characters?
Thanks
View 3 Replies
View Related
Mar 5, 2008
Hi everybody,
I would like to know if there is any property in sql2000 database to separate lowercase characters from uppercase characters. I mean not to take the values €˜child€™ and €˜Child€™ as to be the same. We are transferring our ingres database into sqlserver. In ingres we have these values but we consider them as different values. Can we have it in sqlserver too?
Hellen
View 1 Replies
View Related
Jul 19, 2006
Good day experts,
I wonder if i got an answer for this.
How can i iliminate a letters from a set of integers and characters using a SQL Statement
for ex:
ABC9800468F
is that possible?
is there a function that i can use to iliminate them?
View 3 Replies
View Related
Oct 22, 2015
I’m getting ASCII characters in one column of my table. So I want to replace same column value in NON ASCII characters.
Note – values in column must be same
View 10 Replies
View Related
Jan 9, 2008
Hi All
I have loaded some data to the application using flat files
which has non english chars.
all the columns in the database are NVARCHAR type.
but in db and in application UI, the non english chars are being diplayed as junk chars. ???121
The application supports UTF-8 format
is there any setting at db level to be modified to display the non english char set as is.
Thanks
View 2 Replies
View Related
Nov 22, 2006
Hi! could you please check my code on adding record on my DB.. Im using SQL Server included on VWD.Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con As String = "Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Request.mdf;Integrated Security=True;User Instance=True" Dim sqlcon As New Data.SqlClient.SqlConnection(con) Dim sqlcmd As New Data.SqlClient.SqlCommand("Insert into uRequest (eticket, ename, edept, edetails, ejobpend, edate) values (@eticket,@ename,@edept,@edetails,@jobpend,@edate)") sqlcon.Open() sqlcmd.Parameters.Add("@eticket", Data.SqlDbType.Char, 10).Value = "11-0010-06" sqlcmd.Parameters.Add("@ename", Data.SqlDbType.Char, 100).Value = User.Identity.Name sqlcmd.Parameters.Add("@edept", Data.SqlDbType.Char, 50).Value = DropDownList1.Text sqlcmd.Parameters.Add("@edate", Data.SqlDbType.DateTime).Value = Date.Now sqlcmd.Parameters.Add("@edetails", Data.SqlDbType.Text).Value = TextBox1.Text sqlcmd.Parameters.Add("@ejobpend", Data.SqlDbType.Text).Value = TextBox2.Text sqlcon.Close() End Sub I've check the Data on my DB but nothing has been added. nwy, how can u create a confirmation message if the record has been successfully added.Thanks and sorry for the trouble.
View 1 Replies
View Related
Dec 14, 2004
Not 100% sure how to do this so I would appreciate some directions. I have 2 tables, Systems and Contacts. A system can have 1 to infinite contacts and contact can have 1 to infinite systems. So I use a 3rd table Sys_Con to add the contact needed for each system.
Now my question is once I add the System and contact how do I know for sure which ContactID to add in my Sys_Con table? Because while I am doing this operation maybe someone can add an other contact. So is there a way for my store proc Add_Contact to return the contactID needed for my store proc Add_Sys_Con ?
TABLE Sys_Con
SystemID int
ContactID int
Table Contact
ContactID int Identity
ContactName
...
Table System
SystemID
...
View 3 Replies
View Related
Jul 23, 2005
hi i have a question how can i delete last added row. I have 2 tables .source and destination . I take a 1 row from source table , do someoperation on it and save to destination table . after succesfull written Iwant to delete added row from source table.. i'm using a coursors. the mainproblem is : is there any function to check which row was last added. Now Iam doing it using select * from destionation where (and necessaryconditions). but if destination table will be 100000000 rows for example ittakes too much time... Is there another possibility to do it ???please helpMarcin Wolkuwolku
View 2 Replies
View Related
Sep 27, 2006
In developing a VWDE project I added 2 columns to the User table in the ASPNETDB.mdf database. I can see the columns in the Data Definition and I can see the values I added when I Show Table Data but I cannot access them with a SQLDataSource control? The SQLDataSource shows all of the columns in that table except the ones I added. Any suggestions? Thanks.
View 2 Replies
View Related
Dec 12, 2003
I would like to retreive the identity field value of a record that was just added to the table.
In other words, I have a form and on submission, if it is a new record, I would like to know the identity value that the SQL Server has assigned it.
This may be overkill, but here is my code to process the form:
Protected Sub processForm(ByVal thisID As String, ByVal myAction As String)
Dim sqlConn As New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
sqlConn.Open()
Dim sql As String
Select Case myAction
Case "save"
If thisID > 0 Then
sql = "update INCIDENT set " & _
"RegionID = @RegionID, " & _
"DistrictID = @DistrictID, " & _
"DateReported = @DateReported, " & _
..CODE...
"WHERE IncidentID = " & myIncidentID
Else
sql = "insert into INCIDENT(" & _
"RegionID, " & _
"DistrictID, " & _
"DateReported, " & _
...CODE...
") " & _
"values(" & _
"@RegionID, " & _
"@DistrictID, " & _
"@DateReported, " & _
...CODE...
")"
End If
Case "delete"
sql = "delete from INCIDENT where IncidentID = " & myIncidentID
Case Else
End Select
Dim sqlComm As New SqlCommand(sql, sqlConn)
sqlComm.Parameters.Add(New SqlParameter("@RegionID", SqlDbType.NVarChar))
sqlComm.Parameters.Add(New SqlParameter("@DistrictID", SqlDbType.NVarChar))
sqlComm.Parameters.Add(New SqlParameter("@DateReported", SqlDbType.NVarChar))
...CODE...
sqlComm.Parameters.Item("@RegionID").Value = ddRegionID.SelectedValue
sqlComm.Parameters.Item("@DistrictID").Value = ddDistrictID.SelectedValue
sqlComm.Parameters.Item("@DateReported").Value = db.handleDate(txtDateReported.SelectedDate)
...CODE...
Dim myError As Int16 = sqlComm.ExecuteNonQuery
'Response.Redirect("incident.aspx?id=" & )
End Sub
The response.redirect at the end of the sub is where I would like to put the identity field value.
View 6 Replies
View Related
Jan 4, 2006
How many triggers can be added in a table?
View 2 Replies
View Related
Jan 28, 2004
how do I position a newly added column in the table?
the default is at the very end.
what would I have to add to this code:
ALTER TABLE Vehicles
ADD Model varchar(55)
Thanks
View 2 Replies
View Related
Jan 8, 2008
Hi,
Is there a built in capability with sql server 2005 which sends emails to users upon a record insertion.
Thanks
View 2 Replies
View Related
Mar 30, 2008
is there a way to set up a scheduled sp to email me if no records are added to a certain table within the hour?
is this possible?
View 1 Replies
View Related
Jul 23, 2005
Here's the deal.I've been working on an Intranet application for my clients, and todayI went and installed the first prototype. It's a fairly standard thing- VS2003 ASP.NET/VB.NET on a SQL Server 2000 database.I restored the database onto their db server, and installed theapplication on their intranet server, and made the necessary changes tothe web.config and other configuration files.I logged on with no problem. The default form is a Search/Finder formwith no default recordset. I fired up the filter to return all therecords and the thing crashed. The filter form wouldn't get any data(there *was* data in the database - I checked that!). So I set a traceon the database and this is the SQL that was being sent to the server(note that this SQL is dynamically built and is being sent in-line):SET FMTONLY OFF; SET FMTONLY ON;SELECT fldID, fldReferenceNumber,fldRevision, fldPartNumber, fldIndentNumber, fldDescription,fldBatchNumber, fldCreatedDate FROM tblMyTable SET FMTONLY OFF;Note those SET FMTONLY OFF; SET FMTONLY ON;...SET FMTONLY OFF;directives. These direct SQL Server to return only metadata, and notdata rows. The SQL which SHOULD have been sent, and which I have justcaptured in the SQL Profiler on MY system here is:SELECT fldID, fldReferenceNumber, fldRevision, fldPartNumber,fldIndentNumber, fldDescription, fldBatchNumber, fldCreatedDate FROMtblMyTableWHERE (((tblMyTable.fldReferenceNumber LIKE N'%')))Again, note that the WHERE clause is missing from the first lot of SQL.Does anyone have any ideas about why this might be happening? I thinkit might have something to do with ownership/permissions, but Icouldn't find anything different about this database than the system onwhich this new application was modelled, which has no such problems.Edward
View 3 Replies
View Related
Oct 5, 2005
Hello all, i have a question i've beenk thinking for a little bit andcant seem to come up with a solution. What i want to do is add a uniquecounter to a resultset in query. For exampleSELECT ColumnA, ColumnB, ColumnC, ColumnDFROM AnyCombinationOfJoinsOrTablesWHERE SomeConditionIsTruewThe query above will produce a resultest of 4 columns.'A1', 'B1', 'C1', 'D1''A2', 'B2', 'C2', 'D2''A3', 'B3', 'C3', 'D3'......'An', 'Bn', 'Cn, 'Dn'Now what i want to do is add a unique identifier to every row. Theeasiest way would be to add a counter integer so the resultset wouldlook like1, 'A1', 'B1', 'C1', 'D1'2, 'A2', 'B2', 'C2', 'D2'3, 'A3', 'B3', 'C3', 'D3'......n, 'An', 'Bn', 'Cn, 'Dn'Is there a way to achieve this in T-SQL without using cursors.Thanks,Gent
View 3 Replies
View Related
Sep 14, 2007
I have a stored procedure that works fine in reporting services. It grabs the total of Yes's and No's by dates . But then i went ahead and added 2 more parameters to the proc, and now the totals are all wrong. I dont understand how that can mess everything up. Here is the previous stored proc, that gives the correct sum.
Code Snippet
ALTER PROCEDURE [dbo].[Testing_Questions_ALL_YESOrNO]
@Question char(80)
AS
BEGIN
SELECT
Qry_Questions.Question
, Qry_Questions.Date
, Qry_Questions.response
, B.Total
FROM Qry_Questions
INNER JOIN Qry_Sales_Group
ON dbo.Qry_Questions.sales_person_code COLLATE SQL_Latin1_General_CP1_CI_AS = dbo.Qry_Sales_Group.SalesPerson_Purchaser_Code
INNER JOIN
( Select COUNT(qq.response)as Total, Question, Date, response
FROM Qry_Questions qq
Where qq.response in ('Yes','No')
GROUP by qq.[Question] , qq.Date,qq.response ) B
ON Qry_Questions.Date = B.Date AND
Qry_Questions.Question =B.Question and
Qry_Questions.response=B.response
WHERE Qry_Questions.[Response Type]='YesNo' and Qry_Questions.Question=@Question
GROUP BY Qry_Questions.question,Qry_Questions.Date,Qry_questions.Response,B.Total
ORDER BY Qry_Questions.Question, Qry_Questions.Date
END
SET NOCOUNT OFF
Here is the edited version which only has two new parameters added to the proc. The edits are highlighted.
Code Snippet
ALTER PROCEDURE [dbo].[Testing_Questions_ALL_YESOrNO_Totals]
(@Region_Key int=null,@QuestionCode char(5),@Question char(80))
AS
BEGIN
SELECT
Qry_Questions.Question
, Qry_Questions.Date
, Qry_Questions.response
, B.Total
FROM Qry_Questions
INNER JOIN Qry_Sales_Group
ON dbo.Qry_Questions.sales_person_code COLLATE SQL_Latin1_General_CP1_CI_AS = dbo.Qry_Sales_Group.SalesPerson_Purchaser_Code
INNER JOIN
( Select COUNT(qq.response)as Total, Question, Date, response
FROM Qry_Questions qq
Where qq.response in ('Yes','No')
GROUP by qq.[Question] , qq.Date,qq.response ) B
ON Qry_Questions.Date = B.Date AND
Qry_Questions.Question =B.Question and
Qry_Questions.response=B.response
WHERE Qry_Questions.[Response Type]='YesNo'
AND REGION_KEY=@Region_Key
AND LEFT(Qry_Questions.[Question Code],2)IN (@QuestionCode)
AND Qry_Questions.Question=@Question
GROUP BY Qry_Questions.question,Qry_Questions.Date,Qry_questions.Response,B.Total
ORDER BY Qry_Questions.Question, Qry_Questions.Date
END
SET NOCOUNT OFF
View 6 Replies
View Related