T-SQL (Transact Structured Query Language) is the extension of SQL functionality supported by Sybase ASE and Microsoft SQL Server. Do not use this tag for MySQL, PostgreSql, Oracle(Pl/SQL) related queries.

1
vote
1answer
29 views

I want to display records for one ID if there is more NUMBER for the same ID

For the first ID which is 1265 I want only one record like this(look below), and for now I have three different records for the same ID and that isn't good. You can see that in the first record with ...
0
votes
1answer
37 views

How to show all names for identical contract in T-SQL

I have query like this, and i shows me sort of good resultsselect vup.UgovorId, count(P.Naziv) as BROJNAZIVA from [TEST_Ugovori_Prod].dbo.VezaUgovorPartner as vup inner join [...
0
votes
0answers
31 views

Combine 2 tables extract all values from Table2 type2 and exclude duplicate column value from Table1 & use values from table2 in Table 3 type2

I have 2 tables. I wish to join these tables and record historical data (type2) and update the StartDate and EndDate accordingly.id 'E7C7' has three entries in Table1(type2) and one in Table2(type1). ...
0
votes
0answers
30 views

Export a table partially as INSERT

How can I export a large table with > 500 million records partially, for example all records with Column A='Customer A', or the first 100 million records, and then second 100 million records, to a ...
0
votes
0answers
12 views

Compress/Decompress functions and nHibernate

I have to store large amounts of text in a SQL Server 2016 database. In SQL Server 2016 there are Compress and Decompress functions (gzip) which could help me.I was wondering if there is any way ...
1
vote
2answers
33 views

SQL Select query for report

I have 2 tables:Table A:Name intID name a | 0name b | 1name c | 2name d | 3Table B:Occurrences intIDday1 | 0day2 | 0day3 | 1day4 ...
1
vote
2answers
47 views

Multi table check constraint

Is it possible to add a check constraint based on criteria in two other tables? I have three tables: collections, sessions, and session_detail. My goal is to prevent more than one occurrence of a ...
-2
votes
0answers
45 views

Why SELECT '≡' outputs '=' in SSMS? [on hold]

Please, observe:I runSELECT '≡'But see=What am I doing wrong?
0
votes
0answers
34 views

Should I use foreign key or CHECK CONSTRAINT to track which user is CRUD-ing the database?

Database tables:employees(employeeID int PK,...isVipUser boolean DEFAULT 0,loadUser int FK REFERENCES employees (employeeID)),teams(teamID int PK,...loadUser int FK REFERENCES employees (...
-1
votes
0answers
28 views

TSQL Fussy address match logic,

I work on matching addresses which could be quite tricky with all this manual input. so I plan to use this logic with SoundEx, do you think its OK ? I see that different numbers are treated by ...
1
vote
2answers
16 views

T-SQL apply where clause to function fields not working

I'm having a hard time filtering this view by CreateDate. The CreateDate in the table is in the following format: 2013-10-14 15:53:33.900I managed to DATEPART the year month and day into separate ...
0
votes
1answer
27 views

T-SQL Programming Return table based on Variable

I've been trying to make this work for a while now but I can't figure what's wrong.The function needs to return a table based on the input date. If the input year is not available in the database, ...
0
votes
1answer
30 views

How to update dynamically created t-SQL in C#? [on hold]

I have a SQL where Where and AND clause are created dynamically. What I want is, update this SQL based in some condition.Actual Query:var sql=$@"SELECT DISTINCTc.Name AS ...
1
vote
2answers
46 views

Add new rows after a serial number in the first column from another table

I need to add more rows to table_1 (first column sequence ) from another table_2 under the last first column [NO] from Table_1 for example Table_1NO F1 f2 code f3 Name -- -- -- -- ...
1
vote
1answer
42 views

T-SQL Substring Replace (Translate in 2017)

At my job the version of SQL Server we have is 2012, I believe, and in the 2017 version there is now a TRANSLATE command. Because we only have 2012 SQL Server, I need some combination of UPDATE and ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,