T-SQL (SS2K8) :: Non-Printable Character Detection?

Mar 25, 2015

The following was found as a solution to detecting non-printable characters in a string. I can find no explanation of how the COLLATE function is used.

how the COLLATE function affects the search string to find the non-printable characters?

patindex('%[^ !-~]%' COLLATE Latin1_General_BIN, titlel) as [Position]

View 3 Replies


ADVERTISEMENT

SQL Server 2008 :: Cannot Drop Table With Non-Printable Character On Its Name

Sep 21, 2015

I have a legacy table which name contains non-printable characters (CHAR(31), to be more specific). The non-printable character is beside a underscore, and I've discovered that the shortcut CTRL+SHIFT+_ shoots the CHAR(31) character (which means "US" - Unit Separator). The previous developer should've hit by mistake this combination, and created the table with this weird character on it.

When we issue a SELECT command against the table, it returns results. But when we try to issue any DDL to it (DROP, sp_rename, etc), it simply doesn't work.

Examples:
DROP Table_Name; raises "Msg 15225 - No item by the name of 'Table_Name' could be found in the current database 'MyDB', given that @itemtype was input as '(null)'".
sp_rename 'Table_Name', 'NewTableName'; raises "Msg 102 - Incorrect syntax near '_Name'".

I already duplicated the table with the correct name, and have corrected it on the referenced objects (SP's, Views etc). The remaining step is just dropping it from the database. when we copy+paste from SQL Server to Notepad++, it shows the hidden chacacter ("US") on the middle of the table name, beside the underscore.

View 9 Replies View Related

T-SQL (SS2K8) :: Find String Before Character When Character Appears Multiple Times

May 17, 2015

I have a table that contains file paths as

ServernamefolderAfilenameA
ServernameFolderBFilenameB

and I need a query to return

ServernamefolderA
ServernameFolderB

I tried

SELECT DISTINCT left(Source, charindex('', Source)- 0) AS String
FROM Table

But that removes everything after the first and I need it to return all data before the last

View 5 Replies View Related

T-SQL (SS2K8) :: Replace Multiple Occurrences Of Same Character With Single Character

Aug 6, 2015

I have the following scenario, The contents of main file are like :

ServerCentral|||||forum|||||||||||||||is||||||the||best
so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it

And I need the output in the following form:

ServerCentral=forum=is=the=best
so=be=on=it

The logic being that multiple and consecutive occurrences of the special character, here - pipe , should be replaced by a single special character.

View 5 Replies View Related

T-SQL (SS2K8) :: Insert Value Generate Special Character

Mar 12, 2014

I have a web page where the user can select the language (FR, EN, BG, ...) in a drop down list.

Next to the drop down list there is a text box where user can type the some text (translation).

User can add several description

On my web page, i have a button this button collect all information create an xml file and save all in database (sql server 2008)

that's work fine for some language => FR, EN and so on

But for bulgarian (bulgare) and greece there are some problem...

Some characters when i display it in sql look like => ???s??. ? d??ta?? a?t?

The value encoded by the user is => Ένωσης. Η διάταξη αυτή

but the result after t sql xpath is => ???s??. ? d??ta?? a?t?

Here is it my sql code where you can find my temporary table and my xml file and my xpath query

declare @tblTranslation table (idDocID int, languageID varchar(10), value varchar(500))
declare @Translations XML

set @Translations = '<?xml version="1.0" ?><Items><Item><eleKey>EN</eleKey><eleValue>This is a test</eleValue></Item><Item><eleKey>FR</eleKey><eleValue>test</eleValue></Item><Item><eleKey>BG</eleKey><eleValue>Ένωσης. Η διάταξη αυτή</eleValue></Item><Item><eleKey>HR</eleKey><eleValue></eleValue></Item><Item><eleKey>RO</eleKey><eleValue></eleValue></Item></Items>'

-- 2) fill the temporary table with information from the xml file

INSERT INTO @tblTranslation(idDocID, languageID, value)
SELECT
1
, Convert(nvarchar(max), i.query('eleKey/text()')) as colKey
, Convert(nvarchar(max), i.query('eleValue/text()')) as colValue
--
FROM @translations.nodes('/Items/Item') as x(i)
SELECT * FROM @tblTranslation

View 3 Replies View Related

T-SQL (SS2K8) :: Replace A Special Character In Results?

Jun 11, 2014

I have an database that is housing a path used to locate an external file. This application was written many years ago and I am now trying to bring the files into the database as a VARBINARY.

The table is holding the path like this "/folder/folder/file"

I am trying to convert that path to "folderfolderfile"

In my Select statement I have

SELECT ProdID, REPLACE (PATH, /, ) FROM dbo.blahblah

The problem is that I can't figure out to make SQL understand that "/" is the character I want to replace.

View 2 Replies View Related

T-SQL (SS2K8) :: Remove All Characters After 3rd Repetition Of A Character?

Sep 19, 2014

best possible way to remove all the characters after a 3rd repetition of a character?

For Example:

I want 10.0.1600.22 to be 10.0.1600

Everything after and including the '.' to be removed.

I understand Substring_Index() is not available whats the other options?

View 4 Replies View Related

T-SQL (SS2K8) :: Select Only Rows With Alphabetical Character In Column?

Apr 17, 2014

i am working on a small project, that I have found that someone is storing a float as a varchar(). But there are also some actual words in the same column.

I am trying to determine how I can select only the rows with alphabetical characters in that column.

Some of the data is:

1.5008e+015
1.54453e+015
1.51922e+015
1.51922e+015
1.52243e+015

but there is a mix of alphabetical characters in there as well.

1.51922e+015
1.53122e+015
FMCIT
ABCNP
FMCPNG
1.62073e+015
1.6127e+015

I want to be able to select the rows with only the alphabetical characters. There is a huge mix, and I am assuming that every first letter is one of the 26 alphabetical character used. How can I write a query to use a REGEX to select any and all rows that cannot be CAST as a Float? I have nill to no experience using REGEX.

View 9 Replies View Related

T-SQL (SS2K8) :: Split Function That Allows Multiple Character Delimiter

Mar 25, 2015

I have a table with a varchar column that is delimited by char(227)+char(228)
i.e.,

OrNo=7807ãäSeqNo=1ãäPStopType=PãäPCity=TillsonburgãäPSt=ONãäPZIP=N4G4J1ãäPAdr1=10 ROUSE STREETãäPAdr2=ãäPLat=42.8625ãäPLon=-80.7267ãäDStopType=DãäDCity=GaffneyãäDSt=SCãäDZIP=29341ãäDAdr1=121 PAN AMERICAN DRIVE

Looking for split function that accepts a multiple character value as a delimiter?

View 7 Replies View Related

T-SQL (SS2K8) :: Replace Multiple Characters With Single Character In A Column?

Jun 21, 2012

I am trying to replace all special characters in a column with one special character.

Example:

Table: dbo.Employee
Column: Name
Name
-------
edwardneuman!"<]
mikemoreno)'>$:
JeffJensen"?>"

I am trying to get the namepart to the left of ANY special character. To achieve this, I am thinking of replacing all the special characters with a single special character so that I can find the first occurrence of that special character and grab left of the special character (SUBSTRING/CHARINDEX). This way I don't need to loop through all the special characters.

I am expecting the following results:

Name
-------
edwardneuman<<<<
mikemoreno<<<<<
JeffJensen<<<<

View 9 Replies View Related

T-SQL (SS2K8) :: Wrap Varchar Field Based On Character Count And Spaces

Dec 8, 2014

Because of a limitation on a piece of software I'm using I need to take a large varchar field and force a carriage return/linebreak in the returned sql. Allowing for a line size of approximately 50 characters, I thought the approach would be to first find the 'spaces' in the data, so as to not split the line on a real word. achieve.

--===== Simulate a passed parameter
DECLARE @Parameter VARCHAR(8000)
SET @Parameter = (select a_notes
from dbo.notestuff as notes
where a_id = '1')

[Code] .....

View 5 Replies View Related

T-SQL (SS2K8) :: Conversion Failed When Converting Character String To Small Date-time Data Type

Jul 15, 2014

All source and target date fields are defined as data type "smalldatetime". The "select" executes without error though when used with "insert into" it fails with the error:

Msg 295, Level 16, State 3, Line 25: Conversion failed when converting character string to small date-time data type..I am converting from a character string to smalldatetime since the source and target date columns are "smalldatetime". All other columns for the source and target are nvarchar(255). I assume there is an implicit conversion that I don't understand. In a test, I validated that all dates selected evaluate ISDATE() to 1.

USE [SCIR_DataMart_FromProd_06_20_2014]
GO
IF OBJECT_ID ('[SCIR_DataMart_FromProd_06_20_2014].[dbo].[IdentifierLookup]', 'U') IS NOT NULL
DROP TABLE [SCIR_DataMart_FromProd_06_20_2014].[dbo].[IdentifierLookup]

[code]....

View 9 Replies View Related

MSI And SQL Server Detection

Dec 21, 2003

how do they provide the dialog box in the start kits, the one with the combo boxes of available servers, and a test connection button?

You can add custom forms in visual studio setup wizard project, but I haven't been able to figure it out yet - what do they use in the starter kits?

View 1 Replies View Related

Conflict Detection Property

Feb 17, 2008

hi;
What is conflict detection in sqldatasource control?
Thanks,mohsen

View 1 Replies View Related

Torn Page Detection

Sep 14, 2000

Anyone working with databases with this option turned on? How does it affect performance?

View 3 Replies View Related

Torn Page Detection

Jan 7, 2005

Hi, We recently had one of our drives (RAID5) replaced because of failure. This has resulted in a torn page being detected on one of our smaller SQL 2000 databases. We have one or two larger SQL databases (30-70GB) on the same drive amongst several others and are now concerned that we may have a problem with these databases also. (The original torn page only came to light when a query was run on one of the tables). Is there anyway I can run a procedure on each of the databases to find out if we have any problems with torn pages? I obviously don't want to restore the databases as this will take a substantial amount of time that we just don't have at the moment. Any ideas that could put our minds at rest would be much appreciated.
Many thanks.

View 4 Replies View Related

Torn Page Detection

May 22, 2007

I want to switch this setting off on all db's - that's easy.

But I presume that means the problem could occur without me knowing for weeks (maybe due to a defective disk driver). So is there a way I can schedule a maintainance task that will check for this problem out of hours? (Maybe by switching the DB option on for a while and then back off? If you switch the option on, does it check the whole database? Or does it just do checks during the actual update?) Hopefully there is a better way than that to do it...

Also, am I right in saying that CHECKSUM is new to 2005?
And what do you guys use: Checksum, Torn Page Detection or None?

View 8 Replies View Related

Deadlock Detection Problem! Help

Jul 23, 2005

Hello faculties,i'm encountering a strange a deadlock problem on my remote serverwhich is used to give application demo to the client. It has happenedthat on one of the databases a deadlock situation is taking place.What is the most detailed way to detect such the cause of such adeadlock to the innermost level of detail, like what statements, storedprocedures and locks are causing the deadlock to occur.Guys! please help me out!Thanks in advanceDebian*** Sent via Developersdex http://www.developersdex.com ***

View 1 Replies View Related

Clustering For Anomaly Detection

Mar 14, 2008

Hi,

I have been trying to use the Clustering algorithm for Anomaly Detection, but it has been quite difficult to get correct results for PredictCaseLikelihood.
Using a very large number of clusters helped, but there are other problems.
The algorithm does not take into account all the columns in my nested table, but only uses Exists/Not Exists for the nested table key column. In my case the nested table contains also a column with a count of key attribute.

I am about to abandon the Sql Data Mining.

Does anyone have more insights into tuning the Clustering algorithm for anomaly detection?

Thanks

View 1 Replies View Related

Turning Torn Page Detection ON

May 7, 2007

Are there any issues turning this ON?

I have inherited a database which started life under SQL 7 (where Torn page Detection was OFF by default), and I'd like to turn it on. Will this reshuffle all the pages to make room for the extra check-sum, or is that stored in a single block somewhere else such that it can easily be added?

Is the change going to block access for long? (DB = between 2~5GB)

Thanks

Kristen

View 5 Replies View Related

Change Detection/Rollback Required

Jul 28, 2007

Hi

My table’s data is deleted by unknown person.
I can detect some thing about it i.e. user name, time, etc of this event?

Is there any way to rollback changes though logs?

Wishes
Jawad

View 2 Replies View Related

DB Engine :: Deadlock Detection And Actions From A DBA

Jul 29, 2015

what are the best ways to action on the Deadlock issues. I am aware how a deadlock is occurred and we can get the queries causing by the Trace, and Profiler. What will en best steps to Investigate from DBA end later collecting the stats.What steps will ensure to get these deadlocks addressed.

View 4 Replies View Related

Real Time Anomaly Detection

Jan 20, 2008



Hi,
I'm would like know if the analysis service data mining enables to detect anomalies from "normal" behavior/patterns of data (1), and alert about such anomalies when detected (2). both above sql server relational DB (3).

Thanks,
Eyal

View 5 Replies View Related

Is It Possible To Disable Poison Message Detection?

Aug 3, 2006

Hi,

I'm using the Service Broker to parallize my processes (I know that the Service Broker was not designed for that purpose), however it's working quite well.

I use the broker procedure to start procedures which all process all a part of the workload. When the procedure fails because of a lock timeout (or for that concern, for whatever reason), I rollback the transaction (which also roll back my message received on the queue so that it can be retried at a later time.). And this is where my problem lies, if there are 5 sequential rollbacks of messages then the poison message detection kicks in and disables the queue, stopping all the processing. :(

Is there a way to disable poison message detection? I have implemented my own stop-mechanism through a counter system on a per sub-task system so if I could disable poison message detection that would be ideal.

If this is not possible is there a way to turn the queue back on automatically so that it will continue processing the messages on the queue?

Cheers,
Peter.

View 7 Replies View Related

IIS Detection On Vista: Where's My Windows Authentication Option ?

Mar 3, 2007

I am trying to install RS on Vista. I notice that the list of IIS features to turn on, listed in the KB article and blog entries, mentions a "Windows Authentication" IIS feature to check under Security. I don't have that (although I have one labeled "Basic Authentication") -- I'm on a "workgroup" computer at home.

Does this mean that you simply can't install RS on Vista unless you're joined to a domain? Thanks,

-Doug

View 18 Replies View Related

Select Part Of Character String Based On A Character

Apr 15, 2004

I have data in a column that starts with 1-4 characters followed by a dash then followed by an number of characters (ex: EU-Surgery).

How do I select everything to the right of the dash when the number of characters to the left of the dash varies?

View 3 Replies View Related

Torn Page Detection And Auto Shrink: Performance?

Feb 16, 2006

Hello everybody,First: SQL Server 2000 sp3a, HP cluster server, MS 2003 server,database recovery model simpleTorn page detection:When I have this option turned on, processes conected with updating andwriting in database, was MUCH more slower, than if I've this optionturned off.It seams to me, that when this option is turned on, the sqlserver ismuch more slower by any operation connected with writing, than withoutthis option.This option is required for ensurance, that the data are writtenproperly on the media.My question is:if I have my database running under cluster, with RAID hd system, whichcontains write cache, with additional checking, that the data will bewritten correctly, is it necessary for me to keep this option turnedon?Auto shrink:When it is turned on, does it affect performance?Personaly, I don't think so, but somebody is insysting on it, and Iwould like to have an information from independent source about that.Best regardsMatik

View 13 Replies View Related

Return Left-most Character From 8 Character String

Oct 1, 2014

I'd like to return the left-most character from an 8 character string & the third from the left character too.

Like this ABC00123 returns AC

$query = "SELECT LEFT(uninum,3), RIGHT(uninum,5), clmarea, Date FROM tblunimov";
$result = mysql_query($query) or die(mysql_error());

echo "<div class='tblstyle1'>";
echo "<table class='tblstyle1'>";
echo "<tr><th>ini</th><th>item</th><th>area</th><th>date</th></tr>";
while($row = mysql_fetch_array($result)){

[Code] ....

View 5 Replies View Related

DB Engine :: Change Deadlock Detection Interval Time To Less Than 5 Seconds?

Jun 10, 2015

Is it possible to change the default detection interval time to reduce to less than 5 seconds.

We have latency in trouble shooting the deadlocks and causing blockings more on our critical Production server.

View 10 Replies View Related

Blocking Telnet Command For SQL Server Detection 1433/1434

Aug 7, 2006

Any ideas how I can I block telnet connections to SQL Server ports ?

View 1 Replies View Related

Replication Loop Back Detection Problems In SQL Server 2000

May 10, 2007

Hi,



I am monitoring my replication process and I have a problem with the loop detection, I can see origined transacctions in the server, executed in the same for the replication.

The subscriptions configuration is sp_helpsubscription


exec sp_addsubscription @publication = N'PUBLICATION',
@article = N'all',
@subscriber = N'192.168.0.23',
@destination_db = N'PRUEBABD',
@sync_type = N'none',
@update_mode = N'read only',
@offloadagent = 0,
@dts_package_location = N'distributor',
@loopback_detection = 'true'
GO







I need for help.

View 4 Replies View Related

SQL Server SP2 Command Line Upgrade Switch And Express Version Detection

Mar 9, 2007

Our application installation setup needs to be able to detect:

Is SQL Server 2005 Express Installed?

If false, run the SP2 Installation
Is SQL Server 2005 Express or SQL Express SP1 Installed?

If false, run the SP2 Installation with Update Switch
Is SQL Server 2005 (not Express) Installed

If true, abort installation with a mesage.

Can you direct me to some documentation about testing for these environments or just if someone has some scripts that will run in InstallShield, that would be great.

ALSO, can you direct me to information about using the command line update switch for the Express SP2 Installer?

Thanks.
Pat

View 1 Replies View Related

Read Chinese Character From SQL(SQL Server 2005) Database Table Column And Display Chinese Character

Feb 1, 2008

Hi!

I have a table like this below and it doesn't only contain English Names but it also contain Chinese Name.
CREATE TABLE Names
(FirstName NVARCHAR (50),
LastName NVARCHAR (50));
I tried to view the column using SQL Query Analyzer, It didn't display Chinese Character.
I know that SQL Server 2005 is using UCS-2 Encoding and Chinese Character uses Double Byte Character Set (DBCS) Encoding.
I want to read the FirstName and LastName columns and display in Window Form Data Grid and ASP.NET Grid View.
I tried to use this code below and it didn't work. It convert some of the English Name to Chinese Character and it display the chinese character and some still in the original unreadable characters.
Does anybody know how to read those character from SQL Table and display the correct Chinese Character without converting the English Name into Chinese also?
Thanks

int codePage = 950;
StringBuilder message = new StringBuilder();
Encoding targetEncoding = Encoding.GetEncoding(codePage);
byte[] encodedChars= targetEncoding.GetBytes(str);
.
message.AppendLine("Byte representation of '" + str + "' in Code Page '" + codePage + "':");
for (int i = 0; i < encodedChars.Length; i++)
{
message.Append("Byte " + i + ": " + encodedChars);
}

message.AppendLine(" RESULT : " + System.Text.Encoding.Unicode.GetString(encodedChars));
Console.Writeline(message.ToString());

View 1 Replies View Related







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