x002548's Blog

Not Just a Number - Brett Kaiser
posts - 89, comments - 586, trackbacks - 39

March 2004 Blog Posts

Mille Bournes

From a SQLTeam freind, Thanks Duane http://www.sqlteam.com/forums/pop_profile.asp?mode=display&id=9857 QA Needs to be set to text mode and font courier SET NOCOUNT ON DECLARE @InpString VARCHAR(4000)DECLARE @CharCT INTDECLARE @PrevY INTDECLARE @CurrX INTDECLARE @CurrY INTDECLARE @InpRow VARCHAR(4000)DECLARE @RowCT INT SET @RowCT = 1SET @InpString = '04040404080409041004110415041604170418042204230424042504' SET @InpString = @InpString + '030503050405070512051405190521052605'SET @InpString = @InpString + '030603060406070612061406190621062606'SET @InpString = @InpString + '020702070407070712071407190721072607'SET @InpString = @InpString + '020802080408070812081408190821082608'SET @InpString = @InpString + '010901090409070912091409190921092609'SET @InpString = @InpString + '011001100410071012101410191021102610'SET @InpString = @InpString + '0011001101110211031104110511071112111411191121112611'SET @InpString = @InpString + '04120412071212121412191221122612'SET @InpString = @InpString + '04130413081309131013111315131613171318132213231324132513' CREATE TABLE #Stuff(X INT, Y INT)CREATE TABLE #BK(BID INT, B VARCHAR(4000)) SET @CharCT = 1 WHILE @CharCT < LEN(@InpString)BEGININSERT...

posted @ Wednesday, March 24, 2004 3:47 PM | Feedback (0) | Filed Under [ Disconnected Ramblings ]

Sanitize input files

I had a devil of a time with the spawned thread blocking from xp_cmdshell and doing bcp's....   Sometime it would work, other times not... The sproc is treated as 1 logical unit of work...for example there is no problem in just rerunning it if it fails...   Even though I've got 4 transactions...   Any comment appreciated...   Oh, and btw, it takes a file (8k or less wide) loads it, and modifies what you want to cheange, archives the old file, and spits out a sanitized one... SET NOCOUNT ON if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[wrk_DataHold]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[wrk_DataHold]GO CREATE TABLE wrk_DataHold(Col1...

posted @ Tuesday, March 23, 2004 9:02 AM | Feedback (0) | Filed Under [ SQL Server ]

Powered by:
Powered By Subtext Powered By ASP.NET