CREATE PROC dbo.InsertBlob @id int , @path varchar(255) AS DECLARE @sql nvarchar(MAX) CREATE TABLE #BlobData(BlobData varbinary(max)) --insert blob into temp table SET @sql = N' INSERT INTO #BlobData SELECT BlobData.* FROM OPENROWSET (BULK ''' + @path + ''', SINGLE_BLOB) BlobData' EXEC sp_executesql @sql --update main table with blob data UPDATE dbo.SOME_TABLE SET SOME_BLOB_FIELD = (SELECT BlobData FROM #BlobData) WHERE SOME_TABLE_ID = @id DROP TABLE #BlobData GOI found it here and I am happy I can finally stop using textcopy.exe tool.
2007/03/28
HOWTO Inserting a file into image column using only Transact-SQL (SQL Server 2005)
HOWTO Getting 16x16 icons for file types
1. Download this sample.
2. Put a button and a textbox on the form.
3. Use a snippet similar to:
2. Put a button and a textbox on the form.
3. Use a snippet similar to:
Dim types As String() = txtFileTypes.Text.Split(",") For i As Integer = 0 To types.GetLength(0) - 1 Dim im As Image = _ Me.FileSystemImages.SmallImageList.Images( _ FileSystemImages.GetTheFileIconIndex("*." & types(i))) im.Save(Application.StartupPath & "\" & types(i) & ".bmp", _ Imaging.ImageFormat.Bmp) Nextand you have a tool that allows you to retrieve 16x16 icons for different file types.
2007/03/19
Skype may prevent Outlook from closing properly
If you use Skype with the View / View Outlook Contacts option checked, Outlook does not close properly after you hit Alt+F4 or click the Close button. It disappears from the taskbar, but the OUTLOOK.EXE process continues to run and the Outlook icon stays in the system tray.
I think this is because Skype holds some kind of lock on Outlook's address book, but that's only my guess.
Here you can find some other applications that cause similar behaviour.
I think this is because Skype holds some kind of lock on Outlook's address book, but that's only my guess.
Here you can find some other applications that cause similar behaviour.
2007/03/06
A job step seems to hang when executing a console application
An application executed in an Operating System (CmdExec) job step has to be a console application and it cannot ask for any user input.
Even a simple Press any key to continue..., used (when the application is executed by a user, not SQL Server Agent) to prevent the command prompt window from closing before the user can see the results, will keep such a job running forever.
Even a simple Press any key to continue..., used (when the application is executed by a user, not SQL Server Agent) to prevent the command prompt window from closing before the user can see the results, will keep such a job running forever.
2007/03/02
Clipboard stops working while using remote desktop connection
If the clipboard suddenly stops functioning, when you are connected to a terminal server or other remote computer, you can try to do the following:
1. open Task Manager on the remote machine and kill the rdpclip.exe process;
2. start the rdpclip.exe application again (you can find it in c:\WINDOWS\system32\).
1. open Task Manager on the remote machine and kill the rdpclip.exe process;
2. start the rdpclip.exe application again (you can find it in c:\WINDOWS\system32\).
2007/02/10
Working with multiple terminal sessions simultaneously
If you often work with many terminal sessions opened in the same time, you should try Terminals.
My two favourite features of Terminals are:
My two favourite features of Terminals are:
- the tabbed view of the sessions that helps to unclutter the taskbar,
- the ability to create Favorites (session definitions) so I no longer need to have to store that information in separate files.
Reading mail from root@localhost.localdomain using Thunderbird (a quick note)
1. Create a Unix Mailspool (Movemail) account.
2. Run the following command:
sudo chmod 777 /var/spool/mail
2. Run the following command:
sudo chmod 777 /var/spool/mail
2007/01/27
VMware, Ubuntu 6.10 & USB flash drives
Before Ubuntu 6.10, I had no problems to access USB flash drives from Windows running under VMware (guest system) with Ubuntu as a host system.
And then Ubuntu 6.10 came and the problems came, too. Sometimes, when I plugged the drive, Windows detected it and I could access the data on it (rarely) and sometimes Windows didn't detect it at all or did detect it but there was no access to the data (usually). And I could see no pattern in this behaviour.
After a few months I finally found this article 3862823 in the VMTN Knowledge Base - USB Devices Are Not Available on Some Linux hosts, the VM > Removable Devices > USB Devices Menu Is Empty.
Adding the following line:
usbfs /proc/bus/usb usbfs auto 0 0
to the /etc/fstab file solved the problem.
And then Ubuntu 6.10 came and the problems came, too. Sometimes, when I plugged the drive, Windows detected it and I could access the data on it (rarely) and sometimes Windows didn't detect it at all or did detect it but there was no access to the data (usually). And I could see no pattern in this behaviour.
After a few months I finally found this article 3862823 in the VMTN Knowledge Base - USB Devices Are Not Available on Some Linux hosts, the VM > Removable Devices > USB Devices Menu Is Empty.
Adding the following line:
usbfs /proc/bus/usb usbfs auto 0 0
to the /etc/fstab file solved the problem.
2007/01/25
HOWTO: Edit properties of DataGrid columns (.NET 1.1)
Installing Ubuntu on ASUS A6RP-AP069 notebook (part 3 - WPA)
I don't know why, but WPA doesn't work on Ubuntu out-of-the-box. WEP does and we were using it for some time, but recently we finally decided to switch to WPA.
First we found these instructions, but for some reason they didn't work for us. And even if they did, this method is way too complicated.
After some further searching, we found this post. Really simple and it works! Although, after having followed the steps 1, 2 and 3 listed there, we also had to reboot the machine and add ifup eth1 to /etc/init.d/bootmisc.sh file.
First we found these instructions, but for some reason they didn't work for us. And even if they did, this method is way too complicated.
After some further searching, we found this post. Really simple and it works! Although, after having followed the steps 1, 2 and 3 listed there, we also had to reboot the machine and add ifup eth1 to /etc/init.d/bootmisc.sh file.
Subscribe to:
Posts (Atom)
