thebeebs | So you’ve hard coded VAT at 17.5% in SQL?
thebeebs
Zeroing the desk - Ignore the design
 
 

So you’ve hard coded VAT at 17.5% in SQL?

by thebeebs 24. November 2008 09:38

 

 

header_vat_return

Yikes!… Alistair Campbell has just announced VAT has been reduced from 17.5% to 15% in the UK. In SQL it’s often the case that values like VAT are often hard coded. To help you reduce the time it takes to search your database I wrote the SQL code below which should help you find any stored procedures that contain hard coding and any column names that contain VAT and may need checking.

I hope they are of some use to someone:

 

DECLARE @search NVARCHAR(10)DECLARE @Command NVARCHAR(MAX)
SET @search= '%0.175%'
SET @Command = 'SELECT [TEXT], [NAME], ''?'' as DatabaseName FROM ?.DBO.SYSCOMMENTS C JOIN ?.DBO.SYSOBJECTS O ON C.ID = O.ID WHERE TEXT like ''' + @search + ''''
EXEC sp_MsForEachDb @command1= @CommandSET @search= '%1.175%'
SET @Command = 'SELECT [TEXT], [NAME], ''?'' as DatabaseName FROM ?.DBO.SYSCOMMENTS C JOIN ?.DBO.SYSOBJECTS O ON C.ID = O.ID WHERE TEXT like ''' + @search + ''''
EXEC sp_MsForEachDb @command1= @Command
SET @search= '%VAT%'
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE @search

 

Tags:

Pingbacks and trackbacks (1)+

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading