Skip to content
Advertisement

Tag: tsql

Didnt print on Procedure on SQL

So I try to print a message when I have any confirmation or error. I have this table [Friendship] that have the ID, friend mail, their mail and the date that have been confirm the friendship, Table without data When I use the EXEC for this PROCEDURE, I have the insert values, but not the print´s acctions… Also, If I

Extrapolate Data

I have the following two tables in my database. One holds transaction data and the other holds development periods. How can I extrapolate the data into the future development periods like below? Answer One method uses cross apply:

Find Gaps in a single date column SQL Server

Good Day everyone, I need your help. I am trying to detect gaps in a single column of the type Date or DateTime in SQL Server. Say we have a list of schools and each school has many records and there is a field of uploadDate. So something like that: My outcome would be something like that: Thank you all.

Remove trailing comma

I have a table with names formatted as “Smith, Stan” and need to display them as “Stan Smith”. I was able to do that but it seems that the comma has been left behind and I need to get rid of it. This is what I currently have: Answer How about using replace as below

t-SQL cartesian production of several tables

I would like to get a cartesian product of several tables in SQL (which are actually only one column, so no common key). For example: I tried CROSS JOIN, but I couldn’t find an example with multiple tables. Is the only way to do it is nesting? What if we have 15 tables to join that way… it creates a

Advertisement