Hello,
I faced a problem while reading some strings from the database (SQL 2005). Some letters are encoded with html codes making the sorting really difficult. I tried to use IComparer objects with different CultureInfo information, but it doesn't do any good.
I am quite new to the web development, so I don't really have any clue if there is a recommended and clean way of solving this problem. It could be that it's something really simple, but I only came up with an idea of search and replace in all strings. If possible, I would like to omit this. :) If not, please let me know.
Thanks in advance.
Hi I would like to use SQL Express as a central database in a project but I have few things in my mind needs to be answered.
I need to create a parts table and when a user opens a part in the client application no other user should be able to modify that part info. Is this taken care by database or should I use a flag in the parts table which indicates particular part is opened and in use?
If a row (a part) in part table is read by a client how this effects the other related tables? For instance if I open part1 info in my client application and also accessed to part1 properties in another table, how can I prevent other clients to make modification in related tables related rows?
What is the best way for submiting an image for a part in part table? I dont want to store images in the database. Do I need some file transfer code which takes care of transferring image and returns the path to the database?
We have about 150 SQL servers and basically we're considering the pros and cons of installing SSIS on a central SSIS server - that is responsible for all DTS jobs - as opposed to installing SSIS on the local SQL instance.
On the plus side so far:
1./ Central administration, alerting, change management etc
2./ Possible performance gain on the local instance not having SSIS installed?
On the negative side:
1./ Central point of failure
2./ Possibility that it would need to be a clustered...
3./ Compatibility issues may mean having to make the central SSIS server 32-bit?
4./ Possible performance cost of remote SSIS?
5./ With multiple DTS packages running at different times, when would we take the server down for maintenace...?
Hi all, I have an application which will send out email in plain text in multi langauage.the email content will be pull from txt file save in UTF-8.i can send out email from the template with the encoding. but when i insert data from the SQl server. the data from the SQL server are not encoded.how do i encode the data (in other lanagauge) from sql server into UTF-8 so that it can be send together with the template. I have try changing the data into byte and encode it in UTF-8.but it won't displayed correctly. pls help. thanks
Hi, I am getting this error: {"XML parsing: line 1, character 43, unable to switch the encoding"} System.Data.SqlClient.SqlException when I run the code below. I know it is caused by the fact that the encoding of the XML file I'm trying to insert is not utf-16, but rather utf-8. However I would like to be able to enter any encoding. Is this possible? If not is there a way to convert the encoding before I insert? Or any other ideas anyone might have. Thanks! XmlDataSource xds = new XmlDataSource(); xds.DataFile = tbLink.Text.Trim(); xds.XPath = "rss/channel/item"; XmlDocument xmlDoc = new XmlDocument(); xmlDoc = xds.GetXmlDocument(); string strConn = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; sqlComm.Parameters.Add(new SqlParameter("@XMLData", xmlDoc.InnerXml)); strSQL = " INSERT INTO tblCastStore ( intCastID, CastXML ) VALUES ( @@IDENTITY, @XMLData );"; sqlComm.CommandText = strSQL; try { sqlConn.Open(); sqlComm.ExecuteNonQuery(); sqlConn.Close(); } catch (SqlException se) { lblError.Text = se.Message; }
The problem is: reading data with ADO is OK (Lithuanian), but when I try to write, most of national encoding goes to hell (plain ascii). What's wrong with it? I see no option to set code page.
The following TSQL code will take a character string and perform the encoding that is necessary to generate a BARCODE 128 formatted string to be used with a BARCODE 128 font.declare @myString varchar(255) select @myString = 'BarCode 1'
-- Define the final holding place of our output string declare @finalArray varchar(255)
-- Define the variables that we'll need to be using declare @checksumTotal int declare @checksum int select @checksumTotal = 104; select @checksum = 0;
-- Start building our output select @finalArray = @startchar
-- Loop through our input variable and start pulling out stuff declare @position int declare @thisChar char(1) select @position = 1 while @position <= len(@myString) begin select @thisChar = substring(@myString, @position, 1) select @checksumTotal = @checksumTotal + (@position * (ascii(@thischar)-32)) select @finalArray = @finalArray + @thisChar select @position = @position + 1 end -- We've gone past the length now
-- Now we need to figure out and add the checksum character select @checksum = @checksumTotal % 103 if @checksum = 0 select @finalArray = @finalArray + @spacechar else -- Barcorde array assumes 0 as initial offset so we need to add 1 to checksum select @finalArray = @finalArray + substring(@asciiString, @checksum+1, 1) -- Now we append the stop character select @finalArray = @finalArray + @stopchar
-- The @final Array represents the barcode encoded string select @finalArray
Hope it helps, Dalton
Blessings aren't so much a matter of "if they come" but "are you noticing them."
I have a user who is using data from my database for a webportal. One of my tables had a field that was type NText. The technology he is using couldn't cope with NText so i changed the data type to nvarchar instead. The user is now getting some superfluous characters coming back as part of the data in the field e.g. '12 ' where a space appears if looking at the data through something like Query Analyser. He was asking if I could change the character encoding to Unicode.
I thought that datatypes like Nvarchar were unicode anyway but I guess the fact that I changed the type might mean that I need to explicitly declare it as unicode. Does anyone know if this is the case?
I'm pretty new in SQL and I'm kinda confused with the concept of encoding in SQL. I tried to read several article but there are still things that I don't understand. I have a table with two columns and these column contain english and chinese character. CREATE TABLE Names (FirstName NVARCHAR (50), LastName NVARCHAR (50)); The collation for both column is Latin1_General_BIN
My question is 1. Does all data that is saved in nvarchar column have the same encoding type which is UCS-2? 2. If a client application input a chinese character into the database table, what is the encoding type of that data? Is it UCS-2? 3. If a client application successfully enter chinese characters into database table and i want to display those chinese characters saved in the database into a web page, do i need to convert those chinese character from UCS-2 (Unicode) into Big-5 encoding?
Hi all,I have an issue on querying against UTF-16 encoded characters inSQL2000 database: For example the "López" is saved into database as"López" (due to the UTF-16 encoding); somehow, when I query datawith conditions of "like 'lop%'" or "like 'Lóp%'", the row of Lópezwould not return.NOTE: the accent insensitive collation can not help in this case.Thank you,Albion(052X)
I've seen a dump of the TDS traffic going from my webserver to the SQLServer database and it seems encoded in Unicode (it has two bytes perchar). Seems it would have a huge impact on performance if ittravelled in one byte. Why might this be?rj
I have to import large xml file in sql server and I use data transfer task and xml source.
The xml file are generated without specifing any encoding, and so I obtain many character error if i don't change the encoding.
When i put "by hand" (with a xml editor) in the xml file this encoding <?xml version="1.0" encoding="ISO8859-1"?>, the SSIS task works perfectly without any error.
So, i'm looking for a way to use this encoding without editing xml file (more than 500 mb...). the way that i can imagine are:
1) change the package encoding (but I haven't find this kind of settings)
2) change the xml source encoding (but I haven't find this kind of settings)
3) change the console chcp (normally i have 850, i have tested 1252 but without any success)
4) make a xml trasformation (but i don't know the best way); I've tried with XML task without any success...
I have a question about MS sql 2000 and hope someone can give me a hand though this may not be the most suitable place to post.
I have created multiple databases storing multi-country data. Tables and store proc in each db are exactly the same except they are placed and run in different dbs in runtime.
My question is: Is it possible to centralize all the store proc and function into a central db (or a dummy db) for easy maintenance but it allows us to point to the desired database environment in runtime even I run the store proc in central database.
I find the "Use database" command but it does allow us to use it in store proc. Any advice or suggestions???
I am attempting to centrally register all of my sql server so I can go to any workstation and open enterprise manager and select to read the sql server registration from the remote server.
I followed all of the steps in books on line about going to the central server, turning off the store/user independent option, registering all of the servers and then going to a workstation and selecting the option to read from the central server.
I get error messages like registry read error: 5 and registry read error: 2
This is getting frustrating because we have a lot of servers in our environment and re-registering them everytime is getting to be quite a pain. If the central store will not work, is there a way to write a script to register all servers in an enterprise.
I am trying to acheive the central subscriber model for Sql server 2005 replication. I have two publishers and the centrol subscriber. Both publishers are Sql server 2005 Workgroup edition. The following table shows the Software I have used for the test.
SQL version
Service pack
HotFix
Publishers
SQL Server 2005 Workgroup edition
2
1
Subscriber
SQL Server 2005 Enterprise edition
2
1
I have encountered an obstacle in the replication process to achieve the Central subscriber model. I have configuration table, It exists on servers TB1 and TB2 and want to amalgamate the data to a central subscriber. There are two duplicate primary key and overlapping values existing across the 2 publisher tables. These records need to be updated during the process of replication.
Normally, the default Article properties settings are used 'DROP existing table and re-create it', however here we don't want this setting, because the one table records will then be removed, leaving just the data from the other table. So, we modify the article properties on the snapshot tab to 'Keep the existing table unchanged'€™. As result we got the PK violation error.
I have tried using -SkipError option in distribution job Replication Agent Profiles, that did not work.
Hi, I've spend quite a bit of time on this but no luck. so any help is really appreciated.
I'm writing a class library dll that would pull data from a central db to offsite comps, manipulated then updated it back to the central db, much like systems salemen would use. Please keep in mind that i'm talk about LARGE amount of data. I want downloaded data to be manipulated on the client computer(without direction connection to db server) with EXCEL or something of the likes then upload changes back to the central DB.
Is there anything in SQL Integration Services that would help me? please keep in mind that data are distributed to computers over the internet, not on the same LAN. Please be as specific as possible
i'd really appreciate any help you guys can provide, thanks.
I'm storing data in SQL Server 2005 Express ntext fields. I've added <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> to the Master Page, but apostrophes and other characters are appearing incorrectly in the browser. For example, apostrophes are appearing as Æ. They seem to have changed to this when I upsized from Access to SQL Server (so I have Æ in the db field).The back-end of the site is still in classic asp, where I can set the CodePage to 65001 and the CharSet to utf-8, and everything appears fine there. What can I change in the ASPX to get characters to display correctly?
I found a problem that I want to input chinese to SQL2000. I have already change the data type to "ntext" and for the ASP webpage I have chose the encoding to "big5". But the problem is I can't insert chinese string to the database from ASP. Can anyone help??
SQL Server service accounts; the default (and recommended) service account is NT ServiceMSSQLServer virtual service account - which is shown as MSSQLSERVER locally - if you want to assign permissions to a local location. Fine, that's OK, works.
For network resources, as far as I understand it (or think I do, anyway), a virtual service on a box is made visible to the network using the <Domain><Computer>$ credential. Eg for box Bimble on Domain Wimble - if I want to give access to a directory on backupServer1, I simply assign rights to WimbleBimble$ and SQL Server should get those rights.
This, or so I thought, should allow SQL Server access to that location. The thing is, when trying to access that location, it's throwing an access denied error. But it works fine with LocalSystem.
Do I need to do some additional configuration to allow the Virtual Service account to be shown via <Domain><Computer>$ ?
Dear group,i have the following setting:satellite databases in different locations with the same structure (andsometimes identical data) need to be replicated into one centraldatabase. The databases hold information on machine results andmachines are numbered from 1 to n.Results for machine 1 in location 1 should be entered in the centraldatabase whereas results for machine 1 in location 2 should also beentered.Thus i would need a copy of the tables in the satellite database whichadds one column for "location id" (or something like that).Is there an easy way to accomplish this ? Seems to me that thereplication scenarios in the "replication wizard" for SQL-Server missout this case.Some hint at documentation or websites would be extremely helpful.Thanks + Greetings from ViennaUli
I downloaded and installed SQL Server 2005 SP2 update on my reporting services server. I think downloaded and installed the share point reporting services admin to my share point dev server. I open up the central administration and there is no reporting services menu option under the Application menu. The sharepoint server is a farm with backend database on one server and all the web apps on the other (where the add-in was installed). The reporting server is a separate server running its own instance of SQL 2005.
I installed the following: * SP2 for SQL Server 2005 on Server 2 * Web-front end install of Sharepoint 2007 on Server 2 - to install the object model * SSRS2005 reporting services add-in for Sharepoint technologies on Server 2
Since doing that, I can no longer get to central administration on Server 1 - I now get the following error when navigating to central admin:
Server Error in '/' Application.
Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Which web.config do I have to edit to get the full error to show, and has anyone else experienced this?
This happened to me when my servers were fully configured and had data - so I rebuilt them from scratch and the same problem occured again!
1) In which codeset OPENROWSET reads the datafile? Is there any way to specify to OPENROWSET to read in a specific format(i.e. as Unicode data or non-unicode data etc.)? 2) Can we specify datatype as "SQLCHAR" and collation type as "SQL_Latin1_General_CP1_CI_AS", in format file, for unicode characters? If this is wrong,what is the alternate for Unicode characters? 3) Is there any other place the problem can be?
I wrote a CLR function, which is receiving some XML parameters. In certein situations it gives me the following error message:
Msg 6522, Level 16, State 1, Line 58 A .NET Framework error occurred during execution of user-defined routine or aggregate "svmScale": System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 27. System.Xml.XmlException: at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount) at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount) at System.Xml.XmlTextReaderImpl.ReadData() at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars) at System.Xml.XmlTextReaderImpl.ParseText() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Xml.XmlWriter.WriteNode(XmlReader reader, Boolean defattr) at System.Data.SqlTypes.SqlXml.CreateMemoryStreamFromXmlReader(XmlReader reader) at System.Data.SqlTypes.SqlXml..ctor(XmlReader value) at UserDefinedFunctions.svmScale(SqlXml sql_problem, Boolean perChannel, Single x_factor, Single y_factor)
If I cahnage one of the zeros in the given tag, the error message disappears. If i cut the given tag, the error message disappears. If I cut the given tag, and then paste the previous one in place of it, the error message APPEARS. So my conclusion is, that any tag can be wrong on a specific position in the XML. This makes me wonder.
Another wonderfull thing is, that if I take this CLR function, and the same TSQL code, and I do run it on my notbook with my SQL Express, no error message. But if I try to use it on the server, with SQL 2005 it drops me this error message. The resulting XML is coming from an SELECT FOR XML AUTO, so i suspect it not having illegal characters inside. This is probably true, becouse the above replace procedure can make the message disapear.
The server: Product: Microsoft SQL Server Enterprise Edition Op System: Microsoft Windows NT 5.2 (3790) Platform: NT INTEL X86 Version: 9.00.3027.00 Language: English (United States) Memory: 4095 (MB) Processors: 2 Collation: SQL_Latin1_General_CP1_CI_AS Clustered: False
The notebook: Product: Microsoft SQL Server Express Edition Op System: Microsoft Windows NT 5.1 (2600) Platform: NT INTEL X86 Version: 9.00.1399.06 Language: English (United States) Memory: 1015 (MB) Processors: 1 Collation: SQL_Latin1_General_CP1_CI_AS Clustered: False
I am trying to do string scrubbing in a sql clr function, including removing certain HTML formatting. I would like to use HtmlDecode method, but it's my understanding that System.Web is not available for Sql Clr (without marking code unsafe - not an option for me as this is for an application we sell externally, and unsafe calls woudl not go over well with customers). Is there any class that IS supported for Sql Clr that exposes this functionality? Thanks.