Synchronization between two databases

I am trying to achieve sync between client database (mdf file) and SQL Server database. The sync has to be done for only some tables and not all. Also in one of the table, it just need to sync only some data based on a criteria (like say sync between client and server only if […]

split the accounid and dbids between braces into two columns

I have a query to split the accounid and dbids between braces separately. example: [14801].[42] acid scid 14801 42 but I’m not able to separate after comma , example : [27784].[41],[27781].[41],[27779].[41] need a query to split this data into rows

C# Cannot convert type 'System.Windows.Forms.ListViewItem' to 'my app.Users' class

I have a C# WinForms program accessing SQL server and querying data from it. I have two main classes: Users which contains the datatypes for the users that can log into the app, and Products which contains again the datatypes for the products that can be queried. Also I have a class that holds the […]

Running 3-Tier T-SQL Query for Report

First question here so please excuse any mistakes… I am trying to write a SQL Query for an SSRS report and I am totally confused when it comes to my joins. Background: I have 3 tables that are relevant Publishers – This is essentially a list of people Publisher Reports – This is a list […]

Limiting results in SSRS SQL query

I am trying to build a report on our ticketing system using SSRS. I am bringing in fields from both an “incident body” table and an “incident details” table. What I am looking for is whether the ticket has slipped past an SLA for response to the customer. I am checking for tickets past SLA […]

Restrict the execution time of a query in SQL Server

Is it possible to restrict the query or stored procedure to execute only for specific time interval. I am not asking to limit timeout in configuration. For example: I want the execute below stored procedures EXEC sp_01 –for 2 minutes EXEC sp_02 –for 5 minutes EXEC sp_03 –for 7 minutes After such time interval the […]

How can I match SqlDependency with sys.dm_qn_subscriptions

I create a SqlDependency with: SqlDependency dependency = new SqlDependency(command); but I cannot find dependency.id (or any other property) in: SELECT * FROM sys.dm_qn_subscriptions Is there a way to match them up so I can check if dependency I created is still alive.

Adding blank rows where data hasn't been recorded to fit pattern

I’m looking at doing some reporting on staff scheduling, and need to build a graph that shows how many calls were coming through within 15 minute intervals, but also need to display when 0 calls are coming through. My main problem is that the original data comes from the phone system which only writes a […]

PostgreSQL conditional join – if column is not NULL

I have a table “temp” author | title | bibkey | Data ———————————– John | JsPaper | John2008 | 65 Kate | KsPaper | | 60 | | Data2015 | 80 From this I want to produce two tables, a ‘sample_table’ and a ‘ref_table’ like so: sample_table: sample_id|ref_id| data ————————– 1 | 1 | 65 […]

How to select only items that have at least so many characters in common

I am trying to figure out how to pull comparative data. For simplicity sake some fake data is below. 12red34 56red78 90blue23 45blue67 89yellow10 What I want is to pull only items with 3 sequential non defined items. In this case, it would pull all of the items except 89yellow10 as no other item on […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.