Queries to inventory your SQL Server Agent #Jobs
SQL Server Agent can only provide an answer to this question ... for display SELECT schedule_id ,job_id ,LEFT(CAST(next_run_date AS VARCHAR),4)+ '-' +SUBSTRING(CAST(next_run_date AS VARCHAR),5,2)+'-'...
View ArticleSubstring for data in dataset and sql table
With the guides and helps from fellow members here, i now can have data from dictionary in dataset by using this code: data want; set sashelp.vcolumn (where=(libname="CDSSTG")); run; However, i want to...
View ArticleSUBSTRING (Transact-SQL)
Returns part of a character, binary, text, or image expression in SQL Server. The following example shows how to return only a part of a character string. From the sys.databases table, this query...
View ArticleXQuery for the Non-Expert – Substring() Function
Within the value() and query() methods it is sometimes desirable to return a portion of a string. Similar to T-SQL, there is a substring function in XQuery that provides this functionality. In this...
View Article#Windows Script for Marking All Disks Online
You are setting up a new template or VM to be used with SQL Server and to get the best performance you ... found on the server foreach($offdisk in $offlinedisk) { $offdiskS = $offdisk.Substring(2,7)...
View ArticleSubstring for data in dataset and sql table
With the guides and helps from fellow members here, i now can have data from dictionary in dataset by using this code: data want; set sashelp.vcolumn (where=(libname="CDSSTG")); run; However, i want to...
View ArticleString Comparisons in SQL: The Longest Common Substring.
I’ve always wanted a SQL function that tells me the longest substring shared between two strings. As a present to myself, I’ve written one. I hope someone else finds it useful. There are several...
View ArticleTesting COALESCE with tSQLt
INSERT #Actual ( fullname ) SELECT COALESCE(Salutation + ' ', '') + COALESCE(firstname + ' ', '') + COALESCE(SUBSTRING(middlename ... There aren't any perfect ways of testing SQL code, and all have...
View ArticleSQL SUBSTRING Function
The SQL SUBSTRING function is one of the SQL String Function, which is used to return specified number of characters from the given expression. The SUBSTRING function uses its third argument to decide,...
View ArticleDBMS_PARALLEL_EXECUTE.RUN_TASK is running sequentialy
l_count loop v_sqlInsert := v_sqlInsert || ' CD_FCIM = ''' || v_array(i) || ''' OR'; end loop; v_sqlInsert := SUBSTR(v_sqlInsert ... v_sqlInsert, DBMS_SQL.NATIVE, parallel_level => 4); Everything...
View ArticleSQL Server Substring with CharIndex
In this article we are going to explore the T-SQL function CharIndex and also how to use it with another T-SQL function Substring(). CharIndex: This function returns the location of a substring in a...
View ArticleSQL Challenge 19: Larger Test Data
Not so for the SQL Challenge #19. Either I didn't know the incantation ... emp_cnt, max_span ) AS ( SELECT 1 , SUBSTR(to_char( to_date(1,'J'),'Jsp'),1,1) , INITCAP(SUBSTR(to_char(...
View ArticleOptimizing Substring Search Performance in SQL Server
The requirement of searching data by part of the value is very common in business applications. All of us are familiar with it – users want to be able to search by entering just a few letters from the...
View ArticleWhat's new in Database Engine - SQL Server 2016
Transact-SQL Improvements for memory-optimized tables There are several ... Parameters passed into string functions, such as into LTrim or Substring, in a native proc. Inline (meaning single statement)...
View ArticleTesting COALESCE with tSQLt
INSERT #Actual ( fullname ) SELECT COALESCE(Salutation + ' ', '') + COALESCE(firstname + ' ', '') + COALESCE(SUBSTRING(middlename ... There aren't any perfect ways of testing SQL code, and all have...
View ArticleTracking and Counting SQL Server Agent #Job Runs
Sql_message_id and sql_severity provide information about the ... with a success status select sysjobhistory.job_id ,count(*) number_of_success_runs ,sum ( SUBSTRING(RIGHT(REPLICATE('0', 6) +...
View ArticleDb2 Basics: Levels of Configuration
Using these keywords requires an database connection: $ db2 connect to sample Database Connection Information Database server = DB2/LINUXX8664 11.1.1.1 SQL authorization ID ... view like this: select...
View ArticleDBMS_PARALLEL_EXECUTE.RUN_TASK is running sequentialy
l_count loop v_sqlInsert := v_sqlInsert || ' CD_FCIM = ''' || v_array(i) || ''' OR'; end loop; v_sqlInsert := SUBSTR(v_sqlInsert ... v_sqlInsert, DBMS_SQL.NATIVE, parallel_level => 4); Everything...
View ArticleFinding all Palindromes Contained in Strings with SQL
SQL is a really cool language ... palindromes (word, palindrome, start, length) AS ( -- This part just creates the even/odd semantics SELECT word, substring(word, start, x), start, x FROM starts CROSS...
View ArticleTracking and Counting SQL Server Agent #Job Runs
Sql_message_id and sql_severity provide information about the ... with a success status select sysjobhistory.job_id ,count(*) number_of_success_runs ,sum ( SUBSTRING(RIGHT(REPLICATE('0', 6) +...
View Article