Skip to content

Tag: tsql

Printing integer variable and string on same line in SQL

Ok so I have searched for an answer to this on Technet, to no avail. I just want to print an integer variable concatenated with two String variables. This is my code, that doesn’t run: It seems like such a basic feature, I couldn’t imagine that it is not possible in T-SQL. But if it isn’t po…

Execute a Stored Procedure Inside a View?

I started working for a company a few weeks ago, and have inherited a crazy mess of databases. I’m currently working on designing the new systems to replace their older ones. The previous developer created a ton of views that are entirely identical, with the only differences being the conditions within …

How to compare records in a SQL Table

I have a table name TransactionTable. If InsuranceCode = ‘ADAP’ and IsADAP = 1, I have to filter these records and return the remaining records. I am trying to write something similar to this syntax. Total records in TransactionTable is 1832 and Total records on filtration criteria is 109. I expec…

SQL SERVER Insert Addition?

So this seems like something that should be easy. But say I had an insert: and I wanted X to go from 1-100. (Knowing there are some of those numbers that already exist, so if the insert fails I want it to keep going) how would I do such a thing? Answer Here’s a slightly faster way