Remove duplicate substrings from string
Hello experts, I have a problem I'd appreciate advice on please.I'm asked to determine distinct combinations of sequences of values from a field which contains delimited values. My issue is that I need...
View ArticleGroup by month and year
Hi all,I have a date column which isn't behaving as expected...
View ArticleIn a self-joined table, how to remove ALL records with duplicates
How to remove the rows 6,7, 12,13, 21 and 22?I intend to remove pair of records with duplicate Col3 and the ID of that record is the same as the OrigID of the other record. My query below deletes only...
View Articlesubtract 1 month from the year and month.
subtract 1 month from the year and month.I have @yearmonth='2018-03' .i have data -'2018-03' and i want to have '2018-02' .it should work for last 4-5 months. I should be able to get to 2017-10...
View ArticleChange character encoding for existing varchar data from codepage 1252 to...
We have a codepage 850 character data which has been encoded as codepage 1252 and stored in the database. The varchar column in database has collation Latin1_General_CI_AI (codepage 1252). The...
View ArticleChange Data format
Hi Experts,We have a datetime field where date time is saved in below format. Apr 19 2018 8:57AM But want to update in below format. Is it possible for existing data. All new data format is changed...
View Articledesigning portal so we don't run into performance issues.
My team is building a self service portal for users who want to purchase the data from us. Registered users will log into our portal and make the purchase depending on the criteria they specify. For...
View ArticleHow to find the last manipulated table in database?
When our front end application do any data manipulation like insert, delete or update , is there any way to find which table is affected. i know this sounds quite amateur, we have an application and...
View ArticleCannot insert duplicate key row in object
Hi,I'm on SQL Server 2014 enterprise edition. I'm running into the following error when attempting to run a MERGE statement: "Cannot insert duplicate key row in object 'TABLENAME' with unique index...
View ArticleImporting Thumbnails in Active directory using SSIS
I would like to update Thumbnails using Active directory and have no idea how to go about it any help is appreciated..
View ArticleColumn data stores in variable
Hi everyone,I want to column level data store in one variable. like below example.
View Articleinserting incremental records in table ?
Hello I want to copy records from another database table to my Employee table i am using below quey to insert records. I have 4k records to insert to destination table but m EMPKEY is giving...
View ArticleHas anyone written a Faceted Search like the ElasticUI interface ... all in SQL?
If you go to dubdubdub elasticui dotcom and look at the bottom-most screenshot, I need to do the equivalent, all in a t-SQL stored proc (addt'l support functions acceptable), and needs to be reasonable...
View Articleissue casting as dollars, etc.
I would like this to output as 1. With Dollar signs2. Thousand separators3. Whole dollars amount with no decimals.Thanks [code language="sql"]cast(L.HTS_Value as money) as [O
View Articlewill this SQL trigger recursive
I am new on writing and testing trigger. I am trying to write a trigger to monitor ta colume wih the table. Wether it is insert or update, if that column has a period there, the trigger will remove...
View ArticleQuery Tuning
Hi,Can you please suggest what can be done to tune the following query ?SELECT A.accounting_program_code ACCT_PGM_CD,
View ArticleSQL Query Help - Separate Column
Hi All:Need help with SQL Query. I have a column named Participants with Names and email addresses in one single column. I want to separate the once with email address in separate column.Participants:G
View ArticleChecking Fulfillment of Prerequisites That Can Contain Elaborate AND/OR...
I am working with a system in which I can query prerequisites for course enrollment in a query like this:[code language="sql"]SELECT [td].[PEOPLE_CODE_ID]&n
View Article