I am asking this question completely out of curiosity. The other day, my roommate, by mistake, used 'Light year' as a unit of time instead of distance. When I corrected him (pedantic, much), he said the following:

"Units are relative. And according to Fourier Transforms, units can be changed so Light year is a unit of time."

That got me thinking and I read up Fourier Transforms on wikipedia but couldn't find anything about using a unit in one domain as a unit for another measurement. I do agree that units (particularly, base units are relative. eg: the meter), but does his statement make any sense?

EDIT
Thank you everyone for all the answers. It isn't so much to in it in or prove a point as it is to understand the concept better. Anyways this is his response after I showed him this thread. Any comments would be appreciated.

His response:
Nevermind, for the first time I accept I was wrong. BUT using lightyears to measure time is possible. My example didn't make sense bacause I was wrong when I meantioned that I'm still measuring dist. If you have a signal in time domain and ...take the FT, I get a signal which DOES NOT HAVE to be in frequency domain. Clarify this to the guy who posted last. Now the new signal is in a domain defined by me and so is its units. This signal although not equal to the original signal, still represents that if ya take an inverse FT. So, the idea of time will still be there. Now coming back to our case: lightyears here is not the lightyears you are used to read when dealing with distance. It represents time.


Question: MS SQL Stored Procedure for counting Dynamic table items
Answer: In SQL Server, if you want to get a result into a variable, you have two choices.

The first is to use cursors.

The second is to do dynamic SQL:

declare @sql varchar(max) = whatever;
declare @cnt int;

declare @cntTable table as (cnt int);

insert into @cntTable
    exec(@sql);

select @cnt = t.cnt
from @cntTable


It is cumbersome, but one or the other does work.