Journal of Object Technology (JOT)
Journal of Object Technology (JOT) Hmmmm .. looks very interesting.
Journal of Object Technology (JOT) Hmmmm .. looks very interesting.
HP warns over printer hacking risk
Brilliant .. a round of applause, please, for the ingenuity shown by some techies out there.
Amazing.
It runs now but very flakey!
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_CreateDataLoadScript]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[usp_CreateDataLoadScript]
GO
CREATE Procedure [dbo].usp_CreateDataLoadScript @TblName varchar(128) as
/*
exec sp_CreateDataLoadScript 'MyTable'
History
=======
22/08/2006 DR Amended to fix uniqueidentifier bug (there will be many others)
*/
create table #a (id int identity (1,1), ColType int, ColName varchar(128))
insert #a (ColType, ColName)
select case
when DATA_TYPE like '%char%' then 1
when DATA_TYPE like '%unique%' then 2
else 0 end ,
COLUMN_NAME
from information_schema.columns
where TABLE_NAME = 'CallResponseStatus' --@TblName
order by ORDINAL_POSITION
if not exists (select * from #a)
begin
raiserror('No columns found for table %s', 16,-1, @TblName)
return
end
declare @id int ,
@maxid int ,
@cmd1 varchar(7000) ,
@cmd2 varchar(7000)
select @id = 0 ,
@maxid = max(id)
from #a
select @cmd1 = 'select '' insert ' + @TblName + ' ( '
select @cmd2 = ' + '' VALUES ('' + '
while @id < @maxid
begin
select @id = min(id) from #a where id > @id
select @cmd1 = @cmd1 + '[' + ColName + '],'
from #a
where id = @id
select @cmd2 = @cmd2
+ ' case when ' + ColName + ' is null '
+ ' then ''null'' '
+ ' else '
+ case
when ColType = 1 then ''''''''' + ' + ColName + ' + '''''''''
when ColType = 2 then ''''''''' + ' + 'convert(varchar(100),' + ColName + ')' + ' + '''''''''
else 'convert(varchar(100),' + ColName + ')'
end
+ ' end + '','' + '
from #a
where id = @id
end
select @cmd1 = left(@cmd1,len(@cmd1)-1) + ' ) '' '
select @cmd2 = left(@cmd2,len(@cmd2)-8) + '+ '')'' from ' + @tblName
select '/*' + @cmd1 + @cmd2 + '*/'
exec (@cmd1 + @cmd2)
drop table #a
GO
Windows Mobile Tool Support Matrix The whole area of which Windows Mobile OS is running on what hardware, with which .NET framework and using god only knows which Development environment to target it is bloody nightmare. So here’s a link to a simple chart that helps clear the confusion on the Visual Studio version front.
Powered by WordPress