UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Mark Start And End Block, Office 2013    
 
   
WildBird
post Jan 5 2020, 11:15 PM
Post#1


UtterAccess VIP
Posts: 3,724
Joined: 19-August 03
From: Auckland, Little Australia


Hi,

We are doing some documenting stuff on a SQL Server database - I know it would be good to have a OTS system, but we dont and have to roll our own.

Anyway, I have all the text from the stored procedures in Excel. Column A has stored pro name, and B has the text.

What I want to do is be able to search for a particular string (such as a table name) and highlight any lines that this may appear in.

Easy enough to do an instr (or match whatever the formula is in Excel), the issue is I dont want commented out lines. SQL Server can be commented out a few ways, '--' or a block '/*......*/'

I have code that will search a cell for a string, and if it isnt commented out, then return a 1.

What I am looking at is how to mark the start of a comment block ('/*), then end ('*/') and the ones in between.

CODE
SET QUOTED_IDENTIFIER ON
GO
/********************************************************************************
****************
Object:      Procedure PaymentStuff
Description: This procedure returns the Payment Stuff for a given period selected
Created By:  Thaddeus Venture and Brock Sampson
Created On:  4/10/2019
History:     Initial Release
********************************************************************************
****************/
CREATE PROCEDURE [PaymentStuff]


For this, the first 2 lines would be blank, as well as the last, but the lines in between I would want to be marked.

I can use helper columns, so can get if it starts with '/*' return a 1 in column c. Column D if it ends in '*/', return a 1, so C3 = 1, D9 = 1, everything else blank or 0. I need a way to have E3:E9 showing 1.

Hopefully this makes sense. First day back at work, I could barely remember what floor I worked on, couldnt remember my username, nor my password...

Hope everyone else had great holidays and back working competently now :-)



--------------------
Beer, natures brain defragging tool.
Go to the top of the page
 

Posts in this topic



Custom Search


RSSSearch   Top   Lo-Fi    10th April 2020 - 12:38 PM