I received an email today that asked how to run a SQL command against all company databases, so let's look at that technique
The request was to run this code:
USE
DATABASE
DECLARE
@O_iErrorState
int
, @I_dAgingDate datetime
select
@I_dAgingDate =
convert
(
varchar
(10), GetDate(), 102)
EXEC
dbo.rmAgeCustomer 0,
''
,
'þþþþþþþþþþþþþþþ'
, @I_dAgingDate, 127, 0, 0,
''
, @O_iErrorState
OUT
SELECT
@O_iErrorState