Showing posts with label download. Show all posts
Showing posts with label download. Show all posts

Friday, March 9, 2012

How to Download trial version

Hi Everybody,

Anybody know is there any place to download trial version of the Microsoft SQL

server 2000 Report service ?

Because i have already installed the sql server 2000 but in that CD i could find out

the Report service ! so how do i install the Report Service ?

do i have to buy the SQL Server report service 2000 separately ?

any idea ? its realy help me if i can download the trial software for practice my own

withing a small period !

regards

sujithf

Did you mean the 2005 version, if so, it comes with SQL Server 2005 and all you need to do is go to Control Panel, add/remove programs and select Add components from the setup wizard. Don't remember how it worked with 2000, but it may have been a separate download.

BTW, you want to get 2005, it has lots of improvements.

how to download the image or file from the [Blobcontent] as file in sql server 2005?

hi,

i plan to use the database mail to send the mail. i created stored procedure to send the mail to all receipents ,.

Table fields like, profile,Toaddress,Bcc,Ccc,Blbcontents ,filename..subj,msgbody ,etc...,

download the blb & attach with the mail for the particular recepent

.

so., is it possible to download the blobcontent using Query? or any Other function available in Sqlserver 2005?

In order to attach files to an email in Database Mail on SQL Server 2005, the files must be on disk. If you are storing files at blobs (VarBinary or image) in your SQL Server database, you must extract them to disk before attaching them to your mail.

Does that answer your question?

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/

|||

thanks Mr.Paul A. Mestemaker,

my question is, Is any system procedure available to download the blob-content in sql server 2005 database itself?

Please let me know ..

any way, myself found the solution, please let me know the procedure is correct

i wrote the clr integrated procedure using c# application

the below steps i have done

1. created the ExportBlob.dll file

2. Created assembly with ExportBlob.dll.

3. Created Procedure to call the Dll file with param.

4. Created ownProcedure to send mail

5. if you want to send mail as Automatically, create new job & set the schedule time to run in sql server agents.

this code is working fine.

Create assembly

==============

USE [master]

Go

/* register the assembly in a SQL Server database using the CREATE ASSEMBLY statement */

CREATE ASSEMBLY ExportBlob

FROM 'D:\Extended_Proc\sp_exportBlob.dll'

WITH PERMISSION_SET = EXTERNAL_ACCESS

GO

GO

/****** Object: StoredProcedure [dbo].[xp_ExportBlob]

CREATE PROCEDURE [dbo].[xp_ExportBlob]

@.ServerName [nvarchar](25),

@.UID [nvarchar](50),

@.Pwd [nvarchar](25),

@.DBName [nvarchar](25),

@.Tbname [nvarchar](50),

@.FldName [nvarchar](100),

@.cndt [nvarchar](max),

@.Exportpath [nvarchar](100)

WITH EXECUTE AS CALLER

AS

EXTERNAL NAME [ExportBlob].[sp_exportBlob].[exportBlob] //

mail send

=========

SET @.DBName=db_name() /* Get & Assign the Current Database Name*/

SET @.Server=@.@.servername

Select @.ListOfAttachFiles='', @.Delimiter=';'

/*Create a Local Dir to save the File*/

set @.ExtractPath='C:\SQLdbmail_attched_files\

DECLARE CursorMailList CURSOR FOR

SELECT [MailID],

[Profile],

left(Subject,255),

[importance],

[MsgTo],

[CopyTo],

[BCCTo],

[Contents],

isnull(HasAttachment,0)

FROM MailTb Where Processed=0 Order by MailID

OPEN CursorMailList

FETCH NEXT FROM CursorMailList INTO @.MailID,@.Profile,@.m_subject,@.m_importance,@.m_Toaddress,@.m_ccaddress,@.m_Bccaddress,@.m_body,@.HasAttachment

WHILE (@.@.FETCH_STATUS = 0)

BEGIN

Select @.ListOfAttachFiles=@.ListOfAttachFiles + @.ExtractPath+Filename+@.Delimiter from Attachments where MailID=@.MailID

SET @.ListOfAttachFiles=left(@.ListOfAttachFiles,len(@.ListOfAttachFiles)-1)

SET @.cndtn='where Datalength(Blobcontents)>0 and MailID='+ convert(VARCHAR,@.MailID,25)

select @.FldNames='Blobcontents,Filename'

/*Download File in the server Dir */

/*passing param to dll , param=servername,UID,PWD,DatabaseName,Tablename,Feildname,wherecndtn,extractDir */

EXEC master..xp_ExportBlob @.Server, 'sa', 'pass', @.DBName, 'Attachments', @.FldNames, @.cndtn, @.ExtractPath

/*Get Missing Attchment Files */

BEGIN TRY

EXECUTE msdb..sp_send_dbmail

@.profile_name = @.Profile

,@.recipients = @.m_Toaddress

,@.copy_recipients = @.m_ccaddress

,@.blind_copy_recipients = @.m_Bccaddress

,@.body = @.m_body

,@.subject = @.m_subject

,@.importance = @.m_importance

,@.file_attachments = @.ListOfAttachFiles /* Eg. D:\mailDownload\filename.ext;c D:\mailDownload\filename2.ext */

,@.mailitem_id = @.mailitemid output

Update MailTb set Processed=1 where MailID=@.MailID /*Update back Mail sent scessfully*/

END TRY /*TRY*/

BEGIN CATCH

SET @.err=1

set @.ErrMsg = @.ErrMsg +'Failed to send Mail with Attachments. SDS MailID ='+convert(varchar,@.MailId,25)

END CATCH /*Catch*/

END /*

FETCH NEXT FROM CursorMailList INTO @.MailID,@.Profile,@.m_subject,@.m_importance,@.m_Toaddress,@.m_ccaddress,@.m_Bccaddress,@.m_body,@.HasAttachment

END /*WHILE*/

-- clean up; close & Deallocate the cursor

CLOSE CursorMailList

DEALLOCATE CursorMailList

c# application {Create library}

====================

using System;

using System.Collections.Generic;

using System.Text;

using System.IO;

using System.Data.SqlClient;

using System.Data.Sql;

using Microsoft.SqlServer.Server;

using System.Data.SqlTypes;

public class sp_exportBlob

{

// Identify that this is a SQL Stored Procedure

[SqlProcedure]

//summary

//FldNames should be BlobContents and Filename with Extension using comma Sepearator.

// [i.e., Fldnames="Blobcontents,Filename+Extension" ]

//

public static void exportBlob(string ServerName, string UID, string Pwd, string DBName, string TbName, string Fldnames, string Cndt, string ExtractPath)

{

SqlConnection sqlconn = new SqlConnection();

SqlDataReader sqlDr;

SqlCommand cmd;

FileStream fs;

BinaryWriter bw;

int Blobsize;

long blob, startIndex;

byte[] outBuffer;

string ExtractFileName = "";

try

{

int IndexBlobContents = 0;

sqlconn.ConnectionString = "Server=" + ServerName + ";UID=" + UID + ";Pwd=" + Pwd + ";Database=" + DBName;

sqlconn.Open();

Blobsize = 1024;// Initalize the BlobSize

cmd = new SqlCommand("SELECT " + Fldnames + " FROM " + TbName + " " + Cndt, sqlconn);

sqlDr = cmd.ExecuteReader();

while (sqlDr.Read())

{

ExtractFileName = ExtractPath + sqlDr[1].ToString();//dirname + filename

startIndex = 0; // Reset the starting byte for the new BLOB.

outBuffer = new byte[Blobsize];

if (File.Exists(@.ExtractFileName))

{

File.Delete(@.ExtractFileName);

}

fs = new FileStream(@.ExtractFileName, FileMode.OpenOrCreate, FileAccess.Write); // Create a file to hold the output.

bw = new BinaryWriter(fs);

blob = sqlDr.GetBytes(IndexBlobContents, startIndex, outBuffer, 0, Blobsize); // Read bytes into outByte[] and retain the number of bytes returned.

while (blob == Blobsize) // Continue while there are bytes beyond the size of the buffer.

{

bw.Write(outBuffer);

bw.Flush();

startIndex += Blobsize;

blob = sqlDr.GetBytes(IndexBlobContents, startIndex, outBuffer, 0, Blobsize);

}

bw.Write(outBuffer, 0, (int)blob);// Write the remaining buffer.

bw.Flush();

bw.Close();

fs.Close();

SqlContext.Pipe.Send("Downloaded successfully in " + ExtractFileName);

}

sqlDr.Close();

}

catch (Exception er)

{

SqlContext.Pipe.Send(er.Message);

}

finally

{

if (sqlconn.State == System.Data.ConnectionState.Open)

{

sqlconn.Close();

}

fs = null;

bw = null;

cmd = null;

sqlDr = null;

sqlconn = null;

}

}

}

|||

Looks pretty cool. I generally don't like to see dynamic SQL, but it seems like it's working for your architecture. Thanks for posting this so the community can benefit :-)

People ask about this quite a bit at conferences... now I have a place to direct them.

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/

|||

Hi Raj,

This solution is great. However, I am using a different environment :-

SQL 2005 and Java for this application.

So, i will not be able to use the c# piece of code.

c# application {Create library}

Thanks,

how to download the image or file from the [Blobcontent] as file in sql server 2005?

hi,

i plan to use the database mail to send the mail. i created stored procedure to send the mail to all receipents ,.

Table fields like, profile,Toaddress,Bcc,Ccc,Blbcontents ,filename..subj,msgbody ,etc...,

download the blb & attach with the mail for the particular recepent

.

so., is it possible to download the blobcontent using Query? or any Other function available in Sqlserver 2005?

In order to attach files to an email in Database Mail on SQL Server 2005, the files must be on disk. If you are storing files at blobs (VarBinary or image) in your SQL Server database, you must extract them to disk before attaching them to your mail.

Does that answer your question?

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/

|||

thanks Mr.Paul A. Mestemaker,

my question is, Is any system procedure available to download the blob-content in sql server 2005 database itself?

Please let me know ..

any way, myself found the solution, please let me know the procedure is correct

i wrote the clr integrated procedure using c# application

the below steps i have done

1. created the ExportBlob.dll file

2. Created assembly with ExportBlob.dll.

3. Created Procedure to call the Dll file with param.

4. Created ownProcedure to send mail

5. if you want to send mail as Automatically, create new job & set the schedule time to run in sql server agents.

this code is working fine.

Create assembly

==============

USE [master]

Go

/* register the assembly in a SQL Server database using the CREATE ASSEMBLY statement */

CREATE ASSEMBLY ExportBlob

FROM 'D:\Extended_Proc\sp_exportBlob.dll'

WITH PERMISSION_SET = EXTERNAL_ACCESS

GO

GO

/****** Object: StoredProcedure [dbo].[xp_ExportBlob]

CREATE PROCEDURE [dbo].[xp_ExportBlob]

@.ServerName [nvarchar](25),

@.UID [nvarchar](50),

@.Pwd [nvarchar](25),

@.DBName [nvarchar](25),

@.Tbname [nvarchar](50),

@.FldName [nvarchar](100),

@.cndt [nvarchar](max),

@.Exportpath [nvarchar](100)

WITH EXECUTE AS CALLER

AS

EXTERNAL NAME [ExportBlob].[sp_exportBlob].[exportBlob] //

mail send

=========

SET @.DBName=db_name() /* Get & Assign the Current Database Name*/

SET @.Server=@.@.servername

Select @.ListOfAttachFiles='', @.Delimiter=';'

/*Create a Local Dir to save the File*/

set @.ExtractPath='C:\SQLdbmail_attched_files\

DECLARE CursorMailList CURSOR FOR

SELECT [MailID],

[Profile],

left(Subject,255),

[importance],

[MsgTo],

[CopyTo],

[BCCTo],

[Contents],

isnull(HasAttachment,0)

FROM MailTb Where Processed=0 Order by MailID

OPEN CursorMailList

FETCH NEXT FROM CursorMailList INTO @.MailID,@.Profile,@.m_subject,@.m_importance,@.m_Toaddress,@.m_ccaddress,@.m_Bccaddress,@.m_body,@.HasAttachment

WHILE (@.@.FETCH_STATUS = 0)

BEGIN

Select @.ListOfAttachFiles=@.ListOfAttachFiles + @.ExtractPath+Filename+@.Delimiter from Attachments where MailID=@.MailID

SET @.ListOfAttachFiles=left(@.ListOfAttachFiles,len(@.ListOfAttachFiles)-1)

SET @.cndtn='where Datalength(Blobcontents)>0 and MailID='+ convert(VARCHAR,@.MailID,25)

select @.FldNames='Blobcontents,Filename'

/*Download File in the server Dir */

/*passing param to dll , param=servername,UID,PWD,DatabaseName,Tablename,Feildname,wherecndtn,extractDir */

EXEC master..xp_ExportBlob @.Server, 'sa', 'pass', @.DBName, 'Attachments', @.FldNames, @.cndtn, @.ExtractPath

/*Get Missing Attchment Files */

BEGIN TRY

EXECUTE msdb..sp_send_dbmail

@.profile_name = @.Profile

,@.recipients = @.m_Toaddress

,@.copy_recipients = @.m_ccaddress

,@.blind_copy_recipients = @.m_Bccaddress

,@.body = @.m_body

,@.subject = @.m_subject

,@.importance = @.m_importance

,@.file_attachments = @.ListOfAttachFiles /* Eg. D:\mailDownload\filename.ext;c D:\mailDownload\filename2.ext */

,@.mailitem_id = @.mailitemid output

Update MailTb set Processed=1 where MailID=@.MailID /*Update back Mail sent scessfully*/

END TRY /*TRY*/

BEGIN CATCH

SET @.err=1

set @.ErrMsg = @.ErrMsg +'Failed to send Mail with Attachments. SDS MailID ='+convert(varchar,@.MailId,25)

END CATCH /*Catch*/

END /*

FETCH NEXT FROM CursorMailList INTO @.MailID,@.Profile,@.m_subject,@.m_importance,@.m_Toaddress,@.m_ccaddress,@.m_Bccaddress,@.m_body,@.HasAttachment

END /*WHILE*/

-- clean up; close & Deallocate the cursor

CLOSE CursorMailList

DEALLOCATE CursorMailList

c# application {Create library}

====================

using System;

using System.Collections.Generic;

using System.Text;

using System.IO;

using System.Data.SqlClient;

using System.Data.Sql;

using Microsoft.SqlServer.Server;

using System.Data.SqlTypes;

public class sp_exportBlob

{

// Identify that this is a SQL Stored Procedure

[SqlProcedure]

//summary

//FldNames should be BlobContents and Filename with Extension using comma Sepearator.

// [i.e., Fldnames="Blobcontents,Filename+Extension" ]

//

public static void exportBlob(string ServerName, string UID, string Pwd, string DBName, string TbName, string Fldnames, string Cndt, string ExtractPath)

{

SqlConnection sqlconn = new SqlConnection();

SqlDataReader sqlDr;

SqlCommand cmd;

FileStream fs;

BinaryWriter bw;

int Blobsize;

long blob, startIndex;

byte[] outBuffer;

string ExtractFileName = "";

try

{

int IndexBlobContents = 0;

sqlconn.ConnectionString = "Server=" + ServerName + ";UID=" + UID + ";Pwd=" + Pwd + ";Database=" + DBName;

sqlconn.Open();

Blobsize = 1024;// Initalize the BlobSize

cmd = new SqlCommand("SELECT " + Fldnames + " FROM " + TbName + " " + Cndt, sqlconn);

sqlDr = cmd.ExecuteReader();

while (sqlDr.Read())

{

ExtractFileName = ExtractPath + sqlDr[1].ToString();//dirname + filename

startIndex = 0; // Reset the starting byte for the new BLOB.

outBuffer = new byte[Blobsize];

if (File.Exists(@.ExtractFileName))

{

File.Delete(@.ExtractFileName);

}

fs = new FileStream(@.ExtractFileName, FileMode.OpenOrCreate, FileAccess.Write); // Create a file to hold the output.

bw = new BinaryWriter(fs);

blob = sqlDr.GetBytes(IndexBlobContents, startIndex, outBuffer, 0, Blobsize); // Read bytes into outByte[] and retain the number of bytes returned.

while (blob == Blobsize) // Continue while there are bytes beyond the size of the buffer.

{

bw.Write(outBuffer);

bw.Flush();

startIndex += Blobsize;

blob = sqlDr.GetBytes(IndexBlobContents, startIndex, outBuffer, 0, Blobsize);

}

bw.Write(outBuffer, 0, (int)blob);// Write the remaining buffer.

bw.Flush();

bw.Close();

fs.Close();

SqlContext.Pipe.Send("Downloaded successfully in " + ExtractFileName);

}

sqlDr.Close();

}

catch (Exception er)

{

SqlContext.Pipe.Send(er.Message);

}

finally

{

if (sqlconn.State == System.Data.ConnectionState.Open)

{

sqlconn.Close();

}

fs = null;

bw = null;

cmd = null;

sqlDr = null;

sqlconn = null;

}

}

}

|||

Looks pretty cool. I generally don't like to see dynamic SQL, but it seems like it's working for your architecture. Thanks for posting this so the community can benefit :-)

People ask about this quite a bit at conferences... now I have a place to direct them.

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/

|||

Hi Raj,

This solution is great. However, I am using a different environment :-

SQL 2005 and Java for this application.

So, i will not be able to use the c# piece of code.

c# application {Create library}

Thanks,

how to download the image or file from the [Blobcontent] as file in sql server 2005?

hi,

i plan to use the database mail to send the mail. i created stored procedure to send the mail to all receipents ,.

Table fields like, profile,Toaddress,Bcc,Ccc,Blbcontents ,filename..subj,msgbody ,etc...,

download the blb & attach with the mail for the particular recepent

.

so., is it possible to download the blobcontent using Query? or any Other function available in Sqlserver 2005?

In order to attach files to an email in Database Mail on SQL Server 2005, the files must be on disk. If you are storing files at blobs (VarBinary or image) in your SQL Server database, you must extract them to disk before attaching them to your mail.

Does that answer your question?

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/

|||

thanks Mr.Paul A. Mestemaker,

my question is, Is any system procedure available to download the blob-content in sql server 2005 database itself?

Please let me know ..

any way, myself found the solution, please let me know the procedure is correct

i wrote the clr integrated procedure using c# application

the below steps i have done

1. created the ExportBlob.dll file

2. Created assembly with ExportBlob.dll.

3. Created Procedure to call the Dll file with param.

4. Created ownProcedure to send mail

5. if you want to send mail as Automatically, create new job & set the schedule time to run in sql server agents.

this code is working fine.

Create assembly

==============

USE [master]

Go

/* register the assembly in a SQL Server database using the CREATE ASSEMBLY statement */

CREATE ASSEMBLY ExportBlob

FROM 'D:\Extended_Proc\sp_exportBlob.dll'

WITH PERMISSION_SET = EXTERNAL_ACCESS

GO

GO

/****** Object: StoredProcedure [dbo].[xp_ExportBlob]

CREATE PROCEDURE [dbo].[xp_ExportBlob]

@.ServerName [nvarchar](25),

@.UID [nvarchar](50),

@.Pwd [nvarchar](25),

@.DBName [nvarchar](25),

@.Tbname [nvarchar](50),

@.FldName [nvarchar](100),

@.cndt [nvarchar](max),

@.Exportpath [nvarchar](100)

WITH EXECUTE AS CALLER

AS

EXTERNAL NAME [ExportBlob].[sp_exportBlob].[exportBlob] //

mail send

=========

SET @.DBName=db_name() /* Get & Assign the Current Database Name*/

SET @.Server=@.@.servername

Select @.ListOfAttachFiles='', @.Delimiter=';'

/*Create a Local Dir to save the File*/

set @.ExtractPath='C:\SQLdbmail_attched_files\

DECLARE CursorMailList CURSOR FOR

SELECT [MailID],

[Profile],

left(Subject,255),

[importance],

[MsgTo],

[CopyTo],

[BCCTo],

[Contents],

isnull(HasAttachment,0)

FROM MailTb Where Processed=0 Order by MailID

OPEN CursorMailList

FETCH NEXT FROM CursorMailList INTO @.MailID,@.Profile,@.m_subject,@.m_importance,@.m_Toaddress,@.m_ccaddress,@.m_Bccaddress,@.m_body,@.HasAttachment

WHILE (@.@.FETCH_STATUS = 0)

BEGIN

Select @.ListOfAttachFiles=@.ListOfAttachFiles + @.ExtractPath+Filename+@.Delimiter from Attachments where MailID=@.MailID

SET @.ListOfAttachFiles=left(@.ListOfAttachFiles,len(@.ListOfAttachFiles)-1)

SET @.cndtn='where Datalength(Blobcontents)>0 and MailID='+ convert(VARCHAR,@.MailID,25)

select @.FldNames='Blobcontents,Filename'

/*Download File in the server Dir */

/*passing param to dll , param=servername,UID,PWD,DatabaseName,Tablename,Feildname,wherecndtn,extractDir */

EXEC master..xp_ExportBlob @.Server, 'sa', 'pass', @.DBName, 'Attachments', @.FldNames, @.cndtn, @.ExtractPath

/*Get Missing Attchment Files */

BEGIN TRY

EXECUTE msdb..sp_send_dbmail

@.profile_name = @.Profile

,@.recipients = @.m_Toaddress

,@.copy_recipients = @.m_ccaddress

,@.blind_copy_recipients = @.m_Bccaddress

,@.body = @.m_body

,@.subject = @.m_subject

,@.importance = @.m_importance

,@.file_attachments = @.ListOfAttachFiles /* Eg. D:\mailDownload\filename.ext;c D:\mailDownload\filename2.ext */

,@.mailitem_id = @.mailitemid output

Update MailTb set Processed=1 where MailID=@.MailID /*Update back Mail sent scessfully*/

END TRY /*TRY*/

BEGIN CATCH

SET @.err=1

set @.ErrMsg = @.ErrMsg +'Failed to send Mail with Attachments. SDS MailID ='+convert(varchar,@.MailId,25)

END CATCH /*Catch*/

END /*

FETCH NEXT FROM CursorMailList INTO @.MailID,@.Profile,@.m_subject,@.m_importance,@.m_Toaddress,@.m_ccaddress,@.m_Bccaddress,@.m_body,@.HasAttachment

END /*WHILE*/

-- clean up; close & Deallocate the cursor

CLOSE CursorMailList

DEALLOCATE CursorMailList

c# application {Create library}

====================

using System;

using System.Collections.Generic;

using System.Text;

using System.IO;

using System.Data.SqlClient;

using System.Data.Sql;

using Microsoft.SqlServer.Server;

using System.Data.SqlTypes;

public class sp_exportBlob

{

// Identify that this is a SQL Stored Procedure

[SqlProcedure]

//summary

//FldNames should be BlobContents and Filename with Extension using comma Sepearator.

// [i.e., Fldnames="Blobcontents,Filename+Extension" ]

//

public static void exportBlob(string ServerName, string UID, string Pwd, string DBName, string TbName, string Fldnames, string Cndt, string ExtractPath)

{

SqlConnection sqlconn = new SqlConnection();

SqlDataReader sqlDr;

SqlCommand cmd;

FileStream fs;

BinaryWriter bw;

int Blobsize;

long blob, startIndex;

byte[] outBuffer;

string ExtractFileName = "";

try

{

int IndexBlobContents = 0;

sqlconn.ConnectionString = "Server=" + ServerName + ";UID=" + UID + ";Pwd=" + Pwd + ";Database=" + DBName;

sqlconn.Open();

Blobsize = 1024;// Initalize the BlobSize

cmd = new SqlCommand("SELECT " + Fldnames + " FROM " + TbName + " " + Cndt, sqlconn);

sqlDr = cmd.ExecuteReader();

while (sqlDr.Read())

{

ExtractFileName = ExtractPath + sqlDr[1].ToString();//dirname + filename

startIndex = 0; // Reset the starting byte for the new BLOB.

outBuffer = new byte[Blobsize];

if (File.Exists(@.ExtractFileName))

{

File.Delete(@.ExtractFileName);

}

fs = new FileStream(@.ExtractFileName, FileMode.OpenOrCreate, FileAccess.Write); // Create a file to hold the output.

bw = new BinaryWriter(fs);

blob = sqlDr.GetBytes(IndexBlobContents, startIndex, outBuffer, 0, Blobsize); // Read bytes into outByte[] and retain the number of bytes returned.

while (blob == Blobsize) // Continue while there are bytes beyond the size of the buffer.

{

bw.Write(outBuffer);

bw.Flush();

startIndex += Blobsize;

blob = sqlDr.GetBytes(IndexBlobContents, startIndex, outBuffer, 0, Blobsize);

}

bw.Write(outBuffer, 0, (int)blob);// Write the remaining buffer.

bw.Flush();

bw.Close();

fs.Close();

SqlContext.Pipe.Send("Downloaded successfully in " + ExtractFileName);

}

sqlDr.Close();

}

catch (Exception er)

{

SqlContext.Pipe.Send(er.Message);

}

finally

{

if (sqlconn.State == System.Data.ConnectionState.Open)

{

sqlconn.Close();

}

fs = null;

bw = null;

cmd = null;

sqlDr = null;

sqlconn = null;

}

}

}

|||

Looks pretty cool. I generally don't like to see dynamic SQL, but it seems like it's working for your architecture. Thanks for posting this so the community can benefit :-)

People ask about this quite a bit at conferences... now I have a place to direct them.

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/

|||

Hi Raj,

This solution is great. However, I am using a different environment :-

SQL 2005 and Java for this application.

So, i will not be able to use the c# piece of code.

c# application {Create library}

Thanks,

How to download the english version of SQL Sever Express?

Hello,

when i try to download SQL Server Express from

http://msdn.microsoft.com/vstudio/express/sql/download/

i only get the german version. But i want to download the original english version. Because i like more to work with the english terms than the translated german ones.

Regards,

Markus

Visit this page, select English then click Change, scroll-down to the Files in This Download then click the third download-button.
Hope this helps you.
|||

Thank you. I want to download the SQL Server 2005 Express Edition with Advanced Services SP1.

Like on this page:

http://msdn.microsoft.com/vstudio/express/sql/download/

But in English, not in German. I'ts not helpful for me to work with an german version and read the english documentation.

The subset of english microsoft uses is so good and understandable that in my opinion german versions of development tools are obsolete. When all use the english version, all use the same terms.

Markus

|||Okay, take a look at this page...|||

For those of you wondering, the MSDN download page is language sensitive and automatically downloads the language version of Express based on your Browser settings, assuming we release a version in that language. For cases where you want a language other than the one your Browser is set to, you can get those languages directly from the Microsoft Download Center as described above.

I will be updating the MSDN download page in the near future to contain this information so that you will be able to get to the correct download center page for alternate language downloads directly from MSDN.

Regards,

Mike Wachal
SQL Express team

Mark the best posts as Answers!

|||

Thank you, Moayad for the link to the original version!

Mike wrote:
> I will be updating the MSDN download page in the near future to
> contain this information so that you will be able to get to the
> correct download center page for alternate language downloads
> directly from MSDN.

thank you very much!


How to download SQL 2005 Express - English version?

I try to download SQL Express but in result get a Russion version Sad. How I could to download English version?

It is good to do to user could make choice: which version he wants Wink.

try to down load from this link : http://www.microsoft.com/downloads/details.aspx?familyid=5B5528B9-13E1-4DB9-A3FC-82116D598C3D&displaylang=en

Madhu

How to download a file from SQL Server in my Web APP

Hello people,

Do you know how can do for downloading a file stored in a database?. I'm using a table with a FILE field for storing the file.

I know i have to create a special aspx page for downloading, that receives parameters to locate the proper record in the table and then retrieve the file in memory to start downloading.

I have done this with file located at specific folders but not a database's field.

Another thing... the file may be big.

Dou you have any idea about retrieving from sql and sending the file back to the final user?

I really appreciate your support.

Larry.Here's 2 articles, the first is for smaller files, the second is more complicated but better for larger files:

http://support.microsoft.com/kb/316887

http://support.microsoft.com/default.aspx?scid=kb;en-us;317043

How to download a file from a secure website

We need to download a file from a secure website using either DTS or Visual basic.Any idea??Q1 We need to download a file from a secure website using either DTS or Visual basic.Any idea??

A1 A suggestion would be to gather additional specifications (available from the website host?); generally that should constrain the possibilities somewhat and make different options easier to evaluate in relation to the local environment and local security requirements.

For example: (Is this a rare or one time event, or an hourly, daily, or weekly event? May one use / choose among vpn, ssl methods, etc.? How large a file is to be transferred and what is to be done with it?)|||use OpenURL method, it can do https

Inet1.URL = "https://www.mysecuredserver.com/myfile.txt"
bValidate() = Inet1.OpenURL(Inet1.URL, icByteArray)
Open "c:\myfile.txt" For Binary Access Write As #1
Put #1, , bValidate()

;-)
jiri