What’s that SSIS Password
ServerStorage Rely on SQL Server database roles for protection ... SELECT sj.name AS JobName , sjs.step_name , sjs.subsystem , sjs.command , LTRIM(RTRIM(SUBSTRING(sjs.command, CHARINDEX('/DECRYPT',...
View ArticleBuild a Robust Incremental SQL Server Update Statistics Procedure
t.name, [NotAligned_Index]=i.name , fix_sql= 'drop index ' + i.name + ' on ' + schema_name(t.schema_id) +'.' + t.name +';' + 'create index ' + i.name + ' on ' + schema_name(t.schema_id) +'.' + t.name +...
View ArticleGenerating XML files from clob field
SQL> drop table t purge; Table dropped ... lv_file_name,'wb'); 20 WHILE P_offset < l_clobLen 21 LOOP 22 P_SubstrVal := dbms_lob.substr(l_columnValClob,P_amount,P_offset); 23...
View ArticleT-SQL Using a @variable in WHERE IN ( @varname )
Ok, I'm screwing this up again and I'm not understanding why. (continued from http://episteme.arstechnica.com/eve/forums/a/tpc/f/6330927813/m/545009008831 as this is really a new topic) I don't think...
View ArticleAnalyze #Flight delay data by using Hive on #Linux-based HDInsight
Azure SQL Database. You use an Azure SQL database as a destination ... CREATE TABLE delays AS SELECT YEAR AS year, FL_DATE AS flight_date, substring(UNIQUE_CARRIER, 2, length(UNIQUE_CARRIER) -1) AS...
View ArticleBuild a Robust Incremental SQL Server Statistics Update Procedure
t.name, [NotAligned_Index]=i.name , fix_sql= 'drop index ' + i.name + ' on ' + schema_name(t.schema_id) +'.' + t.name +';' + 'create index ' + i.name + ' on ' + schema_name(t.schema_id) +'.' + t.name +...
View ArticleGuru: Use SQL To Find Duplicate Source Code
I used SQL. It may seem strange to use SQL for source code ... with source as (select s.srcseq, s.srcdta from qtemp.tempalias as s where substr(s.srcdta,7,1) <> '*' and substr(s.srcdta,8 )...
View ArticleSet-Based String Splitting table function
I’m aware there is more than SQL in the world but am keen to keep this task in database ... So using SELECT from the tNUM records where NUM <= 5, a substring expression can be used to limit the...
View ArticleHow SQL Compilation Can Prove the Server CPU
Note: SQL Compilation should be less than 10% of Batch Request ... as object_name, query_text = SUBSTRING(b.text, a.statement_start_offset/2, ( CASE WHEN a.statement_end_offset = -1 THEN...
View ArticleHow to Check SQL Server View Utilization
a.last_execution_time FROM sys.dm_exec_query_stats a CROSS APPLY sys.dm_exec_sql_text(a.sql_handle) AS b WHERE SUBSTRING( b.text, a.statement_start_offset/2, ( CASE WHEN a.statement_end_offset = -1...
View ArticleTRIM() in T-SQL
String manipulation in T-SQL has always felt somewhat cumbersome ... These are my examples: SELECT Result = '[' + TRIM(n) + ']' , FirstLetter = ASCII(SUBSTRING(TRIM(n), 1, 1)) FROM ( VALUES (' ') , ('...
View ArticleA Completely Overhauled, Modularized jOOQ 3.11, Ready for Java 11
Now, imagine a jOOQ user who, let's say, wants to run SUBSTRING() and CONCAT() queries only on MySQL ... It's important to be able to log executed SQL. Classically, jOOQ shipped a quite heavyweight...
View ArticleSSIS #Design Pattern - Staging Fixed Width Flat Files
First, open SQL Server Data Tools (SSDT-BI), and rename the package ... To parse the columns (splitting into multiple appropriate columns), we use SUBSTRING expression in a Derived Column...
View ArticleApproaches to Ma#Sking Email Addresses
Use Data Masker for SQL Server (1): Insertion/Substitution Rules In ... Use a Command Rule in Data Masker to substring the email column to be just the email domains. Use a Row-Internal Sync rule...
View ArticleRandom Word Generation for Data Scrub#Bing
Here is the DDL: CREATE Function [dbo].[RANDWORD]() returns VARCHAR(255) as BEGIN return ( select top 1 UPPER(LEFT(TheWord,1)) + LOWER(SUBSTRING(TheWord,2,LEN(TheWord))) as TheWord from [wordsEn] where...
View ArticleRandom Word Generation for Data Scrub#Bing
Here is the DDL: CREATE Function [dbo].[RANDWORD]() returns VARCHAR(255) as BEGIN return ( select top 1 UPPER(LEFT(TheWord,1)) + LOWER(SUBSTRING(TheWord,2,LEN(TheWord))) as TheWord from [wordsEn]...
View ArticleApproaches to Ma#Sking Email Addresses
Use Data Masker for SQL Server (1): Insertion/Substitution Rules In ... Use a Command Rule in Data Masker to substring the email column to be just the email domains. Use a Row-Internal Sync rule...
View ArticleWhich are the queries using a particular index or table?
OBJECT_NAME(stx.objectid, stx.dbid) AS object_name, SUBSTRING (stx.[text],(eqs.statement_start_offset ... AS pl CROSS APPLY sys.dm_exec_sql_text(eqs.sql_handle) AS stx WHERE pl.query_plan not like...
View ArticleN1QL Support for X.509
Discover Tarantool's unique features which include powerful stored procedures, SQL support, smart cache ... The prefix portion of the value is discarded and the substring until the delimiter is...
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 Article