Questions tagged [sql-server]

Microsoft SQL Server is a relational database management system (RDBMS). Use this tag for all SQL Server editions including Compact, Express, Azure, Fast-track, APS (formerly PDW) and Azure SQL DW. Do not use this tag for other types of DBMS (MySQL, PostgreSQL, Oracle, etc.). Do not use this tag for issues on software and mobile development, unless it is directly related to the database.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Aggregate over two columns where the categories can exist in either?

This is a mock up, but the structure is exact: Animal1 Animal2 count Cow pig 1 pig cow 2 Now I would like to sum all cow/pig combinations, but I cannot figure out how to create that value. My data ...
-2
votes
0answers
16 views

How to join variable to specific row SQL Server

I am trying to join variables by row in SQL server. However, I'm not sure how to selectively map them. I have the following: declare @p1 nvarchar(max) = '[{i:1, n:"one"}]' declare @p2 ...
0
votes
0answers
10 views

A Simple (but long) SQLAlchemy filter() runs extremely slow (SQL Server)

Summary: I am running a simple (but long) query where I am getting all rows that match an entry within a list a source_id/owner_id pairs. There's no joins, nothing complex. The SQL statement generated ...
-2
votes
0answers
15 views

List of Events Admit and Discharge Date for a specific entry log table

I have a table for homecare system and I have a series of entry logs for customer. I want to get a specific output. I want to break it down by record type 'expired', 'Discharge' and 'Discharge-...
0
votes
0answers
18 views

Is it possible to export a HEX color code from a SQL table to a CSS parameter using .net? [closed]

So, i have this result wich is saved from an input, now i need to export this data and make the css color (of another system) change accord to this value using .NET. Is it possible? Table result
-3
votes
1answer
36 views

SQL - % Breakout by Hour

I'm trying to write a query that will break out what percentage of time is utilized within a hour given a time range. Sample data: declare @date table(id int, Start_time time, End_time time) ...
-2
votes
1answer
18 views

T-SQL - subqueries on rows grouped by ID to create a summary table

I have a table "MyTable" with an id and two int fields "A" and "B": MyTable +-------+-----+-----+ | ID | A | B | +-------+-----+-----+ | 99 | 0 | 1 | | ...
-1
votes
0answers
28 views

How to allow another person at another location to use Excel workbook that is connected to a SQL Server database?

I created an Excel workbook that is pulling data from a SQL Server database. Works fine until I give it to someone else to use. It asks for access credentials. I created a new user login that I ...
0
votes
0answers
11 views

Update SQL Server database schema using MVC .net with versioning

We are using a SQL Server database and web apps hosted on Azure. We maintain a database version in a table with version column. We have added code to Application_Start() to check the version of ...
0
votes
2answers
16 views

How to get 1 instance of each StreetName for a given CityTown

I have a many thousand record iAddress table. An example image is shown below. In case the image can't be seen, I've also included a textual column representation for the table on the next line. ID | ...
0
votes
1answer
20 views

T-SQL : execution of stored procedure

I have a procedure which is supposed to save data into a temporary table and at the end of it delete the old records and insert the new ones into the real table. The end of the procedure is as follows:...
-3
votes
1answer
27 views

T-SQL remove cross pairs from table

I have problem with removing cross pairs from table. Example table: X1 X2 ------------- 1 2 2 1 1 2 3 2 2 3 1 3 Expected result X1 X2 --...
0
votes
2answers
20 views

SQL Pivot and group by query

Can somebody help me with the following issue? Here's the situation , i have the following table : signalName value date Alarm 10 2020-01-01 Warning 7 2020-01-01 Check 4 2020-01-01 Alarm 1 2020-...
0
votes
1answer
16 views

Importing only specific XML parameters to SQL Server

I have been reading and reading on how to import xml into my SQL Server and I am so close. The last issue I have is the xml file has hundreds of items in it. Some have a few additional parameters ...
0
votes
1answer
14 views

Selecting the top 1 of one column, for each value of another column

We have report cycles for our secondary school students. I am trying to write a query that will create a neat little table showing the most recent report cycle for each of our secondary school years. ...

15 30 50 per page
1
2 3 4 5
20104
久草视频新免费_日韩视频一中文字暮_欧美三级片