Browsing the archives for the T-SQL category

SQL Server PBM: On Schedule Failures

I tend to like the automation and convenience of using Policy Based Management (PBM) to check simple things like my backups have been running, there’s enough disk space on my servers, and the consistency of my configurations (min/max server memory, ad hoc workloads, etc.). While it is easy to build and test policies by executing […]


The report server installation is not initialized. (rsReportServerNotActivated)

I recently ported an SSRS instance to a freshly minted virtual machine. As usual I went through the normal SSRS configurations and everything looked happy. As part of the process I restored the reporting services databases to the new SSRS database instance. Apparently I didn’t follow my own instructions Migrate SSRS from SQL Server 2008R2 […]


Migrate SSRS from SQL Server 2008R2 to 2014

I recently had a requirement to migrate a SQL Server instance from 2008R2 to 2014.  The core SQL Server functionality, the engine is always the easy part for me.  I don’t do much with SSRS, so moving the reporting services component was the big unknown. So let me share with you my biggest take away […]


Table Info for Clustered Column Store Indexes

I’ve used a variation of this query for years and it worked pretty well, until clustered column store indexes came along. The general problem is that the column store indexes store the storage in LOB records, although data records are also included.  This resulted in the tables with column store clustered indexes having twice the […]


Identifying Netezza Backupsets

This is more a note to self than anything… Each week we run FULL backups against our databases, and write the backup files to disk.  In the past we kept the most current backup on disk for a week, and deleted it after the backups have been saved to tape. Then we start the cycle […]


Bug in sys.fn_hadr_backup_is_preferred_replica

While testing backups in SQL Server 2014 Availability Groups I hit a bug in a system function that is used to determine which replica is the most appropriate to be backed up. You can set the desired backup pattern by RIGHT clicking on the availability group to bring up the properties:     I’ve decided […]


View to get DB Size

The DBCC SQLPERF(logspace) is a handy routine to check the transaction log sizes.  But it does have some limitations: The log file size is in KB.  All of our databases are in GB, so I end up unconsciously converting the KB output into GB. Saving the data to a table is not convenient. It provides […]


Netezza: Restore a table from an INCREMENTAL Backup

Netezza supports 2 types of backups: FULL INCREMENTAL CUMULATIVE – All changes since the last FULL backup DIFFERENTIAL – All changes since the last FULL or CUMMULATIVE The first step to restore a single table is to see what backups we have.  Note: That NZ calls the FULL backup Increment #1. Determine what incremental backups […]


Filtered Indexes and CONCAT_NULL_YIELDS_NULL

Another lesson learned at the school of hard knocks… I recently deployed a filtered index to a table that had a FLAG column.  I showed without a doubt in the test environment that this filtered index would be used by production queries at a much lower cost than without the index. What I didn’t know […]


Change Default Backup Location on SQL Server

This is just a quick post of a task that seldom needs to happen… Changing the default location of the backup directory. There is no way to change this setting in SSMS… The quickest way is to use an extended stored procedure. [sourcecode language='sql' padlinenumbers='true'] DECLARE @BackupDirectory VARCHAR(100) EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE', @key='SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQLServer', @value_name='BackupDirectory', […]


LiteSpeed Restore from Remote Share v8.0

In versions of LiteSpeed for SQL Server prior to 8.0 I’ve always been able to restore backups from remote shares by cutting/pasting the remote share path (\\serverName\driveLetter$\backups).  In fact, the remote shares are not always actual shares.  If they were LiteSpeed would pick them up in the “browser”.  Often times they are just unshared paths […]


Color code SSMS status bar

I work with all kinds of SQL Server instances.  All of them are one of three possible types: Development Test Production Many of my scripts have a quick query at the top to get the server name (@@servername).  I use this to double check the server instance I’m on.  More specifically, I use this to […]


Using EVENT NOTIFCATION to ALERT on user query CPU usage

We often have customers running ad hoc queries on the databases that we host.  Most of the time the queries run fine… sometimes they don’t. The first step we took towards managing rogue queries was to deploy Resource Governor (only available in Enterprise or Developer editions) to limit their MAXDOP.  In general, a rule of […]


Return First and Last Day of Previous Month

I had a colleague approach me today with a production issue.  The base challenge was to produce a query that will return the first and last day of the previous month.  When I reviewed the query that he provided (ie., the one that was in the production code) I quickly determined that it was too […]


Size Matters: Keep Model Small

I recently discovered an undesirable behavior of SQL Server on a brand new SQL 2008R2SP2 cluster.  If the cluster failed over once it was fine.  If it was immediately failed back to the original node, it would hang when taking SQL Agent offline. The cluster had two physical nodes (01P and 02P) and three (3) […]


Mounting a TV in Fireplace

About a month ago I completed a home project that involved mounting my 40 inch flat screen TV “in” my existing gas log fireplace.  In order to convince my skeptical wife that the project would look nice I had to have a rollback plan that included restoring the fireplace to it’s original working condition.  That […]


10 Tips to Optimize Data Warehouse Reporting

Unless your marketing data warehouse is stored in a massively parallel appliance such as Netezza, your data most likely resides on a Symmetric Multi-Processing (SMP) computer in a relational database engine, such as Microsoft SQL Server. SQL Server is a highly scalable, versatile database product that can serve the needs of a wide range of […]


How to List Size of Tables

Even though disk space is cheap it continues to the be the first resource to run out on a server.  And once it runs out it’s a constant battle to keep the database size in check. For sure there are things that can be done to keep database growth in control: Archive.  I’ve seen databases […]


Size of Filegroups and Files

In recent posts I looked at queries that show us data at the instance, the database, backups and now we will look at filegroups and the individual physical files. Too many times disk space is not an issue, it is THE issue.  This query will show several key attributes of our database at the file […]

Database Backup Snapshot

  Every Monday morning I always make it a point to run some basic checks on our production database servers.  Yes, there are alerts… but sometimes those alerts get over looked, don’t get delivered, etc.  I like to know implicitly that we are in decent shape… In previous posts I showed how to look at […]

sociology essay writer site custom argumentative essay writers website online homeric hero definition custom scholarship essay ghostwriters for hire for mba custom cheap essay ghostwriters website for phd custom critical analysis essay editing for hire for masters popular personal essay editor website for mba rotc essay custom report writing services for masters cheap curriculum vitae writer website ca best dissertation proposal ghostwriting websites best dissertation proposal writer services for university professional course work writers service for mba democracy is messy professional college essay writing for hire us custom speech editor services for phd best research proposal ghostwriting services popular critical thinking proofreading sites au popular blog proofreading services ca esl dissertation methodology writers website for school buy government cv professional content writers website gb professional bibliography ghostwriter website uk cheap school dissertation results example cheap best essay ghostwriter websites for mba summary of the yellow wallpaper best phd scholarship essay examples cheap cover letter ghostwriters website usa esl dissertation results editor for hire for phd cheap school essay ghostwriting website uk through the tunnel analysis setting of the raven cheap paper ghostwriting sites us cheap masters critical analysis essay sample esl assignment ghostwriter sites for mba best resume ghostwriter sites uk top homework ghostwriter sites au pay to write statistics term paper the goldfish matisse top essay writers website usa help me write calculus essay help me write philosophy thesis statement custom curriculum vitae writing sites for phd professional personal statement ghostwriters sites online admission paper ghostwriting website ca esl persuasive essay writing websites usa esl cheap essay editing site usa cheap dissertation writer site for school bibliography editor service uk cheap persuasive essay editor website us best home work writers service uk professional custom essay writers websites usa cheap personal essay writer website ca cultural relativism essay professional papers writers website ca help writing speech resume pay to do top creative essay pay to do best academic essay on presidential elections popular custom essay on pokemon go help me write physics argumentative essay dissertation hypothesis editing website gb pay for my life science dissertation results cheap thesis proposal ghostwriters services for mba popular academic essay writer website gb order custom rhetorical analysis essay on trump custom college annotated bibliography samples best blog writers website au esl university argumentative essay ideas popular report proofreading website au popular article ghostwriting services professional papers writing for hire usa popular critical thinking ghostwriter sites for college type my investments papers cheap dissertation conclusion ghostwriter site uk professional bibliography writing for hire for masters popular admission paper ghostwriters website for phd pay to get sociology presentation esl dissertation hypothesis editor websites for university top school custom essay help top problem solving editing for hire for college help with my university essay on trump argumentative proofreading website online cheap school movie review help expository ghostwriter for hire online help me write geography thesis top letter writer for hire us best article review ghostwriter for hire for phd curriculum vitae writing websites usa best admission essay editor for hire for mba help with esl presentation online professional essay editor for hire online professional phd essay writers service uk write professional university essay on hillary clinton admission essay ghostwriting service uk buy argumentative essay on hillary clinton professional dissertation introduction ghostwriters sites for college pay for my biology movie review creative essay writing websites online write my popular rhetorical analysis essay on shakespeare professional school thesis proposal topics esl blog proofreading service for mba top speech proofreading website uk professional cv editing sites au help me write finance literature review esl annotated bibliography editor sites gb esl biography ghostwriting for hire ca do my life science case study custom content writers website custom thesis statement writers service for masters masters essay proofreading sites ca cheap cv ghostwriting site esl masters essay proofreading service au popular expository essay ghostwriter for hire uk custom critical essay ghostwriter service for university custom definition essay ghostwriting for hire for masters cheap dissertation conclusion editing website esl editor websites au best content editing websites for masters write professional expository essay on donald trump esl paper writer services for university popular letter ghostwriting service for mba ethan brand sparknotes top definition essay writing sites for phd coca cola human resources esl college persuasive essay help best admission essay writer websites us rhetorical analysis writing services ca professional best essay ghostwriter sites au esl definition essay ghostwriter websites usa pay to do popular personal essay on hacking best movie review editing sites online top dissertation methodology editor for hire online fake myths popular problem solving editing services for college esl dissertation hypothesis ghostwriting for hire for university esl dissertation results ghostwriter for hire help with my social studies thesis proposal help me write creative essay custom annotated bibliography ghostwriting for hire for school cheap critical essay editor for hire for masters cheap dissertation proposal ghostwriter sites for university pay for popular best essay on hillary best analysis essay writers websites for mba popular college essay ghostwriting website usa cheap assignment editing sites for college write my custom essay online cheap creative writing writing sites usa professional college essay editing website reflective essay on law custom thesis editor site for college best mba essay editor for hire gb custom critical analysis essay writer sites gb popular cheap essay writing websites for phd pay to write leadership blog post professional definition essay ghostwriters service for mba professional case study editing services online best dissertation chapter ghostwriting site for mba custom university essay writer for hire gb popular thesis statement proofreading services for mba custom admission essay proofreading site for university popular bibliography proofreading websites esl argumentative essay editor website us write my top reflective essay cheap persuasive essay writers for hire for university custom problem solving writer sites for school cheap application letter ghostwriters service for mba woolf a haunted house top scholarship essay ghostwriting services for university esl critical essay editing service ca best term paper proofreading services for masters what is pygmalion about pay to write nursing thesis help me write esl best essay on hillary top blog post ghostwriters websites pay for my top personal essay on usa okonkwo tragic flaw esl academic essay editing site ca write my professional reflective essay online esl case study writing service for school post lintel custom personal statement proofreading services ca top book review ghostwriter services online professional research proposal proofreading sites for college write my cheap expository essay on hillary pay to do report esl presentation ghostwriter websites for school professional argumentative essay editing website for masters professional definition essay writing for hire gb best application letter writing services for masters top dissertation results writing for hire au is beowulf the ideal epic hero esl persuasive essay writer for hire online do my esl college essay on hillary clinton top resume writers website for college esl movie review ghostwriters websites online top expository essay editor service online esl thesis statement ghostwriter services for phd admission paper editing website uk professional dissertation chapter writing site uk professional definition essay ghostwriting service online popular best essay writers sites for mba esl dissertation introduction ghostwriting service for mba do my literature thesis write my cheap definition essay on hillary clinton custom report proofreading for hire usa popular custom essay ghostwriters site us case study ghostwriter service pay to write top dissertation conclusion top masters essay writing for hire us government ghostwriter sites professional dissertation introduction writers websites au esl problem solving ghostwriter sites usa popular college thesis statement ideas custom college article samples popular best essay writer site us best best essay editor for hire for college what makes a house a home essay top thesis proposal ghostwriters for hire gb custom university essay writers site for college write my biology dissertation abstract write ecology letter popular movie review writing website for mba pay to do professional article review custom admission paper writer for hire for school order professional argumentative essay on hillary professional content ghostwriters service for mba write world affairs research proposal professional case study proofreading services for university esl curriculum vitae editing site for phd popular term paper writer site au cheap papers ghostwriting sites gb dissertation methodology ghostwriting services us esl critical essay editing websites online custom critical essay ghostwriter services for mba popular biography writers websites usa custom report proofreading service us example of subculture write my music thesis statement custom expository essay writer services us three types of friendship according to aristotle professional cv editing websites for mba top resume proofreading services us order poetry resume help me write custom blog post online best papers editor service for phd best dissertation editor for hire for college top literature review editor websites us curriculum vitae writers for hire uk cheap definition essay writers services for college popular assignment writers for hire au write my finance literature review esl dissertation abstract proofreading for hire for college buy biology dissertation methodology help with custom dissertation hypothesis pay for my shakespeare studies dissertation conclusion pay to write custom dissertation proposal online custom best essay ghostwriting sites for masters popular biography writers websites for school best research proposal proofreading sites for masters popular college essay ghostwriters website for masters best scholarship essay ghostwriter website us do my custom research paper pay for custom college essay on pokemon go professional editor site uk cheap custom essay ghostwriters for hire gb top dissertation methodology writers websites usa pay for custom persuasive essay on pokemon go cheap term paper editor site uk cheap critical analysis essay writing for hire for mba literature review proofreading services au essay ghostwriters site ca analysis ghostwriter services gb top admission paper ghostwriters sites for mba cheap dissertation ghostwriters websites us best persuasive essay ghostwriters websites for university best assignment ghostwriters sites for college custom editor website for phd order best critical analysis essay custom reflective essay writing sites for masters custom school letter assistance descriptive essay ghostwriter sites au custom dissertation proposal writing sites pay for esl college essay on usa cheap essay ghostwriting site popular home work ghostwriting website for masters pollution problem best critical thinking editor sites uk argumentative ghostwriting website us help with engineering thesis proposal professional blog proofreading service for phd do my cheap argumentative essay on donald trump top literature review editor sites us best rhetorical analysis essay ghostwriters services us order management cv popular admission essay ghostwriting sites us pay to do academic essay write cheap definition essay on presidential elections professional cv writers website for college custom mba essay editing websites us popular resume ghostwriter websites for mba top article review ghostwriting services us esl school essay ghostwriter websites cheap cheap essay writers services for college critical analysis essay editor website online best best essay writers service for college popular creative writing editing for hire esl custom essay writing service for phd popular critical essay editor site uk pay to write geometry movie review popular definition essay proofreading sites for mba top descriptive essay ghostwriter sites for mba cheap thesis proposal writer sites online best blog post ghostwriters service esl critical thinking editing services usa best annotated bibliography editing service us pay to get biology letter help writing geometry assignment cheap masters essay writers service for college bullet that killed lincoln write papers custom content writers website us custom content ghostwriters sites cheap critical thinking editor site uk top homework ghostwriting for hire for college custom assignment ghostwriter service us popular blog post editor service for mba type my communication article cheap literature review writing for hire au top personal statement editor service ca custom thesis proposal proofreading services for phd professional curriculum vitae writers for hire for mba guitar player painting cheap content editor site for mba custom dissertation hypothesis ghostwriter site for college esl annotated bibliography editor sites for masters custom custom essay writer for hire for school top cover letter writers sites ca best homework editor websites gb help me write engineering thesis pay to get physics problem solving best letter writing service us buy human resource management blog post custom term paper writer service for mba academic essay editing website au top essay writing service popular speech ghostwriting for hire uk 8th grade book report best dissertation introduction writer website for school book review writing websites us esl dissertation introduction ghostwriters site for university cheap masters essay writing site for masters best research paper proofreading sites custom critical analysis essay writers site usa top critical thinking ghostwriter service gb academic proofreading websites online cheap application letter writers service for university essay about teamwork popular dissertation methodology writers services usa best curriculum vitae editing services for school help me write zoology blog professional writing service for school esl letter writers for hire for school cheap phd dissertation abstract examples professional masters movie review help custom phd personal statement example best masters definition essay examples professional book review editor services for phd dissertation methodology proofreading websites au help with my custom admission essay on trump chemistry essay writer websites help me write social studies thesis cheap dissertation hypothesis ghostwriting services ca cheap critical essay writing services for university popular critical essay editor websites for college cheap dissertation abstract editing services gb top dissertation chapter ghostwriters for hire for mba esl rhetorical analysis essay ghostwriter sites gb esl college resume sample custom best essay ghostwriter for hire online best assignment editing service ca cheap blog writing website usa write my earth science papers top dissertation proposal ghostwriters sites for college custom dissertation abstract editing for hire for phd essays ghostwriter best college rhetorical analysis essay topics esl curriculum vitae ghostwriter for hire online professional scholarship essay writing services gb popular resume proofreading service for school custom dissertation methodology writers services for mba help with my tourism homework custom admission paper ghostwriting sites gb cheap university paper assistance academic editor websites top masters reflective essay ideas custom personal essay writers service professional college cheap essay ideas reflective essay editor service online bibliography editor professional cv writing sites au custom content writing for hire gb popular best essay proofreading site for phd popular research paper writing for hire gb top home work editor website for school dissertation hypothesis writer websites online liberalism socialism religion vs philosophy college editing websites ca dorian gray summary best persuasive essay writers services for university home work writer website au esl school essay writers site for mba professional school essay on lincoln popular business plan writer site ca pay for religious studies homework custom essay proofreading site for university professional definition essay editor sites for phd popular curriculum vitae ghostwriters websites online cheap thesis statement writer websites au popular course work ghostwriter for hire for college write my best creative essay on founding fathers best annotated bibliography ghostwriter website for college best business plan writer for hire for mba custom research paper ghostwriting service uk help with ecology research proposal popular critical thinking writing service au top rhetorical analysis essay ghostwriters for hire us popular school movie review examples casein plastic history professional phd research proposal example esl essays writing websites ca type my esl persuasive essay on donald trump realism in the awakening custom college essay writer site for college help me write social studies dissertation results custom movie review ghostwriting website for school university essay ghostwriters services uk esl dissertation introduction editor websites for school cheap mba descriptive essay help custom school essay writers sites ca help writing top admission essay on hillary top blog ghostwriting websites for college beowulf hrothgar custom persuasive essay writers service online cheap creative writing editing sites for masters top dissertation methodology ghostwriter service au help with my top personal essay on brexit popular cheap essay ghostwriter services ca custom papers ghostwriting website for school professional speech writers service online best creative essay ghostwriter services online custom cover letter ghostwriter sites usa top home work editor for hire gb write my philosophy movie review pay to get cheap university essay on pokemon go top admission paper ghostwriter websites ca professional thesis writers website us esl papers editing websites usa best college term paper samples custom argumentative essay ghostwriter for hire for university custom phd assignment example cheap biography writers sites for college professional thesis statement ghostwriter website for college write me economics homework esl papers writers websites usa popular custom essay editor website for school popular dissertation methodology editor websites usa cheap literature review writers website us professional analysis essay ghostwriting services for mba esl ghostwriter service usa top research paper ghostwriter websites ca resume editor services usa custom application letter writer websites us do my education thesis proposal type my english dissertation abstract dissertation abstract editing for hire us top college annotated bibliography topic report ghostwriters site online best content writing site online essay on utilitarianism esl blog proofreading site top blog post ghostwriters service us esl assignment ghostwriters for hire us professional dissertation introduction proofreading site for school top masters presentation cheap persuasive essay editor sites chemistry ghostwriter services help with my esl cheap essay on presidential elections type my psychology article cystic fibrosis research paper phd ghostwriter websites gb esl essays proofreading websites for masters top university essay ghostwriting websites gb professional personal essay ghostwriting sites for university professional bibliography ghostwriter websites for mba popular personal statement writing websites for phd what ended feudalism in europe best book review proofreading service best rhetorical analysis essay writers for hire for school pay to write calculus dissertation results