Difference Between source OrderItems And ReturnOrderItems
HIWe have 4 Tables :1- Order (Head of orders)2- OrderItems (Details Of orders)3- ReturnORD (head of some Orders which have some returned items)3- ReturnORDItems (detail of OrderItems which have...
View ArticleFuzzy Matching
I'm reaching out looking for pointers as I'm starting to brainstorm ideas how to handle a task that has been presented to me. We receive a set of data that has a manually entered piece to it so,...
View ArticleRelationship of Operator cost and execution time
Hi,I have 1 query, which as belowselect [USERNAME] ,[JOBNAME] ,[STEPNBR] from [dbo].[JobStep]. All these three columns are used to form cluster index.The operator cost of execution of query 1 is around...
View Article[HELP] SQL Server 2014 Database Tuning Advisor
What causes the DTA Engine to cause this problem, "Tuning process exited unexpectedly" ?I tried to research how to fix this but i only came across to SQL Server 2012 by doing some patches.Is there any...
View Articlestored procedure for tagging same contact information
Hi,I'm stumped at how to create a stored procedure that would group and identify contact information. I have a table with the following columnsNamePhone EmailGroup Example of desired outputName Phone...
View ArticleHelp with Varbinary
We are implementing SQL column level encryption (that has been around since SQL 2005) to encrypt a few columns in our SQL 2014 database.There are two email fields that were originally defined as...
View ArticleShow Top 5 using subquery
I am new to SQL and I wanted to create a view the problem I have is the "Group by". Currently my data is showing:Customer Invoice Date AmountAJAX 5/1/2016 $500What I really want to do is enter a...
View ArticleLast day of month in a WHERE clause
Hi all!Have looked a bit around to find something here, but only found something about how to calculate last day of month.Given this extremly simple table:CREATE TABLE [dbo].[a_dates]( [id] [int] NOT...
View ArticleTRY_CAST AND TRY_CONVERT not recognized
Trying to use these function which everything I read says 2012 forward inn SSMS 2014 and both of them toss me errors that they are not recognized functions?"Msg 195, Level 15, State 10, Line...
View ArticlePossible to do a backup/Restore of Tables Only??
HiI am wondering if its possible to do a backup of tables only (2008) and a restore of the tables in (2014)?Thanks
View ArticleREPLACE or alternative?
Morning!An attribute comes back with five answers.NULLP=PermanentT=TemporaryB=Both8=See Job DescriptionUsing the line below I receive a value of PermanenTemporary as the t at the end of Permanent is...
View ArticleSwitching partition giving error "Schema changed after the target table was...
Hello Everyone,I am working on migrating existing database to partitioned environment. We have a table name dbo.TableName which is partitioned based on State Code (with total 50 partitions). Now there...
View ArticlePartitioned view not funtioning as i intended
I have a 2.5 billion record table that i broke out into a table for all of 2013. One table for all of 2014 then a table per monthfrom 1/1/2015' till 12/31/2016. So there are 36 individual tables w/ a...
View ArticleTwo column pivot
I have an item with 4 units of measure and each one has a different size. I want to get the UOMs as column names with the size listed below so that I have only one line for the result. I have tried a...
View ArticleHaving null count greater than 1
Hello,I want to display count of records whose null count is greater than 1 group by customer.e.g.coulumn1 column2null 1null 1123 1345 1I want to find such records whose null count for coulumn1 is...
View ArticleAn INSERT statement cannot contain a SELECT statement that assigns values to...
I am encountering the following error:An INSERT statement cannot contain a SELECT statement that assigns values to a variable.Below is my sp. Any ideas?[code="sql"] declare @rows_deleted int declare...
View ArticleSSAS Calc & MDX Query -- NEWBIE
I know folks have asked this before, but none of the answers I've seen address my particular problem. I have a cube based on the AdventureWorksDW database, reseller sales. I am trying to get the moving...
View ArticleMerge data from multiple databases into single database
I have a number of regional databases. For now lets say there are 10 database. I have been challenged to merge the data from these databases into a single database. The schema's of the regional...
View Articleexecute multiple jobs in parallel SQL Agent
Hello SSC,I have about 5 jobs that I need to execute simultaneously in a SQL Agent job. It is my understanding that SQL Agent doesn't support parallel processing? Anyway, I am trying to devise a plan...
View ArticleRestore all trn files in a folder
HI,I used to have a script that would do this but can't fine it anywhere.Using A\G groups and need to manually replay several transaction files (all files in a directory).Anyone know of a script that...
View Article