xml column from table
Hi,I have a table who have a number of columns. One of the columns contains an xml.How can I parse the xml into column using the origin table as the source?I saw a lot of samples, but all of them refer...
View Articlereplication on 1 table between 3 active environments
so we have three different server farms in three different locations. there's a database on each that has a table that needs to be replicated from each location to itself. Will replication work in this...
View ArticleString value "looking" the same, but there is a difference (cannot use distinct)
Hi all,I am having an issue with using distinct on one single column in a table and getting multiple result rows for a string "looking" the same. When I hashbyte the values, I can see that there must...
View Articlehow to loop without endless joins
Hi,I have a table that each row related to another row, and apart from that they have nothing in common.[code="sql"]create table #mynumbers (Appl int, Pre_App int);insert into #mynumbers (Appl,...
View Articlepartitioning
Hello, I have two large related tables - parent and childThe user is mostly interested in having the last 30 days. But also wants the last 90 days and the whole history. It is my intention to have...
View ArticleProcedure vs Scalar function
Hi,I have 10 procedures that use dynamic SQL and have the same where clause, they return different columns and join with different tables.I was thinking of creating a procedure to return, as output,...
View Articlestring question
Hi,I have a column with a string longer than life. :(I need to take a specific part of it, I know the is the start and where is the end.The problem is that each string has a different size, so I cannot...
View ArticleExtract specific words from row or leave blank?
Hi, I am trying to do something pretty simple on the face of it using t-sql; extracting two words say 'of data' from a row if it has it in it, or leave blank?Anyone have a suggestion for an easy way of...
View ArticleHierarchy with changing levels
Hi,I have a hierachy that has changing levels which gets imported daily. I have created a stored procedure that creates the table daily based on the levels. I am having an issue with populating that...
View ArticleHow to Split a a single Date into potentially hundreds of new date Values
Hello,I am trying to create a stored proc that will capture already harvested SQL Server Agent Job information. Some of the key data incldues SQL Server Agent Job start time, and duration in minutes. I...
View ArticleMigrate Control-M jobs to SQL Agent
Hello all!I need to migrate all CONTROL-M jobs to SQL Agent and I haven't the faintest clue where to start. I am assuming that I could possibly create a POWERSHELL script that does this but I am not...
View Articledistributed query not working in sqlserver 2012
I use Distributed queries and updating record in the DB2 database using sql server through addlinkedserver , it working fine when scope of the transaction not use in the query, can any one solve how to...
View ArticleCreate SQL agent job using XML file
Hello SQL friends,Does anyone know if it is possible to create multiple SQL agent jobs using an XML file? We are moving away from Control-M and I have an XML file with all the info that I need and...
View ArticleMax Date from multiple columns
I have a payment table where a customer may have made multiple payments on account. I want to pull the customer id, the amount and the MAX date. Problem is when I ask for MAX date, I have to put the...
View ArticleGet previous and next records based on id from result set
Hi,I've a procedure that lists entities with a certain filter given by the application.The result set is an entities' list with the Id and other fields. The app stores just the filter and when an...
View ArticleTrouble Deploying CLR functions
I have some CLR functions that were compiled and under .Net framework 2.0 for SQL Server 2008. I modified and recompiled them under framework 4.0 to run on SQL Server 2014. When I try to publish the...
View ArticleHow to show Quarters Dynamically in SQL
Hi, At present am showing quarters from 2015-Q1 to Q4 , it should be like that, because report must show data for last 4 quarters only. Whenever i got data for "2016-Q1" then automatically report...
View ArticleFix Over Lapping Dates
I have some records that have over lapping dates. I need to end date them in such a way to fixover lapping dates. See example and expected results.[code="sql"]declare @overlap table(ID int...
View ArticleFulltext issue...
I'm using fulltext to search words within entities... I created an extra table with all the words the entities have and the fulltext searches that table (fulltext.modulesWords).I was making a search...
View ArticleUnable to run sqlcmd using batch
Hi All I use the following batch to run list of scripts in folder [code="other"]@echo offset scripts=%~dp0\_scripts.txtset Instance=%1set DataBase=%2set Password=%3set userName=%4if "%instance%" equ ""...
View Article