I have a table that returns results like abc yes abc no cdef no cdef no cdef no xyz yes xyz no xyz no sample query with abc as( select 'abc' as b
I have a trigger which declares a table variable. DECLARE @TREarn_aaa table ( aaaID bigint NOT NULL PRIMARY KEY, Bbb decimal (18, 8) NULL, Ccc dec
My SQL Server table looks like this ID a_Toyota a_Mazda a_Nissan a_Kia a_Honda a_Subaru SoldCar CarOrder 1 8000 7000 6200
I would like to do a PIVOT on my table but I don't have aggregation column. SELECT CONVERT(date, DataHora) AS dia, CONVERT(VARCHAR(5), DataHora, 108) A
I have a table of students and classes. I would like to find what classes were dropped from one semester to another (and a similar query for classes added). Stu
I am struggling with the problem with nesting root for every day (it's an element of my table). I'd like to get nested Key: value pair of day from table Day. He
I want to get the whole day of the week depend on the date, my query is working and getting the result that I want but when the date value is Sunday, result cha
I'm using Synapse Serverless Pool and get the following error trying to use CETAS Msg 15860, Level 16, State 5, Line 3 External table location path is not valid
id | acct_num | name | orderdt 1 1006A Joe Doe 1/1/2021 2 1006A Joe Doe 1/5/2021 EXPECTED OUTPUT id
I have an nvarchar(50) column myCol with values like these 16-digit, alphanumeric values, starting with '0': 0b00d60b8d6cfb19, 0b00d60b8d6cfb05, 0b00d60b8d57a2b
I am trying to insert following JSON document into T-SQL: { "GLDETAIL": { "RECORDNO": "264378-1756289-919567--accrual", "BATCH_DATE": "02/01/2
I work on sql server 2017 I need to delete all rows from table student_course but I don't know which is best for use delete from student_course OR truncate tab
I am trying to get the total sum from columns of a specific data type(money) for multiple tables in a database. Currently I am able to get the list of columns f
I am trying to learn Sqlcmd utility in PowerShell to run SQL queries, specifically for database administration. Using Version 15.0.1300.359 NT But I got confuse
I keep getting an exception that reads: "Invalid Column Name, 'IBM'." The error is happening at: "' + @ticker + '" even though @ticker is declared in VALUES.
I am switching from MySQL to SQL Server for a new job and I have encountered something I don't quite understand as I haven't encountered something like this bef
I'm trying to store DDLs of some views and stored procedures in a separate table in the Dump database. There are too many similar databases on the server. But s
I'm trying to sum values inside a window function but I can't figure out have to prevent summing duplicates. Below is a snippet of the results I have right now.
I have data that looks likes: stu_id course_name staff_name 1 Economics - 3 Kuzma, Brian 1 History Hulings, Kreg 1 IHS IB Lit of Americ Duncan, Amy 2 Marine Bi
I have a table where as codes are present in the form of 78,7244,d345 by default few records are found where the codes are start with 0072 . I have to delete st