Agree. I'm holding each result set in a cte or temp table, then trigger an email subscription to send the data. Each result set goes to a different distro list. It is because of this that I need to split the table variable data.
OK, so if you are going to use database mail to send the emails, it starts to make a little more sense. I say a little more, because I'm not really a fan of that solution. There are also some challenges, since you cannot use the @query parameter to read from the table variable. But you could form a body from it.
You would set up a cursor like this:
DECLARE @cur CURSOR,
@country nvarchar(50),
@state nvarchar(50)
SET @cur = CURSOR STATIC LOCAL FOR
SELECT DISTINCT conutry, state FROM @tablevariable
OPEN @cur
WHILE 1 = 1
BEGIN
FETCH @cur INTO @country, @state
IF @@fetch_status <> 0
BREAK
-- Run some query on the table variable to form a body of the mail.
-- Also retrieve the recipent(s) for this state.
EXEC sp_send_dbamil ....
END
If this email subscription is client-side, I still think it is best to split this in the client.