SQL Server publication keeping suscription data
I have a publication scenario on SQL Server and I want to keep the data of the subscriber connected to a publisher. If I delete data from the publisher (by removing the triggers that exe
View ArticleConvert integer to time format
Hi,I have two fields in a table that has time recorded in number format (eg; 9:31 PM is stored as 213100 in the database).Can anyone please let me know how to extract this field in time format...
View Articleis it possible to use inner join inside case.
Hi expert can anyone point me on the right direction, is it possible to use the joins inside select case.Example:[code language="sql"]select A.field1,  
View ArticleIdea working with Liquibase or Flyway to versioning database
Hi,I am wondering how to organize work with Flyway or Liquibase tools in connection with Git.In Liquibase we have one sql script and we can see changes what have be done there. In Flyway when developer...
View ArticleGenerating XML - Has anyone heard of such tasks using a lot of memory?
Hi all...Just wondering if anyone has any experience with or evidence of any form of generating XML being "consumptive" of RAM in larger quantities... I may end up working on a project that will...
View ArticleHow to rotate table values
Hi guys.I need help with query results output.I have a driver report results which looks looks thisDrv DOW Shift1 null &n
View Articleupdates are not happening through ssms
hi,I have created after insert ,update,delete trigger for one of the table.The table does not have any primary key.When we are trying to update the table in edit top 200 rows ..it is preventing to...
View ArticleDrop Columns in multiple tables that have Column Name similar to values in...
I need help with a requirement. I am able to manually complete the requirement but hoping this could be automated. Please see below.1. DB has many tables.2. One of the tables 'TblMaster' has 2 columns....
View Articlequery just runs; possible join issue?
This report used to run until i added the CTE to pull MAX Created date from the Broker Feed table.Now it just runs . . . Can anyone see an issue? thanks [code language="sql"
View ArticleLoop over all in table Current Month and Prior Month for Change Report
Hope I explain this correctly. I have the following query that is looking at a specific record but I have around 65K records to loop over[code language="sql"]select * from Contract_priormonth C
View ArticleError when having 2 CTEs
This code results inMsg 102, Level 15, State 1, Line 29Incorrect syntax near ','. That is the between the CTEs. I copied syntax from another report that i wrote that works. Thoughts?
View ArticleI am given a task to troubleshoot performance issue
I am given my first task to troubleshoot a performance related issue. I have a very small DB with some tables and there is a query which takes 7+ seconds to run. I am not even sure if it is normal....
View ArticleCTE Issue, part 2
This was working, but with a few Duplicate rows from the ZATS table (which i can live with if i have to)Now i am getting the crazy execution plan with MILLIONS of rows.Can anyone figure this out? CTE_1...
View ArticleComplex Where clause
I have a result set that is a Difference Report for changes on a contract. I have some columns that are decimal(18,6) and some that are txt that I have had to make a Diff column based on a case...
View ArticleDatatype Change
Changed one of the existing column datatype from varchar(250) to nvarchar(250) but the column still showing arabic characters as ??How can i resolve this?
View ArticleSchema + Table name as a header
I am wondering if someone can help me out. I have tons of tables in my DBs and I am trying to find out the count where the column state is either NULL or has values like ESX which is in UK and not in...
View ArticleSame query different actual execution plan
I guess I could summarise my question by asking if a query plan is created based on available resources.Here is the long winded version.We have a database which we regularly restore to our development...
View ArticleOLE DB provider "SQLNCLI11" for linked server "linkedservername" returned...
I have a database in SQL 2014 AG group.- two nodes. On both nodes, a linked server is set up. I am selecting data from a table from a database from AG group and insert into a linked server (a database...
View ArticleWhy does my stored procedure return -1?
Hello,I have a stored procedure. The call to it returns -1. What does this mean?Here is the code that calls the stored procedure (auto-generated by Entity Framework):[code language="C#"] public...
View ArticleDelete Query Slow
I have 2 table i have created index on on both tableCREATE NONCLUSTERED INDEX [IX_NC_source_t_Test_PCode] ON [Common].[source_t_Test]( [Code] ASC, [P_Code] ASC, &
View Article