Skip to content

Tag: sql-server

SQL separate for stored procedure

About SQL Server Management Studio stored procedure. The following variables ‘|’ I want to separate it from. How can I do it? ‘628391|28100|8304|3|1201129|12|Kg|M01|SERIOUSLY CHUNKY WOOL’ ‘627452|…

SQL Count Number Of Classmates For a Student Across All Courses

I have the following tables: Student: Student_ID (PK), Student_Name Course: Course_ID (PK), Course_Name Enrollment: Student_ID (FK), Course_ID (FK) I need 2 queries: A query that computes for each student id in the Student table the total number of different (Unique) classmates that this student has across al…

Reverse order of every other character in a string

I’m currently working on a project where the data I’m receiving is being given to me in a messed up order. I need every 2 characters to switch places in a string. Currently I have the below code, but it is ungodly slow in a function or stored procedure. Any help would be appreciated. Ex: FK741 OCE…