Parsing HTML in SQL Server
Parse the data with something else. T-SQL does have functions like REPLACE, CHARINDEX, and SUBSTRING though, perfect for searching for tags and returning just the values between them. CLRs could do it...
View Article9 of the Most Common Mistakes in Database #Design
The additive power of SQL is vital for database development and performance. Indexes work best when they can be synchronized with the key value in entirety. When you must use LIKE, CHARINDEX, SUBSTRIN...
View ArticleImportant PHP Interview Questions and Answers
Ans: The mysql_real_escape_string() function is used to escape special characters in a string for use in an SQL statement. Ans ... the Way by Which the Position of the First Occurrence of a Substring ...
View ArticleConvert a string to the proper case using SQL language
Create FUNCTION UpperLowerCase (@name varchar(100)) RETURNS varchar(100) AS BEGIN declare @cnt smallint select @cnt = 2 select @name = ltrim(rtrim(@name)) if @name is null or len(@name) = 0 goto finis...
View ArticleScalar UDF Inlining in SQL Server 2019
SQL Server 2019 introduces a new feature called “Scalar UDF ... GO CREATE FUNCTION dbo.ITVF_TEST (@Input VARCHAR(30)) RETURNS TABLE WITH SCHEMABINDING AS RETURN SELECT (SELECT SUBSTRING(@Input,N,1) FR...
View ArticleThe lab that created #Spark wants to speed up everything, including cures for...
Succinct does more than “put,” “get” and “delete,” AMPLab researcher Rachit Agarwal said — it also allows for counts, substring queries ... In fact, the team is working on a SQL interface that he expe...
View ArticleImportant PHP Interview Questions and Answers
Ans: The mysql_real_escape_string() function is used to escape special characters in a string for use in an SQL statement. Ans ... the Way by Which the Position of the First Occurrence of a Substring ...
View ArticleUsing SQL Server's CHARINDEX and PATINDEX
Here is some T-SQL code to display only the last name for the first 5 records in the Northwind Customer table. select top 5 substring(ContactName, charindex(' ',ContactName)+1 , len(ContactName)) as [...
View ArticleConverting Access Queries to SQL Server
Whew! That was a lot and honestly, there are still more topics that could be considered in depth when it comes to converting Access queries to T-SQL. I hope that the examples above are sufficient to g...
View ArticleSSIS: Read Event viewer with WMI Data reader
SUBSTRING([ TimeWritten],14,2)) Your task should like something like this: The next step is perform the mappings into the SQL Server table we created earlier: At this point, we can validate the data f...
View ArticleDealing With Upper and Lower Case Data
Within SQL Server, two functions are provided to manage the case ... INTO mytable VALUES('DDdD') -- Uppercase first letter of each value in column SELECT UPPER(SUBSTRING(A,1,1)) + LOWER(SUBSTRING(A,2,...
View ArticleChange a Substring with SQL
However, my SQL command gives me an invalid token error at the opening parenthesis of SUBSTR in the SET statement. Is there a rule that you can’t use SUBSTR in a SET statement? If so, do you have a wo...
View ArticleUsing Oracle JDeveloper 12c with Oracle Database 12c on Oracle Cloud...
The default settings for access rules do not allow the database instances on Oracle Cloud to be accessed by an external user. In this section, we shall modify the access rules to allow external access...
View ArticleUse SQL To Change A Substring
Occasionally I need to change part of a string value in a database table. SQL has three mechanisms that let me accomplish such a thing. Do you know what those three mechanisms are and how to use them?...
View ArticleConverting Access Queries to SQL Server
Whew! That was a lot and honestly, there are still more topics that could be considered in depth when it comes to converting Access queries to T-SQL. I hope that the examples above are sufficient to g...
View Article10 SQL tricks that you didn’t think were possible
In this article, Java champion Lukas Eder invites readers to take a look at 10 SQL tricks. The article is a summary of ... 99 ) SELECT array_to_string(array_agg(s ORDER BY r), '') FROM ( SELECT i, r, ...
View ArticleConverting Access Queries to SQL Server
Whew! That was a lot and honestly, there are still more topics that could be considered in depth when it comes to converting Access queries to T-SQL. I hope that the examples above are sufficient to g...
View ArticleHow I Got #Twitter Data Onto SQL Server
I’ve been looking at how it might be possible to bring data from Twitter into SQL Server. You might ask ... max(case when NAME=’created_at’ then convert(datetime, (substring (StringValue,9,2)+’ ‘+subs...
View ArticleComparing SQL Server and MySQL Functions
You’ll be happy to know that the following functions are usable in both MySQL and SQL Server queries without any modifications: ASCII, LEFT, LOWER, LTRIM, REPLACE, REVERSE, RIGHT, RTRIM, SOUNDEX, SPAC...
View ArticleSQL Substring function in SQL Server
The requirement of data refactoring is very common and vital in data mining operations. In the previous article, you’ll learn the tips for getting started with SQL string functions, including the SQL ...
View Article