Transact SQL :: Replace Not Supporting Square Bracket?
Jul 1, 2015
update t1
    set t1.col1 = replace(t1.col1, t2.col1, t2.col2)
from table1 t1
inner join table2 t2 on t1.col3 = t2.col3
I am not able to replace some record which of t2.col1 contain like "[abc]def"
I have used "[][abc]def" and "/[abc/]def" for same but its not working.
View 4 Replies
ADVERTISEMENT
Oct 20, 2007
Hi, I am new to ASP.NET and Visual Web Developer 2005 Express, which I run on Windows Vista. I am currently going through some of the tutorial videos on http://www.asp.net/learn/videos/ . I encountered an error in Lesson 04 and I would have ignored it but it keeps haunting me and now I cannot proceed with the lesson 09 all because of the same error. I would really appreciate it if somebody could help me resolve this because it.
General error text
The database filename can not contain the following 3 characters: [ (open square brace), ] (close square brace) and ' (single quote)
Lesson 4 circumstances
Web.Configis modified to contain the following code just before the closing </system.web> tag:<anonymousIdentification enabled="true"/><profile enabled="true"> <properties> <add name="MyNewProperty" allowAnonymous="true"/> </properties></profile>
View 2 Replies
View Related
Feb 8, 2005
I'm building an app to manage the upcoming NCAA March Madness tournament. I'm going to use a third-party control from www.tourneylogic.com to manage the actual brackets, but I've got a problem in determining the winner for a public pool I'm running.
Basically, I want to select the winner of the pool based on points awarded for correctly picking the winners of the games in each successive round of play. For example: if you correctly pick the first round winners, you get 1 point per game, the second round gets 2 points, the Sweet 16 gets 4 points, the Elite 8 gets 8 points, and the Final Four gets 16 points per game. (Correctly picking the National Championship game winner gets 160+1 points, so that someone picking the every game BUT the final won't possibly have more points than the final game).
I'd like to do this all at the database level, within a single stored procedure. I'll write a simple administrative SPROC to aggregate all users' point totals at the end of the tournament, and then display the final tallies. So my problem is designing a SPROC that will run through each user's posted picks, check if they picked a winner, and if so, assign a certain number of points - and then sum this whole range of values to assrive at a final tally of points.
If anyone has done this before, using a tiered scoring system, I'd appreciate the input.
View 10 Replies
View Related
Sep 25, 2015
Declare @tragetdb Varchar(max)
SET @tragetdb='xyz1'
 Declare @RestoreCmd Varchar(max)
SET @RestoreCmd= 'RESTORE DATABASE XYZ FROM DATABASE_SNAPSHOT='+''+ ' @targetdb'+ ''
 print @RestoreCmd
O/p:
RESTORE DATABASE XYZÂ FROM DATABASE_SNAPSHOT= @targetdb
But i am looking forÂ
RESTORE DATABASE XYZÂ FROM DATABASE_SNAPSHOT= 'xyz1'
 i tried using "" + "" , ' + ' , no luck..
View 5 Replies
View Related
Oct 24, 2008
I'm cleaning up a column in my table and getting rid of special characters.The only think I can't get rid of with the REPLACE function is single quotes.I'm doing aUPDATE TableSET Column = REPLACE(Column,'''','') --that's four single quotes then two single quotesBut the single quotes in my column wouldn't go away.I know that
DECLARE @string varchar(50) = 'test''s strings'SET @string = REPLACE(@string,'''','')SELECT @string
View 19 Replies
View Related
Jul 1, 2015
Update query to modify a Url in the text column with another url
Ex:
Col1Â Col2
1 An unexpected event occurred
https://abc.def.com/default/_workitem/10325
3Â This alert occurs when service jobs run on
https://abc.def.com/default/_workitem/10118
10Â This alert fired to indicated that error with
https://abc.def.com/default/_workitem/10150
to
Col1 Col2
1 An unexpected event occurred
https://abc.def.com/default/_workitem/11111
3 This alert occurs when service jobs run on
https://abc.def.com/default/_workitem/11111
10 This alert fired to indicated that error with
https://abc.def.com/default/_workitem/11111
View 3 Replies
View Related
Jul 21, 2015
I would like to create a function that will replace a string using a reference table
I have a table : reference
ID String ReplaceWith
1 ≈ &
2 < <
3 > >
If I pass a string into a function, function needs to replace a string with replace with string column in reference table
For example, if I pass   a string : car $ap; fjld
The function should return car & fjld
How can i create a function like this so that i can call it in Stored procedure....
View 12 Replies
View Related
Aug 12, 2015
I have a separate list of calendar years with radiocarbon year equivalents in SQL server but no conversion equation. Most but not all of the data I have is in radiocarbon years. I thought at first I could just link the tables but I don't want the data that is already in calendar years to be linked to this conversion table. Is there any way I can either link the two tables with criteria for which data is linked (Only ages that are in radiocarbon years). Or possibly a way to query all ages that are in radiocarbon years and do something similar to a find and replace with a large list of numbers to change?
View 14 Replies
View Related
Jul 13, 2015
I need one query:
create table #task(TaskId bigint unique, Name varchar(2000))
insert into #task values(1, 'Text Text Text Text Text Text Text <<Name>> Â Text Text Text <<Salary>>')
insert into #task values(2, 'Text Text Text <<Name>> Text Text Text Text <<Company>> Â Text Text Text <<Salary>> Â Text Text Text')
[Code] ....
Now I need to create an inline function who resolve the task name with appropriate values and return me the resolved task name
select * from fn_TaskResolver(1, 'Text Text Text Text Text Text Text <<Name>> Â Text Text Text <<Salary>>')
I try this function but its return multiple rows as i just want to return one row. as I have big data set so i don't want to use scaler or Multi Line function.
create function fn_TaskResolver(@TaskId bigint, @name varchar(2000)
Return table
as
return
[Code] ....
View 5 Replies
View Related
Jul 10, 2015
If I Have a table like
Id(identity), PupilPersonId, EducationTypeId,VehicleTypeId,EducationDate, EducatorId,Canceled
661187Â Â Â Â Â Â 9242382Â Â Â Â Â Â Â Â 2Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 2015-07-07 00:00:00.000Â O_2Â False
661183Â Â Â Â Â Â 9242382Â Â Â Â Â Â Â Â 2Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1Â Â Â Â Â Â Â Â Â Â Â 2015-07-08 00:00:00.000Â O_2Â False
661186Â Â Â Â Â Â 9242382Â Â Â Â Â Â Â Â 1Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 2015-07-08 00:00:00.000Â O_2Â False
661178Â Â Â Â Â Â 9242382Â Â Â Â Â Â Â Â 2Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 2015-07-10 00:00:00.000Â O_2Â False
661185Â Â Â Â Â Â 9242382Â Â Â Â Â Â Â Â 2Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 2015-07-10 00:00:00.000Â O_2Â False
The result I want is the unique rows from columns: Â
PupilPersonId, EducationTypeId,VehicleTypeId AND there MAX EducationDate
SELECT er1.* FROM EducationResult er1
INNER JOIN
(
SELECT
er.PupilPersonId, er.EducationTypeId, er.VehicleTypeId, MAX(er.EducationDate) as EducationDate
[Code] ....
I like to know is there another approach with CTE and or Cross Apply I can use instead?
View 5 Replies
View Related
Aug 5, 2015
I have a replace statement like the following:
select  (replace('FMG','FMG','FM'))
So this is straightforward as it will replace the word 'FMG' with 'FM'
However, SSRS is passing a comma separated list like this:
select  (replace('FMG','AFM','FMG','FM'))
And what I need to do is replace the comma separated list of 'FMG','AFM' only. Â I tried this:
select  (replace('''FMG','AFM''','FMG','FM'))
But it still complaining about syntax errors. How do I get the comma separated list to be seen by the replace function?
View 7 Replies
View Related
Nov 8, 2007
A report is picking up some values from the body and displaying them in text boxes within the Page Header, via the ReportItems collection. The text boxes within the body have their format specified as #,###; (#,###) - so displaying negative values within brackets. If the following value is set for the Page Header text box:
="My Value" & " " & ReportItems!variance.Value
the value displayed is, for example:
(My Value (1,123
Hence the requested trailing bracket has been swapped to become a leading bracket. Whatever I've tried I cannot get the bracket in the correct place. Am I missing something obvious or is this a bug?
View 3 Replies
View Related
Sep 9, 2015
I am writing an SQL query to find an replace data in a column. I have a table that is filled with
C:usersXXXXappdata
C:usersYYYYappda
C:usersZZZZZZappdata
I would like to replace the c:usersXXXXX part with %userprofile%
The end result would be %userprofile%appdata
I know how to dot the replacement in powershell. it's quite easy
-replace "c:users[^]+","%userprofile%"Â Â
Basically how would transfer this into SQL...
View 10 Replies
View Related
Apr 20, 2015
I have a string column in a DB where it's values contain the following midway through the string ([DOCUMENTGUID] is a uniqueidentifier that is different for each row):
<a href="../downloadDoc.aspx?dg=[DOCUMENTGUID]" target="_blank">
I would like to replace this part of the string with a different piece of text.
I know that I should be using PATINDEX and REPLACE functions but I don't know how to utilise.
View 4 Replies
View Related
Sep 18, 2015
I want to replace special characters and space except '-' Tried with Pathindex and function but not getting expected results.
Ex: Input kjkdjfdf-234#kei$ ewiw
output:Â kjkdjfdf-234keiewiw
View 6 Replies
View Related
Jun 8, 2015
I'm trying to replace special characters in SQL SERVER and all the solutions for this RDBMS that I found, it uses loops and the source of my data it's in Oracle. in ORACLE and they use REGULAR EXPRESIONS to solve it..Do you know what its the better option to replace special characters? Using loops in SQL SERVER or REGULAR EXPRESSIONS in ORACLE ?
View 5 Replies
View Related
Nov 30, 2006
Hi,
Could you please tell me?
Is SQL Everywhere supporting for Windows CE 4.2, Windows CE 5.0?
What processors are supported by SQL Everywhere?
Now we are using RC1 version SQL everywhere and when Release builds will be available?
What is the purpose of the following SQL everywhere runtime binary dlls.
· Sqlceca30.dll
· Sqlcecompact30.dll
· Sqlceer30en.dll
· Sqlceme30.dll
· Sqlceoledb30.dll
· Sqlceqp30.dll
· Sqlcese30.dll
· System.Data.SqlServerCe.dll
Thanks,
Rajendran.
View 3 Replies
View Related
Jun 18, 2007
I haven't been able to find a DMX query which will spit out the cases which support a particular association rule. I was hoping it would work sort of like drillthrough but show only the cases supporting a particular rule. Am I missing something?
What I ended up doing was extracting the itemsets of the rule from the model's content then running a SQL query to retrieve the cases that contain both the left-hand and right-hand itemset of the rule. I'm hoping there's a better way.
View 1 Replies
View Related
Aug 30, 2006
I have a WinForms C#.net application in which I export data to MDB files. To create the initial database I use this code:
public static bool CreateDatabase(string fullFilename) { bool succeeded = false; try { string newDB = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fullFilename; Type objClassType = Type.GetTypeFromProgID("ADOX.Catalog"); if (objClassType != null) { object obj = Activator.CreateInstance(objClassType); // Create MDB file obj.GetType().InvokeMember("Create", System.Reflection.BindingFlags.InvokeMethod, null, obj, new object[]{"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + newDB + ";" }); succeeded = true; // Clean up System.Runtime.InteropServices.Marshal.ReleaseComObject(obj); obj = null; } } catch (Exception ex) { Tools.ShowMessage("Could not create database file: " + fullFilename + "" + ex.Message, "Database Creation Error"); } return succeeded; }
This works perfectly fine on my system. But I've learned from one client that such MDB files cannot be opened using MS Access '97. Why they're still using this old version is a great question but the customer is always right, right?!
Anyhow, I thought that I could just alter the number "4.0" to "3.5" or "3.0" but it doesn't work on my machine. I got to wondering though if it might work on a client's machine if they had that version of OLEDB data access components installed.
So I'm wondering how I can programmatically test for which version(s) of OLEDB are available to use?
Robert Werner
http://PocketPollster.com
Vancouver, BC, Canada
View 5 Replies
View Related
Aug 9, 2006
hi all:
do ms sql 2005 have chi-square test?
sincerly!
View 5 Replies
View Related
Nov 1, 2004
Hi
Do i have use square brackets surrounding the table names when executing a query in SQL Server ? i.e Is
select * from Department
different from
select * from [Department]
I'm using a case-insensitive SQL Server installation. Any help is appreciated!
Thanks in advance,
Sam
View 1 Replies
View Related
Oct 28, 2007
how to eliminate square character before the data.
When i import it from excel into sql server 2005, it have a double square character on my data. help.
View 2 Replies
View Related
Aug 17, 2015
When I try to open the Powerview report in the new Windows 10 Explorer (MS Edge), I am asked to install Silverlight.
When I try to install this, it says I already have it installed so I can’t proceed in opening the Powerview report.
View 2 Replies
View Related
Apr 11, 2007
hi ,
In my database I have table with column of datatype nvarchar in which I am writing the address of users.Now address field in aspx page is multiline because of which my address contains characters and
. These special characters are getting inserted in database as square boxes. Is their any way to avoid it. Also the constraint is that I don't want to replace or
by space before writing contents to database.
Please write to me any solutions u are having.
thanks in advance.
Thanks and regards,
Nita Jadhav.
View 1 Replies
View Related
Dec 17, 2006
I have an ASP.NET application where I need to filter the records returned from a SQL query using a calculated distance to a point that is set by the user. To do this directly, I would need to include a square root of an expression in the SQL query. It seems like I should be able to do this by writing my SQL query something like:
SELECT SQRT(expression ....) AS distance, column2, column3 ... FROM mytable WHERE distance < 50
Unfortunately, SQL queries apparently don't like the SQRT function. I am using .NET 2.0 with VS2005 and a MS Access backend (that will soon be moved to SQL/Server).
As an alternate, maybe I can query the data into a temporary record set with a extra field for distance and then step my way through the temporary record set and replace the values in the distance field with a calculated distance. Once the temporary record set is prepared, then I would delete the records that don't pass the distance requirement or otherwise hide them and bind the data to a gridview control.
Thanks,
David
View 10 Replies
View Related
Feb 4, 2008
We are setting up a new Reporting Services 2005 enterprise reporting tier that will support multiple developers, applications, and end users. We will have mirrored environments including development, test, and production each with their own database cluster, and reporting server.
We have multiple report developers who share a single Visual Studio solution which is saved in SourceSafe and is setup to have separate report projects for each business unit in the orgainzation. Each report project is mapped to a specific deployment folder matching the business unit. Using the Visual Studio Configuration Manager, we can simply flip to the envirnoment we want to deploy to and the reports are published to the correct environment and folder structure.
My problem lies with the common data sources. We are using a single master Common Data Sources folder to hold all of the data sources. The trick is that each and every reporting folder seems to have to have it's own copy of the data source in visual studio. There does not seem to be an easy way to change the data sources for the reports when you publish to various environment, i.e. development, test, production etc.
Ideally, we would have a single project for the common data sources that all reporting projects and associated folders would map to, and we would have a way to associate the appropriate data source for each environment when we deploy.
I'm looling for best practices on how to setup data sources for development and deployment in an enterprise environment that uses Visual Studio to develop and publish reports. We have 3 environments, and 6 data sources per environment and about 20 reporting folder / project in Visual Studio. That's 360 changes that have to be manged when deploying reports. Is there a best practices way to do this?
There has got to be a better way? Can anyone give me some insite into how to set this up?
Thanks!
View 8 Replies
View Related
Sep 17, 2006
I had to import some FileMaker Data into SQL Server 2005 and in the resume field a "SQUARE" special character is appearing everyplace that a return should be.
It has really messed up the formatting. I know how to use the updatetext in a cursor to replace the special character but I don't know what to replace the "SQUARE" special character with so the text is displaying a new line rather then this "SQUARE" character.
Any help would be appreicated.
View 6 Replies
View Related
Dec 25, 2006
I want to store a small cirle in a text field. Can anyone tell me how I can enter it in ascii code.
Thanks
View 4 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
Oct 16, 2007
Hi all i have a question regarding sql, i want to replace some characters...
any knows simply how to do this?
I want to replace "999-25000-69" by "9992500069"
grtz
View 1 Replies
View Related
Nov 28, 2006
i got a 100k rows column contain first name + last name. but half of them are got comma between first and last name. how can i update and remove all the comma. can anyone provide a statment please thanks so much
View 2 Replies
View Related
Aug 15, 2006
can I use a replace on text type field?
View 1 Replies
View Related
Apr 11, 2006
hi
when i execute ...
select * from Members where address = '6257 Rockwell's'
ERROR :
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 's'.
Server: Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark before the character string '
'.
Kindly help me how to solve '
View 2 Replies
View Related