SQL show me all tables that have data in them
DECLARE @table_name SYSNAME, @table_id INT, @column_name SYSNAME, @sql_string VARCHAR(2000) DECLARE tables_cur CURSOR FOR SELECT name, object_id FROM sys.objects WHERE type = 'U' OPEN tables_cur FETCH NEXT FROM tables_cur INTO @table_name, @table_id WHILE (@@FETCH_STATUS = 0) BEGIN SET @sql_string = 'declare @tablecount int select @tablecount = count(*) from ' + @table_name + ' if (@tablecount > 0) PRINT ''' + @table_name + ' -- '' + cast(@tablecount as varchar(10))' EXECUTE(@sql_string) FETCH NEXT FROM tables_cur INTO @table_name, @table_id END CLOSE tables_cur DEALLOCATE tables_cur
Linear Equation Solver
I wrote a program in Java which will calculate the solution to a bunch of linear equations.