Showing posts with label SQL SERVER. Show all posts
Showing posts with label SQL SERVER. Show all posts

TSQL: Concatenate Multiple Rows into String

use Northwind

declare @CategoryList varchar(1000)
select @CategoryList = coalesce(@CategoryList + ‘, ‘, ”) + CategoryName from Categories

select ‘Results = ‘ + @CategoryList

Read Users' Comments (0)

Computed Column Specification

Ex :

(((isnull([AuthorizedQtyU1],isnull([InvoiceQtyU1],(0)))-isnull([ReceivedQtyU1],(0)))-isnull([DamagedQtyU1],(0)))-isnull([MissingQtyU1],(0)))

Is Persisted = no

(datediff(minute,[StartTime],[EndTime]))

Is Persisted = no

Read Users' Comments (0)

filter sql

WHERE convert (datetime, convert (varchar, datecol, 101), 101) = @yourdate

Read Users' Comments (0)