De flesta människor är bekanta med frasen, citthis kommer att döda två fåglar med en stonequot. Om du inte gör det, hänvisar fasen till ett tillvägagångssätt som adresserar två mål i en åtgärd. (Tyvärr är uttrycket i sig ganska obehagligt, eftersom de flesta av oss inte vill kasta stenar på oskyldiga djur) Idag kommer jag att täcka några grunder på två fantastiska funktioner i SQL Server: kolumnstoreindexet (tillgängligt endast i SQL Server Enterprise) och SQL Query Store. Microsoft genomförde faktiskt kolumnstoreindexet i SQL 2012 Enterprise, även om de har förbättrat det i de två senaste utgåvorna av SQL Server. Microsoft introducerade Query Store i SQL Server 2016. Så, vad är dessa funktioner och varför är de viktiga Tja, jag har en demo som introducerar båda funktionerna och visar hur de kan hjälpa oss. Innan jag går vidare täcker jag även detta (och andra SQL 2016-funktioner) i min CODE Magazine-artikel om nya funktioner SQL 2016. Som en grundläggande introduktion kan Columnstore index hjälpa till att påskynda frågor som skannar över stora mängder data och Query Store spårar avrättningar, körningsplaner och runtime statistik som du normalt behöver samla in manuellt. Lita på mig när jag säger att det här är fantastiska funktioner. För den här demo använder jag demo databasen Microsoft Contoso Retail Data Warehouse. Löst taget är Contoso DW som kvoten riktigt stor AdventureWorksquot, med bord som innehåller miljontals rader. (Den största AdventureWorks tabellen innehåller högst 100 000 rader). Du kan ladda ner Contoso DW-databasen här: microsoften-usdownloaddetails. aspxid18279. Contoso DW fungerar väldigt bra när du vill testa prestanda vid frågor mot större tabeller. Contoso DW innehåller ett standarddatabutikfaktablad som heter FactOnLineSales, med 12,6 miljoner rader. Det är verkligen inte det största datalagdbordet i världen, men det är inte heller barn som spelar. Antag att jag vill sammanfatta produktomsättningen för 2009 och rangordna produkterna. Jag kan fråga faktabordet och gå med i tabellen Produkt Dimension och använda en RANK-funktion, så här: Här är en delresultat av de 10 bästa raderna, av Total Sales. På min bärbara dator (i7, 16 GB RAM) tar frågan var som helst 3-4 sekunder att köra. Det kanske inte verkar som världens ände, men vissa användare kan förvänta sig omedelbara resultat (hur du kan se närmaste resultat när du använder Excel mot en OLAP-kub). Det enda index jag för närvarande har på denna tabell är ett klusterindex på en försäljningsnyckel. Om jag tittar på exekveringsplanen, gör SQL Server ett förslag om att lägga till ett täckningsindex till tabellen: Nu, för att SQL Server föreslår ett index betyder det inte att du blindt ska skapa index på varje citatindexquot-meddelande. I det här fallet upptäcker SQL Server att vi filtrerar baserat på år och använder produktnyckel och försäljningsbelopp. Så, SQL Server föreslår ett täckningsindex, med DateKey som indexnyckelfält. Anledningen till att vi kallar detta ett quotcoveringquot-index beror på att SQL Server kommer att citera längs den icke-nyckelfältquot som vi använde i frågan, citationstecken för ridequot. På så sätt behöver SQL Server inte använda tabellen eller det grupperade indexet på alla databasmotorer kan helt enkelt använda täckningsindex för frågan. Omfattande index är populära i vissa datalagrings - och rapporteringsdatascenarier, men de kommer till en kostnad av databasmotorn som behåller dem. Obs! Omfattande index har funnits länge, så jag har ännu inte täckt kolumnstoreindex och Query Store. Så lägger jag till täckningsindex: Om jag återförsöker samma fråga som jag sprang för en stund sedan (den som aggregerade försäljningsbeloppet för varje produkt), tycks frågan ibland springa ungefär en sekund snabbare och jag får en en annan exekveringsplan, en som använder ett Index-sök i stället för en indexskanning (med datumnyckeln på täckningsindexet för att hämta försäljningen för 2009). Så, före Columnstore Index, kan detta vara ett sätt att optimera denna fråga i mycket äldre versioner av SQL Server. Det går lite snabbare än den första, och jag får en exekveringsplan med ett Index Search istället för en Index Scan. Det finns emellertid några problem: De två exekveringsoperatörerna quotIndex Seekquot och quotHash Match (Aggregate) citationstecken både använder väsentligen kvot för rowquot. Föreställ dig detta i ett bord med hundratals miljoner rader. Relaterat, tänk på innehållet i en faktabord: i det här fallet kan ett enda datum nyckelvärde eller ett enda produktnyckelvärde upprepas över hundratusentals rader (kom ihåg att faktatabellen också har nycklar för geografi, marknadsföring, försäljare , etc.) Så, när quotIndex Seekquot och quotHash Matchquot fungerar rad för rad, så gör de övervärden som kan upprepas över många andra rader. Det här är normalt där jag segrade till SQL Server Columnstore indexet, vilket erbjuder ett scenario för att förbättra prestanda för denna fråga på fantastiska sätt. Men innan jag gör det, låt oss gå tillbaka i tiden. Låt oss gå tillbaka till år 2010 när Microsoft introducerade ett tillägg för Excel som kallades PowerPivot. Många kommer säkert ihåg att se demon av PowerPivot för Excel, där en användare kan läsa miljontals rader från en extern datakälla till Excel. PowerPivot skulle komprimera data och tillhandahålla en motor för att skapa pivottabeller och pivotdiagram som utfördes med fantastiska hastigheter mot komprimerade data. PowerPivot använde en in-memory-teknik som Microsoft kallade quotVertiPaqquot. Denna in-minneteknik i PowerPivot skulle i grunden ta dubbla nyckelvärden för företagsnycklar och komprimera dem till en enda vektor. In-memory-tekniken skulle också scanna dessa värden parallellt, i block av flera hundra åt gången. Slutsatsen är att Microsoft bakat en stor mängd prestandaförbättringar i VertiPaq-minnesfunktionen för att vi ska kunna använda, rätt ut ur den proverbiala rutan. Varför tar jag den här lilla spåret ner i minnesfältet Eftersom i SQL Server 2012 implementerade Microsoft en av de viktigaste funktionerna i sin databasmotorhistoria: kolumnstoreindexet. Indexet är egentligen bara ett index i namnet: det är ett sätt att ta ett SQL Server-bord och skapa ett komprimerat kolonnutrymme i minnet som komprimerar dubbla utländska nyckelvärden ner till enstaka vektorvärden. Microsoft skapade också en ny buffertpool för att läsa dessa komprimerade vektorvärden parallellt vilket skapar potentialen för stora prestationsvinster. Så, jag kommer att skapa ett kolumnindex på bordet, och jag kommer se hur mycket bättre (och mer effektivt) frågan går, jämfört med frågan som löper mot täckningsindexet. Så, jag skapar en kopia av FactOnlineSales (I39ll kallar det FactOnlineSalesDetailNCCS) och jag skapar ett kolumnindex på duplikatbordet så att jag vanligtvis bromsar originalbordet och täckningsindexet på något sätt. Därefter skapar jag ett kolumnindex för det nya tabellen: Observera flera saker: Jag har angivit flera utländska nyckelkolumner samt försäljningsbeloppet. Kom ihåg att ett kolumnregister inte är ett traditionellt raderingsindex. Det finns ingen quotkeyquot. Vi indikerar helt enkelt vilka kolumner SQL Server ska komprimera och placera i en kolumn i minnet. För att använda analogi av PowerPivot for Excel när vi skapar ett kolumnindex, berättar vi för SQL Server att det i huvudsak gör samma sak som PowerPivot gjorde när vi importerade 20 miljoner rader till Excel med PowerPivot. Så, I39ll kör språket igen, den här gången använder du igen det duplicerade FactOnlineSalesDetailNCCS-tabellen som innehåller kolumnstoreindexet. Denna fråga körs omedelbart på mindre än en sekund. Och jag kan också säga att även om bordet hade hundratals miljoner rader, skulle det ändå köras på ett ordspråkigt citat av en ögonfrans. Vi kunde titta på exekveringsplanen (och inom några minuter kommer vi), men nu är det dags att täcka funktionen Query Store. Föreställ dig ett ögonblick att vi körde båda frågorna över en natt: frågan som använde det vanliga FactOnlineSales-tabellen (med täckningsindex) och sedan den fråga som använde dubbletabellen med kolumnstoreindexet. När vi loggar in på följande morgon, vill vi se exekveringsplanen för båda frågorna när de ägde rum, liksom exekveringsstatistiken. Med andra ord tycker vi att vi ser samma statistik som vi kan se om vi körde båda frågorna interaktivt i SQL Management Studio, vände i TIME och IO Statistics, och såg exekveringsplanen direkt efter att exekveringen gjorts. Tja, det är vad Query Store tillåter oss att göra, vi kan aktivera (aktivera) Query Store för en databas, vilket kommer att utlösa SQL Server för att lagra förfrågan och planera statistik så att vi kan se dem senare. Så, jag kommer att aktivera Query Store i Contoso-databasen med följande kommando (och I39ll släcker också eventuellt cachning): Sedan kör jag de två frågorna (och quotequotot som jag sprang dem för några timmar sedan): Låt oss nu låtsas som om de sprang timmar sedan. Enligt vad jag sa kommer Query Store att fånga exekveringsstatistiken. Så hur ser jag dem Lyckligtvis är det ganska enkelt. Om jag utökar Contoso DW-databasen, ser jag en mapp för Query Store. Query Store har enorm funktionalitet och I39ll försöker täcka mycket av det i efterföljande blogginlägg. Men för just nu vill jag se exekveringsstatistik för de två frågorna, och undersöka exekveringsoperatörerna för kolumnindexet. Så, högerklickar du på Top Resource Consuming Queries och kör det alternativet. Det ger mig ett diagram som nedan, där jag kan se exekveringsvaraktighetstid (i millisekunder) för alla frågor som har utförts. I det här fallet var Fråga 1 frågan mot originalbordet med täckningsindexet och Fråge 2 var mot bordet med kolumnhandelindex. Numren ligger inte i kolumnskivans index bättre än det ursprungliga bordsskyddsindexet med en faktor på nästan 7 till 1. Jag kan ändra mätvärdet för att se minnesförbrukningen istället. Observera i det här fallet att fråga 2 (kolumnhandelindexfrågan) använde mycket mer minne. Detta visar tydligt varför kolonnekatalyset representerar quotin-memoryquot-teknik. SQL Server laddar hela kolumnregistret i minnet och använder en helt annan buffertpool med förbättrade operatörer för att bearbeta indexet. OK, så vi har några grafer för att visa exekveringsstatistik kan vi se exekveringsplanen (och exekveringsoperatörer) som är associerade med varje utförande. Ja, det kan vi. Om du klickar på den vertikala fältet för den fråga som använde kolumnklassindexet ser du utförandet planera nedan. Det första som vi ser är att SQL Server utförde en kolumnskriftsindexsökning, och det representerade nästan 100 av kostnaden för frågan. Du kanske säger, en minut, den första frågan använde ett täckningsindex och utförde ett index sök så hur kan en kolumnskriftsindexsökning bli snabbare? Det är en legitim fråga, och lyckligtvis finns det ett svar. Även när den första frågan utförde en indexsökning, utfördes den fortfarande quad för radquot. Om jag lägger muspekaren över skivoperatörskatalogoperatören ser jag ett verktygstips (som nedan) med en viktig inställning: Exekveringsläget är BATCH (i motsats till ROW. Vilket är vad vi hade med den första frågan med hjälp av täcker index). Det BATCH-läget berättar för oss att SQL Server hanterar komprimerade vektorer (för eventuella utländska nyckelvärden som dupliceras, till exempel produktnyckel och datumnyckel) i satser på nästan 1000 parallellt. Så SQL Server kan fortfarande bearbeta kolumnkatalogen mycket effektivare. Om jag också placerar musen över Hash Match (Aggregate) - uppgiften ser jag också att SQL Server samlar in kolumnhandelindex med Batch-läge (även om operatören själv representerar en så liten procent av kostnaden för frågan) Slutligen kan fråga, quotOK, så SQL Server komprimerar värdena i data, behandlar värdena som vektorer och läser dem i block med nästan tusen värden parallellt men min fråga bara önskade data för 2009. Så är SQL Server-skanning över hela uppsättningen dataquot igen, en bra fråga. Svaret är, inte riktigt. Lyckligtvis för oss utför den nya kolumnhandelens indexbuffertpool en annan funktion som kallas kvotsegment eliminationquot. I grund och botten kommer SQL Server att undersöka vektorns värden för kolumnen datum kolumn i kolumnkatalogen och eliminera segment som ligger utanför årets år 2009. Jag slutar här. I efterföljande blogginlägg täcker I39ll både kolumnbutikindex och Query Store mer detaljerat. Det som vi sett här idag är att Columnstore-indexet kan påskynda frågor som skannar över stora mängder data, och Query Store kommer att fånga förfrågningar och låta oss granska exekverings - och resultatstatistik senare. Till slut vill vi producera en resultatuppsättning som visar följande. Notera tre saker: Kolumnerna pivotar väsentligen alla möjliga returförklaringar, efter att ha visat försäljningsbeloppet. Resultatet innehåller subtotaler vid veckans slutdatum (söndag) för alla klienter (där kunden är NULL) Resultatet innehåller en total summa rad (där kunden och datumet är båda NULL) Först innan jag kommer in i SQL-änden kunde vi använda den dynamiska pivotmatrixfunktionen i SSRS. Vi skulle helt enkelt behöva kombinera de två resultatuppsättningarna med en kolumn och sedan kunde vi mata resultaten till SSRS-matriskontrollen, som kommer att sprida returskälen över kolumnns axel i rapporten. Men inte alla använder SSRS (även om de flesta borde). Men även då måste utvecklare ibland konsumera resultatuppsättningar i något annat än ett rapporteringsverktyg. Så för det här exemplet, låt oss antar att vi vill generera resultatuppsättningen för en webbgrid sida och eventuellt vill utvecklaren citera outquot de subtotala raderna (där jag har ett ResultatSetNum-värde på 2 och 3) och placera dem i ett sammanfattande rutnät. Så bunden måste vi generera produktionen ovan direkt från en lagrad procedur. Och som en extra twist nästa vecka kan det vara Retur Reason X och Y och Z. Så vi vet inte hur många återvändande skäl det kan vara. Vi vill enkelt att frågan ska svänga på de möjliga distinkta värdena för Return Reason. Här är där T-SQL PIVOT har en begränsning som vi behöver för att ge de möjliga värdena. Eftersom vi vet att det fram till körtid måste vi generera frågesträngen dynamiskt med hjälp av det dynamiska SQL-mönstret. Det dynamiska SQL-mönstret innebär att man skapar syntaxen, bit för bit, lagrar den i en sträng och sedan utför strängen i slutet. Dynamisk SQL kan vara knepigt, eftersom vi måste bädda in syntax inuti en sträng. Men i det här fallet är det vårt enda sanna alternativ om vi vill hantera ett varierat antal återvändande skäl. Jag har alltid funnit att det bästa sättet att skapa en dynamisk SQL-lösning är att bestämma vad den quotiedalquot-genererade frågan skulle vara i slutet (i det här fallet, med tanke på de återvändande skälen vi vet om).och sedan omvända det med piecing det tillsammans en del i taget. Och så, här är SQL som vi behöver om vi visste att dessa återgångsskäl (A till D) var statiska och skulle inte förändras. Frågan gör följande: Kombinerar data från SalesData med data från ReturnData, där vi quothard-wirequot ordet Försäljning som en handlingstyp bildar försäljnings tabellen och använder sedan Returförklaringen från Returdata till samma ActionType-kolumn. Det kommer att ge oss en ren ActionType-kolonn på vilken vi kan pivotera. Vi kombinerar de två SELECT-satserna i ett gemensamt tabelluttryck (CTE), vilket i grund och botten är en härledd tabellundersökning som vi sedan använder i nästa uttalande (till PIVOT) Ett PIVOT-uttalande mot CTE, som summerar dollar för åtgärdstypen vara i ett av de möjliga Action Type-värdena. Observera att detta inte är det slutliga resultatuppsättningen. Vi placerar detta i en CTE som läser från den första CTE. Anledningen till detta är att vi vill göra flera grupperingar i slutet. Det slutliga SELECT-uttalandet, som läses från PIVOTCTE, kombinerar det med en efterföljande fråga mot samma PIVOTCTE, men där vi också implementerar två grupperingar i funktionen GROUPING SETS i SQL 2008: GROUPING vid veckans slutdatum (dbo. WeekEndingDate) GROUPERING för alla rader () Så om vi visste med säkerhet att vi aldrig skulle ha mer returkodskoder, så skulle det vara lösningen. Vi måste dock redogöra för andra orsakskoder. Så vi måste generera hela denna fråga ovan som en stor sträng där vi bygger de möjliga returskälen som en kommaseparerad lista. I39m kommer att visa hela T-SQL-koden för att generera (och exekvera) önskad fråga. Och sedan förstör jag det i delar och förklarar varje steg. Så först, här är hela koden för att dynamiskt generera vad jag har ovanför. Det finns i princip fem steg vi behöver täcka. Steg 1 . Vi vet att någonstans i mixen måste vi skapa en sträng för detta i frågan: SalesAmount, Reason A, Reason B, Reason C, Reason D0160016001600160 Vad vi kan göra är att bygga ett temporärt gemensamt bordsuttryck som kombinerar de hårda kablarna Amountquot kolumn med den unika listan över möjliga orsakskoder. När vi har det i en CTE kan vi använda det trevliga lilla tricket av FOR XML PATH (3939) för att kollapsa dessa rader i en enda sträng, sätt ett kommatecken framför varje rad som frågan läser och använd sedan STUFF för att ersätta den första instansen av ett komma med ett tomt utrymme. Detta är ett knep som du kan hitta i hundratals SQL-bloggar. Så den här första delen bygger en sträng som heter ActionString som vi kan använda längre ner. Steg 2 . Vi vet också att vi vill SUM de genererade pivoterade orsakskolumnerna, tillsammans med standardförsäljningskolonnen. Så vi behöver en separat sträng för det som jag ska ringa SUMSTRING. I39ll använder helt enkelt den ursprungliga ActionString och ersätter sedan de yttre parenteserna med SUM-syntaxen, plus de ursprungliga parenteserna. Steg 3: Nu börjar det verkliga arbetet. Genom att använda den ursprungliga frågan som en modell vill vi generera den ursprungliga frågan (börjar med UNION av de två tabellerna), men ersätta eventuella referenser till svängda kolumner med strängarna som vi dynamiskt genererade ovan. Även om jag inte absolut är skyldig, har jag också skapat en variabel för att helt enkelt göra några kombinationer av returlinjemätningar som vi vill bädda in i den genererade frågan (för läsbarhet). Så we39ll konstruera hela frågan i en variabel som heter SQLPivotQuery. Steg 4. Vi fortsätter att bygga frågan igen och sammanfatta syntaxen vi kan quothard-wirequot med ActionSelectString (som vi genererade dynamiskt för att hålla alla möjliga återgångsgrunder). Steg 5. Slutligen kommer vi att generera den sista delen av Pivot Query, som härstammar från det 2: e vanliga tabelluttrycket (PIVOTCTE, från modellen ovan) och genererar den sista SELECT som ska läsas från PIVOTCTE och kombinerar den med en andra läs mot PIVOTCTE till implementera gruppsätten. Slutligen kan vi quotexecutequot strängen med hjälp av SQL-lagrade proc spexecuteSQL Så hoppas du kan se att processen för att följa för denna typ av ansträngning är att bestämma vad den sista frågan skulle vara, baserat på din nuvarande uppsättning data och värden (dvs byggd en frågemodell) Skriv den nödvändiga T-SQL-koden för att generera den sökfrågan som en sträng. Förmodligen den viktigaste delen är att bestämma den unika uppsättningen värden som du pllot PIVOT, och sedan kollapsa dem i en sträng med hjälp av STUFF-funktionen och FOR XML PATH (3939) trick Så vad är det i mitt sinne idag Tja, minst 13 saker Två somrar sedan skrev jag ett utkast till BDR som delvis fokuserade på utbildningens roll och värdet av en bra liberal konstbakgrund, inte bara för mjukvaruindustrin utan även för andra industrier. En av teman i denna BDR betonade en avgörande och upplyst synpunkt från den kända programarkitekten Allen Holub om liberal konst. Ill (trogen) parafraser hans budskap: han betonade parallellerna mellan programmering och studier av historia genom att påminna alla om att historia läser och skriver (och jag lägger till, identifierar mönster) och mjukvaruutveckling läser och skriver också (och igen, identifierar mönster ). Och så skrev jag en åsikt som fokuserade på detta och andra relaterade ämnen. Men tills idag har jag aldrig kommit runt för att antingen publiceraposting det. Varje så ofta Id tänker på att revidera den, och Id sätter sig ensam i några minuter och gör några justeringar till det. Men då skulle livet i allmänhet komma i vägen och Id slutar aldrig. Så vad förändrats För några veckor sedan skrev kollega CoDe Magazine-kolumnisten och branschledaren Ted Neward ett stycke i sin vanliga kolumn, Managed Coder, som fick min uppmärksamhet. Titeln på artikeln är On Liberal Arts. och jag rekommenderar starkt att alla läser det. Ted diskuterar värdet av en liberal arts bakgrund, den falska dikotomin mellan en liberal arts bakgrund och framgång i mjukvaruutveckling, och behovet av att skriva väl. Han talar om några av sina egna möten med HR-personalledning om hans utbildningsbakgrund. Han betonar också behovet av att acceptera och anpassa sig till förändringar i vår bransch, liksom kännetecknen hos en framgångsrik mjukvarufaglig (vara pålitlig, planera framåt och lära sig att komma över den ursprungliga konflikten med andra lagmedlemmar). Så det är en bra läsning, liksom Teds andra CoDe-artiklar och blogginlägg. Det fick mig också att tänka på mina åsikter om detta (och andra ämnen) och till slut motiverade mig att avsluta min egen redaktionella. Så, bättre sent än aldrig, här är mitt nuvarande Bakers Dozen of Reflections: Jag säger: Vatten fryser vid 32 grader. Om du är i en träningsinriktad roll kanske du tror att du gör allt i världen för att hjälpa någon när de faktiskt känner att de bara känner en temperatur på 34 grader, och därför stämmer det inte med dem. Ibland tar det bara lite mer ansträngning eller annan ideakemisk katalysator eller ett nytt perspektiv vilket innebär att de med tidigare utbildning kan dra på olika källor. Vatten fryser vid 32 grader. Vissa människor kan behålla höga koncentrationer, även med ett rum fullt av bullriga människor. Jag är inte en av dem ibland behöver jag lite integritet att tänka igenom en kritisk fråga. Vissa beskriver det här som du måste lära dig att gå ifrån det. Stats på ett annat sätt, det är en sökning efter den sällsynta luften. Den senaste veckan spenderade jag timmar i halvt upplyst, tyst rum med whiteboard tills jag helt förstod ett problem. Det var först då jag kunde prata med andra utvecklare om en lösning. Meddelandet här är inte att förkunna hur du ska gå om ditt företag att lösa problem, utan snarare för alla att veta sina styrkor och vad som fungerar och använda dem till din fördel så mycket som möjligt. Vissa fraser är som naglar på en tavla för mig. Använd det som ett undervisningsmoment är en. (Varför är det som naglar på en tavla? Om du är en mentorroll, bör du brukar vara i undervisningsmodus ändå, dock subtilt). Hennes andra jag kan inte förklara det ord, men jag förstår det. Det här låter lite kallt, men om en person verkligen inte kan förklara något i ord, kanske förstår de inte. Visst kan en person ha en fuzzy känsla av hur något fungerar Jag kan bluffa mig genom att beskriva hur en digitalkamera fungerar men sanningen är att jag inte verkligen förstår det så bra. Det finns ett fält som kallas epistemologi (kunskapsstudien). En av de grundläggande förutsättningarna för att förstå huruvida det är en kamera eller ett designmönster - är förmågan att etablera sammanhang, identifiera kedjan av relaterade händelser, attributen till några komponenter längs vägen etc. Ja, förståelse är ibland mycket svårt arbete , men att dyka in i ett ämne och bryta det är värt ansträngningen. Även de som undrar certifieringen kommer att erkänna att processen att studera för certifieringsförsök hjälper till att fylla luckor i kunskap. En databaschef är mer benägen att anställa en databasutvecklare som kan prata extemporaneously (och enkelt) om transaktionsisoleringsnivåer och utlösare, i motsats till någon som vet om det men kämpar för att beskriva deras användning. Theres en annan följd här. Ted Neward rekommenderar att utvecklare tar upp allmänhetens talande, bloggar etc. Jag är överens med 100. Processen med public speaking och blogging kommer i praktiken att tvinga dig att börja tänka på ämnen och bryta ner definitioner som du annars annars skulle ha tagit för givet. För några år sedan trodde jag att jag förstod T-SQL MERGE-uttalandet ganska bra. Men först efter att ha skrivit om det och talade om att fältfrågor från andra som hade perspektiv som aldrig kom till mig att min nivå av förståelse ökade exponentiellt. Jag vet en historia om en anställningschef som en gång intervjuade en författarutvecklare för en kontraktsposition. Anställningschefen var föraktig av publikationer i allmänhet och skällde på sökanden. Så om du ska jobba här, vill du hellre skriva böcker eller skriva kod? Ja, jag erkänner att det i någon bransch kommer att finnas några rena akademiker. Men vad den anställande chefen missade var möjligheterna att stärka och skärpa färdighetssätt. Under rensningen av en gammal låda med böcker kom jag över en skatt från 1980-talet: Programmerare på jobbet. som innehåller intervjuer med en mycket ung Bill Gates, Ray Ozzie och andra kända namn. Varje intervju och varje insikt är värt priset på boken. Enligt min mening var den mest intressanta intervjun med Butler Lampson. vem gav några kraftfulla råd. Till helvetet med datakunskap. Det är helt löjligt. Studera matematik Lär dig att tänka. Läsa. Skriva. Dessa saker är av mer varaktigt värde. Lär dig att bevisa teorier: Mycket bevis har ackumulerats under århundradena som föreslår att denna färdighet kan överföras till många andra saker. Butler talar sanningen. Jag lägger till den punkten lär dig hur du spelar djävulens förespråkare mot dig själv. Ju mer du kan verklighet - kontrollera dina egna processer och arbete, desto bättre kommer du att vara. Den stora datateknikerautografen Allen Holub gjorde sambandet mellan mjukvaruutveckling och liberalkunsten specifikt historiens ämne. Här var hans punkt: Vad är historia Läsning och skrivning. Vad är mjukvaruutveckling Bland annat läser och skriver. Jag brukade ge mina studenter T-SQL essay frågor som övningstest. En student skojade att jag agerade mer som en jurist. Tja, precis som coach Donny Haskins sa i filmen Glory Road, är min väg svår. Jag tror starkt på en stark intellektuell grund för något yrke. Precis som applikationer kan dra nytta av ramverk, kan individer och deras tankeprocesser också dra nytta av mänskliga ramar. Det är grunden för stipendiet. Det finns en historia som på 1970-talet expanderade IBM sina rekryteringsansträngningar i de stora universiteten genom att fokusera på de bästa och ljusaste av liberale konsterna. Även då erkände de att de bästa läsarna och författarna någonsin skulle bli starka programmersystemsanalytiker. (Känn dig fri att använda den historien till någon HR-typ som insisterar på att en kandidat måste ha en datavetenskaplig examen) Och talar om historia: om det av någon annan anledning är viktigt att komma ihåg historien om produktutgåvor om jag jobbar på en klientwebbplats som fortfarande använder SQL Server 2008 eller till och med (gasp) SQL Server 2005, måste jag komma ihåg vilka funktioner som implementerades i versionerna över tiden. Har du någonsin en favoritläkare som du tyckte om eftersom heshe förklarade saker på vanlig engelska, gav dig den raka sanningen och förtjänat ditt förtroende att fungera på dig Det är galenskap. och är resultatet av erfarenhet och hårt arbete som tar år och till och med årtionden att odla. Det finns inga garantier för att arbetssucces fokuserar på fakta, ta några beräknade risker när du är säker på att du kan se dig fram till målstrecket, låt chipset falla där de kan och aldrig glömma att vara precis som den läkaren som tjänat din förtroende Även om vissa dagar jag blir korta försöker jag behandla min klient och deras data som en läkare skulle behandla patienter. Även om en läkare gör mer pengar Det finns många clichs jag avskyr men heres jag hatar inte: Det finns ingen sådan sak som en dålig fråga. Som en tidigare instruktör hörde en sak som drog min irre någon att kritisera en annan person för att fråga en förmodligen dum fråga. En fråga visar att en person erkänner att de har lite klyfta i kunskap som de vill fylla. Ja, vissa frågor är bättre formulerade än andra, och vissa frågor kräver ytterligare inramning innan de kan besvaras. Men resan från att ställa en fråga till ett svar är sannolikt att generera en aktiv mental process i andra. Det finns alla bra saker. Många goda och fruktbara diskussioner härrör från en dum fråga. Jag arbetar över hela linjen i SSIS, SSAS, SSRS, MDX, PPS, SharePoint, Power BI, DAX, alla verktyg i Microsoft BI-stacken. Jag skriver fortfarande en kod från tid till annan. Men gissa vad jag fortfarande spenderar så mycket tid på att skriva T-SQL-kod till profildata som en del av upptäcktsprocessen. Alla applikationsutvecklare ska ha bra T-SQL-kotletter. Ted Neward skriver (korrekt) om behovet av att anpassa sig till tekniska förändringar. Jag lägger till det behovet av att anpassa mig till clientemployer förändringar. Företagen byter affärsregler. Företag förvärvar andra företag (eller blir målet för ett förvärv). Företag gör misstag i att kommunicera företagets krav och specifikationer. Ja, vi kan ibland spela en roll för att hjälpa till att hantera dessa förändringar och ibland var flygan, inte vindrutan. Dessa orsakar ibland stor smärta för alla, särskilt I. T. personer. Därför finns begreppet livsfaktum som vi måste ta itu med. Precis som ingen utvecklare skriver buggfri kod varje gång, ingen I. T. person hanterar väl förändringar varje gång. En av de största kamperna Ive hade under min 28 år i denna bransch visar tålamod och återhållsamhet när förändringar flyger från många olika håll. Här är var mitt tidigare förslag om att söka efter den sönderdelade luften kan hjälpa till. Om du lyckas assimilera förändringar i din tankeprocess och utan att känna dig överväldigad är oddsen en viktig tillgång. Under de senaste 15 månaderna hade Ive att hantera en stor mängd professionella förändringar. Det har varit mycket svårt ibland, men Ive har beslutat att förändringen kommer att vara normen och jag har försökt att anpassa mina vanor så gott jag kan klara av frekvent (och osäker) förändring. Det är svårt, mycket svårt. Men som tränare Jimmy Duggan sa i filmen A League of Their Own: Naturligtvis är det svårt. Om det inte var svårt, skulle alla göra det. Det svåra, är det som gör det bra. Ett kraftfullt meddelande. Det har varit prat i branschen under de senaste åren om uppförande vid professionella konferenser (och beteende i branschen som helhet). Många respekterade författare har skrivit mycket bra redaktionella ämnen om ämnet. Heres min inmatning, för vad det är värt. Its a message to those individuals who have chosen to behave badly: Dude, it shouldnt be that hard to behave like an adult. A few years ago, CoDe Magazine Chief Editor Rod Paddock made some great points in an editorial about Codes of Conduct at conferences. Its definitely unfortunate to have to remind people of what they should expect out of themselves. But the problems go deeper. A few years ago I sat on a five-person panel (3 women, 2 men) at a community event on Women in Technology. The other male stated that men succeed in this industry because the Y chromosome gives men an advantage in areas of performance. The individual who made these remarks is a highly respected technology expert, and not some bozo making dongle remarks at a conference or sponsoring a programming contest where first prize is a date with a bikini model. Our world is becoming increasingly polarized (just watch the news for five minutes), sadly with emotion often winning over reason. Even in our industry, recently I heard someone in a position of responsibility bash software tool XYZ based on a ridiculous premise and then give false praise to a competing tool. So many opinions, so many arguments, but heres the key: before taking a stand, do your homework and get the facts . Sometimes both sides are partly rightor wrong. Theres only one way to determine: get the facts. As Robert Heinlein wrote, Facts are your single clue get the facts Of course, once you get the facts, the next step is to express them in a meaningful and even compelling way. Theres nothing wrong with using some emotion in an intellectual debate but it IS wrong to replace an intellectual debate with emotion and false agenda. A while back I faced resistance to SQL Server Analysis Services from someone who claimed the tool couldnt do feature XYZ. The specifics of XYZ dont matter here. I spent about two hours that evening working up a demo to cogently demonstrate the original claim was false. In that example, it worked. I cant swear it will always work, but to me thats the only way. Im old enough to remember life at a teen in the 1970s. Back then, when a person lost hisher job, (often) it was because the person just wasnt cutting the mustard. Fast-forward to today: a sad fact of life is that even talented people are now losing their jobs because of the changing economic conditions. Theres never a full-proof method for immunity, but now more than ever its critical to provide a high level of what I call the Three Vs (value, versatility, and velocity) for your employerclients. I might not always like working weekends or very late at night to do the proverbial work of two people but then I remember there are folks out there who would give anything to be working at 1 AM at night to feed their families and pay their bills. Always be yourselfyour BEST self. Some people need inspiration from time to time. Heres mine: the great sports movie, Glory Road. If youve never watched it, and even if youre not a sports fan I can almost guarantee youll be moved like never before. And Ill close with this. If you need some major motivation, Ill refer to a story from 2006. Jason McElwain, a high school student with autism, came off the bench to score twenty points in a high school basketball game in Rochester New York. Heres a great YouTube video. His mother said it all . This is the first moment Jason has ever succeeded and is proud of himself. I look at autism as the Berlin Wall. He cracked it. To anyone who wanted to attend my session at todays SQL Saturday event in DC I apologize that the session had to be cancelled. I hate to make excuses, but a combination of getting back late from Detroit (client trip), a car thats dead (blown head gasket), and some sudden health issues with my wife have made it impossible for me to attend. Back in August, I did the same session (ColumnStore Index) for PASS as a webinar. You can go to this link to access the video (itll be streamed, as all PASS videos are streamed) The link does require that you fill out your name and email address, but thats it. And then you can watch the video. Feel free to contact me if you have questions, at kgoffkevinsgoff November 15, 2013 Getting started with Windows Azure and creating SQL Databases in the cloud can be a bit daunting, especially if youve never tried out any of Microsofts cloud offerings. Fortunately, Ive created a webcast to help people get started. This is an absolute beginners guide to creating SQL Databases under Windows Azure. It assumes zero prior knowledge of Azure. You can go to the BDBI Webcasts of this website and check out my webcast (dated 11102013). Or you can just download the webcast videos right here: here is part 1 and here is part 2. You can also download the slide deck here. November 03, 2013 Topic this week: SQL Server Snapshot Isolation Levels, added in SQL Server 2005. To this day, there are still many SQL developers, many good SQL developers who either arent aware of this feature, or havent had time to look at it. Hopefully this information will help. Companion webcast will be uploaded in the next day look for it in the BDBI Webcasts section of this blog. October 26, 2013 Im going to start a weekly post of T-SQL tips, covering many different versions of SQL Server over the years Heres a challenge many developers face. Ill whittle it down to a very simple example, but one where the pattern applies to many situations. Suppose you have a stored procedure that receives a single vendor ID and updates the freight for all orders with that vendor id. create procedure dbo. UpdateVendorOrders update Purchasing. PurchaseOrderHeader set Freight Freight 1 where VendorID VendorID Now, suppose we need to run this for a set of vendor IDs. Today we might run it for three vendors, tomorrow for five vendors, the next day for 100 vendors. We want to pass in the vendor IDs. If youve worked with SQL Server, you can probably guess where Im going with this. The big question is how do we pass a variable number of Vendor IDs Or, stated more generally, how do we pass an array, or a table of keys, to a procedure Something along the lines of exec dbo. UpdateVendorOrders SomeListOfVendors Over the years, developers have come up with different methods: Going all the way back to SQL Server 2000, developers might create a comma-separated list of vendor keys, and pass the CSV list as a varchar to the procedure. The procedure would shred the CSV varchar variable into a table variable and then join the PurchaseOrderHeader table to that table variable (to update the Freight for just those vendors in the table). I wrote about this in CoDe Magazine back in early 2005 (code-magazinearticleprint. aspxquickid0503071ampprintmodetrue. Tip 3) In SQL Server 2005, you could actually create an XML string of the vendor IDs, pass the XML string to the procedure, and then use XQUERY to shred the XML as a table variable. I also wrote about this in CoDe Magazine back in 2007 (code-magazinearticleprint. aspxquickid0703041ampprintmodetrue. Tip 12)Also, some developers will populate a temp table ahead of time, and then reference the temp table inside the procedure. All of these certainly work, and developers have had to use these techniques before because for years there was NO WAY to directly pass a table to a SQL Server stored procedure. Until SQL Server 2008 when Microsoft implemented the table type. This FINALLY allowed developers to pass an actual table of rows to a stored procedure. Now, it does require a few steps. We cant just pass any old table to a procedure. It has to be a pre-defined type (a template). So lets suppose we always want to pass a set of integer keys to different procedures. One day it might be a list of vendor keys. Next day it might be a list of customer keys. So we can create a generic table type of keys, one that can be instantiated for customer keys, vendor keys, etc. CREATE TYPE IntKeysTT AS TABLE ( IntKey int NOT NULL ) So Ive created a Table Typecalled IntKeysTT . Its defined to have one column an IntKey. Nowsuppose I want to load it with Vendors who have a Credit Rating of 1..and then take that list of Vendor keys and pass it to a procedure: DECLARE VendorList IntKeysTT INSERT INTO VendorList SELECT BusinessEntityID from Purchasing. Vendor WHERE CreditRating 1 So, I now have a table type variable not just any table variable, but a table type variable (that I populated the same way I would populate a normal table variable). Its in server memory (unless it needs to spill to tempDB) and is therefore private to the connectionprocess. OK, can I pass it to the stored procedure now Well, not yet we need to modify the procedure to receive a table type. Heres the code: create procedure dbo. UpdateVendorOrdersFromTT IntKeysTT IntKeysTT READONLY update Purchasing. PurchaseOrderHeader set Freight Freight 1 FROM Purchasing. PurchaseOrderHeader JOIN IntKeysTT TempVendorList ON PurchaseOrderHeader. VendorID Te mpVendorList. IntKey Notice how the procedure receives the IntKeysTT table type as a Table Type (again, not just a regular table, but a table type). It also receives it as a READONLY parameter. You CANNOT modify the contents of this table type inside the procedure. Usually you wont want to you simply want to read from it. Well, now you can reference the table type as a parameter and then utilize it in the JOIN statement, as you would any other table variable. So there you have it. A bit of work to set up the table type, but in my view, definitely worth it. Additionally, if you pass values from , youre in luck. You can pass an ADO data table (with the same tablename property as the name of the Table Type) to the procedure. For developers who have had to pass CSV lists, XML strings, etc. to a procedure in the past, this is a huge benefit. Finally I want to talk about another approach people have used over the years. SQL Server Cursors. At the risk of sounding dogmatic, I strongly advise against Cursors, unless there is just no other way. Cursors are expensive operations in the server, For instance, someone might use a cursor approach and implement the solution this way: DECLARE VendorID int DECLARE dbcursor CURSOR FASTFORWARD FOR SELECT BusinessEntityID from Purchasing. Vendor where CreditRating 1 FETCH NEXT FROM dbcursor INTO VendorID WHILE FETCHSTATUS 0 EXEC dbo. UpdateVendorOrders VendorID FETCH NEXT FROM dbcursor INTO VendorID The best thing Ill say about this is that it works. And yes, getting something to work is a milestone. But getting something to work and getting something to work acceptably are two different things. Even if this process only takes 5-10 seconds to run, in those 5-10 seconds the cursor utilizes SQL Server resources quite heavily. Thats not a good idea in a large production environment. Additionally, the more the of rows in the cursor to fetch and the more the number of executions of the procedure, the slower it will be. When I ran both processes (the cursor approach and then the table type approach) against a small sampling of vendors (5 vendors), the processing times where 260 ms and 60 ms, respectively. So the table type approach was roughly 4 times faster. But then when I ran the 2 scenarios against a much larger of vendors (84 vendors), the different was staggering 6701 ms versus 207 ms, respectively. So the table type approach was roughly 32 times faster. Again, the CURSOR approach is definitely the least attractive approach. Even in SQL Server 2005, it would have been better to create a CSV list or an XML string (providing the number of keys could be stored in a scalar variable). But now that there is a Table Type feature in SQL Server 2008, you can achieve the objective with a feature thats more closely modeled to the way developers are thinking specifically, how do we pass a table to a procedure Now we have an answer Hope you find this feature help. Feel free to post a comment. Earn the CST Diploma Part-time The Computer Systems Technology (CST) Diploma has provided thousands of career-ready graduates to all IT sectors across Canada. BCIT Computing offers two separate pathways to the CST Diploma, full-time or part-time course-by-course. Intensive full time delivery is two years, or part-time is typically completed by taking two courses per term over a period of six years. Some students may be able to complete three courses per term, however they will need to have a plan approved by the program head. The CSTPTS Diploma starts with a solid foundation of programming and systems development via a series of smaller modular credentials. 1) The first step is to complete Applied Software Development (ASD). It is extremely important that students demonstrate their ability to write code in multiple programming languages at the beginning of this series. 2) The second step is Applied Computer Information Systems (ACIS). Some students may attempt the ASD and ACIS simultaneously. After learning to write code, students then cover operating systems, database, web and English communication. 3) ASD and ACIS are subsets of the Computer Systems Certificate (CSC). which must be completed prior to starting the CSTPTS Diploma. The CSC is equivalent to the first year of the full-time CST Diploma in programming, web, database, math, architecture and technical writing. 4) Built on top of the CSC, the CSTPTS Diploma students cover data communications, advanced operating systems, network design, administration and security. There are nine core courses and seven to ten elective courses needed to complete the 60 unique credits on top of the 60 credits in the CSC. Core requirements include advanced object oriented analysis, algorithm design plus Internet law. Elective courses include advanced software application development, web and mobile, advanced database, analytics and business intelligence. Students who complete the CST Diploma either full-time or part-time may then apply for the Computer Systems Bachelors Degree. CST BTech. CST Diploma graduates from BCIT Computing are highly regarded by industry and have a major competitive advantage. Program Entry Costs amp Supplies Internet and IT Law This hands on course is aimed at BCIT Computing and Business students who want to learn not only about the laws and regulations that apply to the Internet and information technology, but also how to engage intellectual property rights, law and regulation to protect intellectual effort. Topics include privacy, private data collection, property (IPDRM), security, gambling, ethics, the internet of thingseverything (IoT), data, patents, trademarks, domain names, copyright, linking, meta-tags, online contracts, online advertising and marketing. Students receive an overview of law in the modern marketplace, which we practice applying online in a series of non-cumulative exercises, a role play exercise and in discussions. IT Project Management This hands-on course is aimed at BCIT Computing students who want to learn how to develop and implement an IT project plan. Project Management best practices and decisions apply across various IT sectors including: Web and Software Development, Databases and Networking. Topics include: identifying project stakeholders and defining roles and responsibilities of the team, defining scope, devising risks and quality plans, mapping-out a schedule, determining a budget and defining a communication strategy. Participants are introduced to the Microsoft Project software application. Students receive an overview of common project management concepts which they can apply to real world IT projects on time and on budget. Prerequisite: COMP 1002 or equivalent knowledge of a Windows PC, and file management. XML for Web Development XML is a standard for structuring, and storing web information. This course is focused on XML for Web Development for those with an HTML and CSS background. Following on from COMP 1850 this hands-on course will introduce students to Extensible Markup Language (XML). Participants will learn how XML is used within the web and how to integrate XML formats into web page development. Topics include XML syntax, DTD validation, namespaces, XML data modeling, and performing transformations with XSLT and XPath. Upon successful completion of this course, students will have an understanding of the basics of XML for web development and be prepared to move on to more advanced XML courses. Prerequisite: COMP 1850 or equivalent knowledge of HTML5, and CSS3. C Application Development 2 This hands-on intermediate level course assumes students have completed COMP 2617 C Application Development Part 1 with a minimum of 60. Students immediately move into more advanced C11 features. Topics include: operator overloading template classes exception handling the string class and stream processing the Standard Template Library file processing and namespaces. Additional miscellaneous advanced C topics will also be covered. Delivery is face-to face for 3 hours each week plus an online and homework component. Typical students will require about 10 hours per week to study the material and work on assignments outside of class. Upon successful completion, participants will be able to write, test and debug C programs to industry standards and be able to develop significant software applications. Prerequisite: COMP 2617 completion with 60 or better. Applied IT Security Fundamentals IT security is growing area with several domains including both information security and network security. This course replaces COMP 3705 which covered both information security and network security. COMP 3704 will provide a more in depth overview of key topics in information security only and is one of the prerequisites for COMP 4704 Applied Network Security. IT professionals across multiple sectors from software development, database, web, mobile and networks will benefit from the material covered. This hands-on course is led by local industry experts who will share their knowledge and best practices for securing computer systems. Students will complete labs and exercises to experience applied IT security and gain a practical knowledge. Topics will include: security awareness, risk mitigation and control administration, data and application security, cryptography, attack techniques, penetration testing, vulnerability assessment, incident response, disaster recovery, and forensic analysis. In addition, information handling best practices, privacy and regulatory issues are discussed. Upon completion of this course, successful participants will be aware of best practices in IT security and how to implement secure information systems. Network related aspects of IT security are covered in the follow-on course, COMP 4704 ldquoApplied Network Securityquot. Prerequisite: COMP 1002 or equivalent knowledge. Data Communications for CST Following on from COMP 2825 Computer Architecture, students are introduced to the basic concepts and terminology related to data communications, networking and network topologies. COMP 3725 replaces COMP 3721 in the CSTPTS Diploma and is equivalent to the full-time CST Diploma course. Students will learn about the TCPIP protocol suite and the principles of protocols at the physical, data link, network and transport layers, the characteristics of transmission media, analogdigital transmission, multiplexingswitching techniques, basic error detection and correction, elementary data link protocols, flow control and an introduction to routing and congestion control issues. Multiple access protocols, the UDP and TCP protocols, networking and internetworking devices, LANs and WANs will also be discussed. The course has a strong emphasis on data communications at the physical layer and the assignments will reinforce the fundamental concepts and analysis techniques. Upon successful completion, students will be familiar with network protocol implementation using a layered approach and apply basic data communication theory to the design and analysis of networks. Prerequisites: COMP 2825 or COMP 2721 Algorithm Analysis and Design In this hands-on course, Java programming students who have also taken Discrete Math will develop their ability to analyze and design computer algorithms. In particular, learners will analyze the time and space complexity of programs, solve nontrivial programming problems using algorithmic techniques, and prove that their solution is correct. The emphasis will be on developing the practical skills of analysis and design. Topics include: evaluating time and space complexity and designing solutions by using appropriate data structures or applying techniques such as recursion, parsing and graph algorithms. Prerequisites: COMP 2121 and (COMP 2611 or COMP 2613) Object Oriented Analysis and Design This advanced OOAD course follows on from COMP 2831 and is aimed at software analysts, designers and developers who already understand the Software development Life Cycle (SDLC). Through exercises and group work, students first perform Object Oriented Analysis (OOA) to produce a conceptual model of existing information using case studies to identify actors and primary use cases for documentation. Using Object Oriented Design (OOD) students learn how to identify classes and build the domain model. Round trip engineering, reverse engineering and code generation are practised in labs, where the design is converted to functional code. Topics include: design patterns, anti-patterns and General Responsibility Assignment Software Patterns (GRASP). The concepts of phases, iterations, activities and artifacts are emphasized throughout the course. Labs include the use of the Unified Process (UP) which is an extensible framework for iterative and incremental software development process, and the basis of all the modern ldquoAgile methodologiesrdquo. Participants also gain hands-on experience using a case tool, Rational Rose Modeler, to draw most of the Unified Modeling Language (UML) diagrams necessary to support the OOAD activities. Students are introduced to manual and automated software testing. They will learn how to create and execute test scripts using a testing tool. Successful participants will be able to demonstrate the ability to analyse, design and construct sophisticated software applications to industry standards. Prerequisites: COMP 2831 and ability to write executable code in an object oriented programming language. Operating Systems for CST This course replaces COMP 3730 and COMP 4730 and covers the concepts of operating systems. The course is designed for CST Diploma students who understand both C and Java programming. The main focus is on the structure and services of operating systems and how these services are used and implemented. Topics include: processor management, processes and threads, inter-process communication, synchronization, memory management, inputoutput and file management. Labs will include hands-on system programming in UnixLinux. Prerequisites: (COMP 2510 or COMP 2511 or COMP 2717) and (COMP 2721 or COMP 2825) Program Details Graduating amp Jobs Faculty, Advisors amp Staff Contact UsThe denominated currency of the share. Currency Peg A countrys or governments exchange-rate policy of pegging the central banks rate of exchange to another countrys currency. Currency has sometimes also been pegged to the price of gold. Currency pegs allow importers and exporters to know exactly what kind of exchange rate they can expect for their transactions, simplifying trade. Current Liabilities Company declared liabilities which are due to be settled within the current financial year. Current Ratio This is used to calculate the ability of a company to meet its short term debt obligations. It is calculated by dividing its current assets by its current liabilities. The higher the current ratio, the more likely a company will be able to meet its obligations. D Back to top Repayment of bonds or other debt securities on or before their maturity date. RedenominationRenominalisation The process whereby a countrys currency is recalibrated due to significant inflation and currency devaluation. Certain currencies have been redenominated a number of times over the last century for various reasons. A recent example of redenomination was when the euro was introduced and the denomination of many European securities had to be changed to the euro. Registered Security The name given to securities whereby ownership is registered with the issuing company or their agent. Transfer of ownership can only take place with the owners consent. Regulatory News Service (RNS) The London Stock Exchanges service which ensures that price sensitive information from listed companies, and certain other bodies, is distributed to all RNS subscribers at the same time. Relative Strength Index The Relative Strength Index (RSI) measures a share price relative to itself and its recent history. It is calculated as the average of the prices for days where the price rose divided by the average of the prices for days where the price fell. The RSI ranges between 0 and 100. Relevant UK Earnings For most people, this is their salary before tax or, if they are self-employed, their taxable profit. It does not include, for example, interest on savings, dividends on shares or pensions. Relevant UK Individual Includes someone who is resident in the UK at some point in the current tax year or has Relevant UK Earnings. Rematerialisation The process of transferring a security held in electronic form to a certificated form. Retention of Income Accumulation units in a fund do not pay physical dividends. Instead, on the ex-dividend date, the unit price is adjusted upward to reflect the dividend distribution. These adjustments will increase your tax cost for the holding and will appear on your Stock Movements page and your Securities Report as Retention of Income. Retirement Annuity Contract (RAC) Prior to 30th June 1988, people not in pensionable employment (employment where no pension scheme exists) or people who were self employed were able to qualify for tax relief for contributions made to a pension scheme known as a retirement annuity under sections 226 of the Income and Corporation Taxes Act 1970. Although RACs were replaced by personal pension plans from 1st July 1988 those already in force may continue to operate. Return of Capital A return from an investment that is not considered income. The return of capital is when some or all of the money an investor has in an investment is paid back to him or her, thus decreasing the value of the investment. Return on Capital A ratio used in the assessment of the performance of a company and quantifies how well a company generates cash flow relative to the capital it has invested in its business. Return on Capital Employed (ROCE) A measure of the returns that a company is realising from its capital. Calculated as profit before interest and tax divided by the difference between total assets and current liabilities. The resulting ratio represents the efficiency with which capital is being utilised to generate revenue. Rights Issue An offer made by a quoted company to its shareholders to enable them to buy new shares in the company at a discount to the market price. Existing shareholders are usually offered shares in proportion to their existing holding. For example in a one for five rights issue, a shareholder would be invited to buy one new share for every five shares already owned. The new shares are offered at a discount to the current market price. Risk and Reward A ratio used to compare the expected returns of an investment with the amount of risk undertaken to capture these returns. This ratio is calculated mathematically by dividing the amount of profit the investor expects to have made when the position is closed (i. e. the reward) by the amount they could lose if the price moves in an unexpected direction (i. e. the risk). S Back to top The sale date refers to the date on which the holdings were liquidated, or alternatively the target date on which it is planned that the holdings be liquidated. Scrip Dividend The issue of additional shares by a company to shareholders in lieu of a dividend. The shares have an equivalent cash value to the dividend. No dealing charges or stamp duty is payable on the issue of the new shares. Scrip Issue An issue of shares made by a company free of charge to existing shareholders. Also called a bonus issue. The Stock Exchange Automated Quotation system (or SEAQ) is a system for trading mid-cap London Stock Exchange (LSE) stocks. Stocks need to have at least two market-makers to be eligible for trading via SEAQ. Only stocks that are not listed on the FTSE100 can be traded on SEAQ. SEATS Plus SEATS Plus is a trading system that handles the trading of all AIM and listed UK equities whose turnover is insufficient for the market making system or the Stock Exchange Electronic Trading Service (SETS). The sector in which the stock is listed on the London Stock Exchange, for example mining, software and computer services. A financial instrument which represents an ownership position in a publicly traded corporation (stock), a creditor relationship with a governmental body or corporation (bond) or rights to ownership as represented by an option. Self employed People who run their own business and take responsibility for its success or failure. They can decide how, when and where they do their work, but can hire other people to do some or all of the work at their own expense. Self Invested Personal Pension (SIPP) The name given to the type of UK-government-approved personal pension scheme, which allows individuals to make their own investment decisions from the full range of investments approved by HM Revenue Customs (HMRC). SIPPs, in common with personal pension schemes, are tax wrappers, allowing tax rebates on contributions in exchange for limits on accessibility. The HMRC rules allow for a greater range of investments to be held than Personal Pension Plans, notably equities and property. Rules for contributions, benefit withdrawal etc. are the same as for other personal pension schemes. The automated trading system introduced in 1997 for the largest companies quoted on the main list of the London Stock Exchange. Trades through SETS match buyers and sellers automatically, cutting out the need for a market maker, theoretically meaning a narrower bid-offer spread. Settlement Payment of cash for securities bought and delivery of securities against payment. Settlement Date The date by which the buyer of a security must pay the seller. The settlement date depends upon the type of security traded. For example, stocks usually have a settlement date three days after the trade date but government bonds must be settled on the next trading day. Share Certificate A certificate which confirms ownership of a shareholding. If shares are held in certificated form, the certificate must be delivered to the market upon sale. Share Incentive Scheme Introduced to the UK in 2000, they offer employees the opportunity to participate in the success of the company for which they work. Contributions are taken directly from salary before tax and national insurance are deducted with the scheme running for a period of 3 years. After 3 years, the saver has several options available. Firstly, they can buy shares in their company at a pre-determined price and then sell them immediately. Secondly, keep the shares purchased or thirdly have the savings returned in full. Share Option A right to buy or sell shares at an agreed price at a time in the future. Shareholders Funds The capital employed in a company, calculated by deducting the book value of the liabilities from the book value of the assets. Also called net assets, net worth and shareholders equity. A unit of ownership in a corporation or financial asset. While owning shares in a business does not mean that the shareholder has direct control over the businesss day-to-day operations, being a shareholder does entitles them to an equal distribution in any profits, if any are declared in the form of dividends. A share can be quoted or unquoted and ordinary or preference shares. Shell Company Non-trading firm formed (and often listed on a stock exchange) as a vehicle to (1) raise funds before starting operations, (2) attempt a takeover, (3) prepare for a public offering of shares, or (4) provide a front for an illegal business. The selling of a security that the seller does not own, or any sale that is completed by the delivery of a security borrowed by the seller. Short sellers assume that they will be able to buy the stock at a lower amount than the price at which they sold short. Small Cap Stock A small-cap stock has a low market capitalisation when compared to those listed on the FTSE100. Investors may perceive a small-cap stock as having greater growth potential than a large-cap stock. A small-cap stock may be more likely than a large company to adopt or create innovative new technologies or services. A small-cap stock often has a lower level of institutional interest, as many funds have limits on the percentage of a company they may own. This in turn increases the trading volatility of a small-cap stock, potentially allowing for more extreme (more profitable) entries and exits. Small Self Administered Scheme (SSAS) A SSAS is a company pension scheme where the members are usually all company directors or key staff. A SSAS is set up by a trust deed which allows membersemployers greater flexibility and control over the schemes assets. The difference between which the price of a stock is bought and sold. Some collective investments, such as Unit Trusts, also operate bidoffer spreads. Stakeholder Pension Plan Stakeholder pensions aim to provide a low-cost, transparent and flexible way for people on low incomes to make additional provisions for their retirement. Money invested in stakeholder pensions is invested in the stock market. On retirement a quarter of the accumulated capital can be taken as a tax-free cash sum, with the balance to be used to purchase an annuity. Stamp Duty Stamp duty is payable on purchases of shares using a stock transfer form, on some transfers of interest in partnerships and on land or property tansactions entered into before 1 Dec 2003. Stamp Duty Reserve Tax (SDRT) SDRT is a tax on shares and securities when you buy through the stock market or a stock broker. Standard Poors An international agency which provides credit ratings and research. State Earnings Related Pension Scheme (SERPS) Introduced in 1978, SERPS was a top up to the basic state pension with the amount received dependent upon the National Insurance Contributions paid. In 2002 it became the State Second Pension. Stepped Preference Shares Preference shares with dividends that increase annually by a specified amount and with a predetermined capital return. Stock Description The name and classification of the security held. The company name is detailed first followed by the abbreviated version of the type of share held (e. g. ORD means Ordinary Share) and then the currency that the share is held in (e. g GBP sterling) Stock Exchange Daily Official List (SEDOL) A unique identifier assigned to all securities trading on the London Stock Exchange and other smaller exchanges in the UK. The SEDOL is seven characters in length and comprises a combination of letters and numbers. Live streaming of share prices is available when logged in and when the portfolio is ordered by holding alphabetically, rather than by a numeric value (which would cause the order of rows to change constantly). The prices you see are those that the traders see on their trading screens. An arrangement of characters (usually letters) representing a particular security listed on an exchange or otherwise traded publicly. When a company issues shares for the first time, it selects an arrangement of characters (usually letters) representing a particular security listed on an exchange or otherwise traded publicly. When a company issues shares for the first time, it selects an available ticker symbol for its securities which is then used to place orders - each symbol is unique. For example, the shares for Microsoft are listed as MSFT. T Back to top A corporate action where one company makes a bid for another. If the target company is publicly traded, the acquiring company will make an offer for the outstanding shares. HMRC apply a number of rules when determining the cost for UK tax purposes. The Tax Cost represents the cost of the holding once such rules have been applied. A FTSE index launched in 1999 by the London Stock Exchange to reflect the growth at that time in internet and technology stocks. To be included, a company must be committed to technological innovation and listed on the exchange. It includes biotechnology companies as well as internet stocks and software companies. The TechMARK 100 is a subset of the TechMARK all-share and both have an upper market cap limit so as to exclude the largest companies. Tender offer An offer to purchase some or all of shareholders shares in a corporation. The price offered is usually at a premium to the market price. Terminal Illness An advanced or rapidly progressing incurable illness. In the opinion of an attending consultant andor Chief Medical Officer the life expectancy of the sufferer would be no more than 12 months. Tax Exempt Special Savings Account a former tax-free savings scheme(available 1991-99). Total Expense Ratio The Total Expense Ratio (TER) accounts for all the costs in running an investment fund. As well as the Annual Management Charge, the TER would include trading fees, legal fees, auditor fees and other operational expenses. The TER is expressed as a percentage and is calculated by dividing the monetary cost of running the fund by the funds total assets. Tracker Fund An index fund that tracks a broad market index or a segment of it. Such a fund invests in all, or a representative number, of the securities within the index. Also know as an index fund. Trade Cut-off The time by which you must place your trade on the website in order for it to execute within the next available valuation point. Trade Price The last known trading price. Trade Time The time at which the last deal for the security was completed. Trade Type The coding applied to the trade confirming the transaction that has been completed. A - An automatic trade generated by the system through automatic execution. U - Uncrossing Trade - this is used for the single uncrossing trade, detailing the total executed volume and uncrossing price as a result of a SETS auction. N - Negotiated Trade - LSE uses an Automated Trading Service (ATS) to execute our real-time online deals. Restrictions imposed by the ATS may mean that certain stocks or order sizes cannot be traded automatically. If this is the case then you will be given the option to place a Negotiated Trade order. The order will be forwarded electronically and securely to our dealing team. They will manually execute your order as soon as possible and at the best price available in the market at the time of dealing. O - Ordinary Trade - the transaction that was not covered by any of the other trade types listed. T - Over the Counter Trade - a security which is not traded on an exchange, usually due to an inability to meet listing requirements. S - Systematic Internalises - are obliged to publish prices for trading with their customers and are allowed to improve prices when dealing in retail size or with retail clients. CT - The trade reported for a transaction previously executed automatically through the order book. LC - Late Correction - the error trade reported that has been last corrected. OC - OTC Trade correction. SC - SI trade Correction. Trade Volume The quantity of the security traded at the last known price. Transfer Value The monetary amount available which can be moved to another financial product. For example, the proceeds of a Cash ISA can be transferred to a Stocks and Shares ISA. Refers to the direction of security prices. An uptrend is a succession of higher highs and higher lows. A downtrend is a succession of lower highs and lowers lows. Trends are classified as Major (one year or longer), Intermediate (one to six months) and Minor (one month or less). U Back to top Underlying Asset In a derivative or warrant, the security, property, or other asset that gives value to the derivative or warrant. For example, in an option giving the right to buy stock in a share, the underlying asset is the share. An underlying asset may mean many things, such as a physical commodity, a security, a piece of land, or part of a business. Unit Price Latest price of fund holdings. Unit Trust Unit trusts are collective funds that allow private investors to pool their money in a single fund, thus spreading their risk across a range of investments, getting the benefit of professional fund management, and reducing their dealing costs. Unit trusts are open-ended in contrast to investment trusts, which are closed funds. Different trusts have different investment objectives: for example investing for income or growth, in small companies or large, and in different geographical regions. Unquoted Shares Unquoted shares are shares which are not traded on stock exchanges or other regulated financial markets. The current value of the total number of shares listed for the security. Value Investing The strategy of selecting stocks that trade for less than their intrinsic values. Value investors actively seek stocks of companies that they believe the market has undervalued. They believe the market overreacts to good and bad news, resulting in stock price movements that do not correspond with the companys long-term fundamentals. The result is an opportunity for value investors to profit by buying when the price is deflated. View as Pop-Out A comprehensive view of the investments in your account. Volatility The extent to which the price of a security or commodity, or the level of a market, interest rate or currency, changes over time. High volatility implies rapid and large upward and downward movements over a relatively short period of time low volatility implies much smaller and less frequent changes in value. The amount of trading sustained in a security or in the entire market during a given period. Especially heavy volume may indicate that important news has just been announced or is expected. W Back to top The W-8BEN form is provided by the United States Internal Revenue Service (IRS), and its purpose is to allow non-US persons to receive a reduced rate of taxation on any US-sourced income. For the purposes of share-dealing, US-sourced income refers to income (dividends, interest etc) received from businesses registered or incorporated within the US. If you require a W-8BEN form or a replacement W-8BEN form, please contact us and we will issue you one, alternatively you can download the form here. For an example of how to complete the W-8BEN please see here. A certificate, usually issued along with a bond or preferred stock, entitling the holder to buy a specific amount of securities at a specific price at some point in the future. The set price is usually higher than the price of the security at the time the warrant is issued. In the case that the price of the security rises to above that of the warrants exercise price, then the investor can buy the security at the warrants exercise price and resell it for a profit. Otherwise, the warrant will simply expire or remain unused. Warrants are listed on options exchanges and trade independently of the security with which they are issued. The percentage of the investment applied to your basket of funds. X Back to top Charles Stanley Direct is a trading name of Charles Stanley amp Co. Limited. Registered in England No 1903304. Registered Office: 55 Bishopsgate, London EC2N 3AS. Authorised and regulated by the Financial Conduct Authority (No. 124412). Member of the London Stock Exchange. Prices, News and Fundamentals provided by Thomson Reuters. Investors should be aware that past performance is not a reliable indicator of future results and that the price of shares and other investments, and the income derived from them, may fall as well as rise and the amount realised may be less than the original sum invested. Capital at risk. Income derived may fall or rise and you may get back less than invested.
No comments:
Post a Comment