Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

Monday, March 26, 2012

Saving HTML into SQL2000

Hello all,
How do I save the HTML source of a webpage into SQLServer 2000?
Thanks.That a very common question and depends what coding language you are
using, but for .NET solutions the best would be the use of the
WebRequest class:
public static string getHTMLCode(string URI)
{
WebRequest wrq = WebRequest.Create(URI);
wrq.Timeout = 3000;
WebResponse wrp = null;
try
{
wrp = wrq.GetResponse();
StreamReader sr = new
StreamReader(wrp.GetResponseStream(), Encoding.ASCII);
StringBuilder strBuildContent = new StringBuilder();
while (-1 != sr.P())
{
strBuildContent.Append(sr.ReadLine());
}
return strBuildContent.ToString();
}
catch (Exception ex)
{
ex = ex;
return null;
}
}
Saving should be something like a normal saving though a insert
procedure or a insert statement.
HTH, Jens Suessmeyer.|||Hi
If you have the page as a file you can load it into a text column using
(say) the textcopy program or
look at using ADOs appendchunk
http://support.microsoft.com/defaul...kb;en-us;189415
If you can use XML instead then check out
http://www.perfectxml.com/articles/XML/ImportXMLSQL.asp
John
"Nestor" <test@.test.com> wrote in message
news:e%23XUe%23vLGHA.648@.TK2MSFTNGP14.phx.gbl...
> Hello all,
> How do I save the HTML source of a webpage into SQLServer 2000?
> Thanks.
>|||thanks guys.. i'll try them out...
"Nestor" <test@.test.com> wrote in message
news:e%23XUe%23vLGHA.648@.TK2MSFTNGP14.phx.gbl...
> Hello all,
> How do I save the HTML source of a webpage into SQLServer 2000?
> Thanks.
>|||Actaully I've already got the HTML source and the problems in the insertion
due too presence of many characters like ' or ", so SQLServer is not
recognizing the HTML string as a string...
any quick way about this?
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1139658991.300793.254700@.z14g2000cwz.googlegroups.com...
> That a very common question and depends what coding language you are
> using, but for .NET solutions the best would be the use of the
> WebRequest class:
> public static string getHTMLCode(string URI)
> {
> WebRequest wrq = WebRequest.Create(URI);
> wrq.Timeout = 3000;
> WebResponse wrp = null;
> try
> {
> wrp = wrq.GetResponse();
> StreamReader sr = new
> StreamReader(wrp.GetResponseStream(), Encoding.ASCII);
> StringBuilder strBuildContent = new StringBuilder();
> while (-1 != sr.P())
> {
> strBuildContent.Append(sr.ReadLine());
> }
> return strBuildContent.ToString();
> }
> catch (Exception ex)
> {
> ex = ex;
> return null;
> }
> }
> Saving should be something like a normal saving though a insert
> procedure or a insert statement.
>
> HTH, Jens Suessmeyer.
>|||I don=B4t know which coding language you are using, so I can show you
how to make this in C# or any .NET language:
SqlCommand sqlInsertCommand1 =3D new SqlCommand();
SqlConnection sqlConnection1 =3D new SqlConnection("Data
Source=3DSOmeServer;Initital Catalog=3DSomeDB;Integrated Security=3Dtrue");
sqlInsertCommand1.Connection =3D sqlConnection1;
sqlInsertCommand1.CommandType =3D CommandType.Text;
sqlInsertCommand1.CommandText =3D "insert into SomeTable
values(@.SomeHTMLVar)";
sqlInsertCommand1.Parameters.Add(new
SqlParameter("@.SomeHTMLVar",SqlDbType.VarChar,8000));
sqlInsertCommand1.Parameters["@.SomeHTMLVar"].Value =3D
YourParamterwithHTMLCode
sqlConnection1.Open();
sqlInsertCommand1.ExecuteNonQuery();
I know that this is not the shortest code, but its just to provide you
with some basic stuff. There are other way to do this like using a
dataadapter and commadnbuilders, but that is one option.
HTH, jens Suessmeyer.

Friday, March 23, 2012

Saving and Retrieving Binary Files in MSSQL 2005

Dear all,
Can any one provide me a sample source regarding saving and retrieving
binary files in MSSQL 2005. I have try it but I found that it only insert
the first element of that byte array that I read from file to table.
I was using Microsoft Data Access Application Block version 2 SQLhelper
to done the execution portion.
ThanksHi
The text, ntext and image data types have successors: varbinary(max),
varchar(max) and nvarchar(max).
Those can be addressed like normal char and binary columns, no need to chunk
the data in.
Application Blocks 2 don't support he new datatypes as it is still a .NET
1.1 application.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Goh" <goh@.noemail.noemail> wrote in message
news:utOmXEv%23FHA.2036@.TK2MSFTNGP14.phx.gbl...
> Dear all,
> Can any one provide me a sample source regarding saving and retrieving
> binary files in MSSQL 2005. I have try it but I found that it only insert
> the first element of that byte array that I read from file to table.
> I was using Microsoft Data Access Application Block version 2 SQLhelper
> to done the execution portion.
> Thanks
>
>|||Hello,
Did you try this code?
byte[] mmfbBlob;
SqlParameter Parameter1 = new SqlParameter("@.mmfbBlobThumb",
SqlDbType.Image);
Parameter1.Value = mmfbBlob;
Since the issue is related ADO.net, my suggestion is that you go there
since you could obtain most qualified answers there:
microsoft.public.dotnet.framework.adonet
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>From: "Goh" <goh@.noemail.noemail>
>Subject: Saving and Retrieving Binary Files in MSSQL 2005
>Date: Wed, 7 Dec 2005 13:42:56 +0800
>Keywords: Saving and Retrieving Binary Files in MSSQL 2005
>Lines: 13
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>X-RFC2646: Format=Flowed; Original
>Message-ID: <utOmXEv#FHA.2036@.TK2MSFTNGP14.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.programming
>NNTP-Posting-Host: tm.net.my 60.49.6.190
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.programming:566803
>X-Tomcat-NG: microsoft.public.sqlserver.programming
>Dear all,
> Can any one provide me a sample source regarding saving and retrieving
>binary files in MSSQL 2005. I have try it but I found that it only insert
>the first element of that byte array that I read from file to table.
> I was using Microsoft Data Access Application Block version 2 SQLhelper
>to done the execution portion.
>Thanks
>
>|||http://spaces.msn.com/members/staceyw/Blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!404.
entry
William Stacey [MVP]
"Goh" <goh@.noemail.noemail> wrote in message
news:utOmXEv%23FHA.2036@.TK2MSFTNGP14.phx.gbl...
> Dear all,
> Can any one provide me a sample source regarding saving and retrieving
> binary files in MSSQL 2005. I have try it but I found that it only insert
> the first element of that byte array that I read from file to table.
> I was using Microsoft Data Access Application Block version 2 SQLhelper
> to done the execution portion.
> Thanks
>
>

Tuesday, March 20, 2012

Save to XML file

i'm trying to save data to an XML file from an OLE DB source using the "For XML" clause in the SQL command. Do I need to use a flat file connection manager or a raw file connection manager? And what destination do I use?

jschroeder wrote:

i'm trying to save data to an XML file from an OLE DB source using the "For XML" clause in the SQL command. Do I need to use a flat file connection manager or a raw file connection manager? And what destination do I use?

There are no built in components to allow you to output as XML but Donald Farmer's book contains code showing you how to do it in a script component.

If you don't want to buy the book (although i recommend you do - its very cheap) then read this:

Output a file as a csv or an XML file
(http://blogs.conchango.com/jamiethomson/archive/2006/07/11/4209.aspx)

-Jamie

|||Save it to a flat file destination. It's just text, and you can give it whatever file name you want.|||I've been unsuccessful with that. I got an error that said the input of data type DT_IMAGE is not allowed. I tried using the data conversion component to convert to DT_TEXT, but got garbage in the output file.

Save time in Script Component which is almost forwarding

Hi,
I have to add the fields coming from the source AS IS but, I need to add current date as a column to it. So, What I do is to add an Script Component and add each and every output column in that along with defining their types and writing an "assignments" script.

Is there any possibility for me to save time in the scenarios where I am almost passing on the information to next level in the data flow ?

Any input regarding this will sincerely be appreciated.

FahadWhy can't you use a derived column transformation with getdate() as an expression? Using a derived column, you can add a new date column to your data flow.|||Thanks, I appreciate it.

Monday, March 12, 2012

save package to SQL server failed, no description found

Hi I have an instance of sql2005 on my machine and connected to a sql2000
server. I tried using the export wizard to create a package with the source
being tables from a database on the 2000 server and the destination being an
excel file on my machine. I also selected save package on the 2005 server.
When executing it makes it to the save portion but I then get the error, Save
to SQL Server failed, no description found!
Thanks.
--
Paul G
Software engineer.Hi Paul,
Please ensure that the user account in SQL who runs the job has adequate
privileges.
"Paul" wrote:
> Hi I have an instance of sql2005 on my machine and connected to a sql2000
> server. I tried using the export wizard to create a package with the source
> being tables from a database on the 2000 server and the destination being an
> excel file on my machine. I also selected save package on the 2005 server.
> When executing it makes it to the save portion but I then get the error, Save
> to SQL Server failed, no description found!
> Thanks.
> --
> Paul G
> Software engineer.|||ok I think that may have been the problem. Also I changed the authentication
from windows to mixed mode so will give it a try.
--
Paul G
Software engineer.
"Amol Lembhe" wrote:
> Hi Paul,
> Please ensure that the user account in SQL who runs the job has adequate
> privileges.
> "Paul" wrote:
> > Hi I have an instance of sql2005 on my machine and connected to a sql2000
> > server. I tried using the export wizard to create a package with the source
> > being tables from a database on the 2000 server and the destination being an
> > excel file on my machine. I also selected save package on the 2005 server.
> > When executing it makes it to the save portion but I then get the error, Save
> > to SQL Server failed, no description found!
> > Thanks.
> > --
> > Paul G
> > Software engineer.

Wednesday, March 7, 2012

SAP BW Coonection

Is it possible to have a Reporting Services Data Source connect to a SAP BW
cube?I have limited knowledge in this area, but this much I know:
SAP adopted Microsoft's OLEDB for OLAP interface for talking to BW cube.
Look at the following URL:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/OLE%20DB%20for%20OLAP.pdf
You should therefore be able to use MDX to query the cube. If you don't like
writing MDX queries, you can check out Proclarity Reporting Services Add-in
which will enable you to create the queries using a graphical designer. check
it out on Proclarity's website.
So the answer to your question is "most definitely, yes".
HTH
Charles Kangai, MCT, MCDBA
"Dave Morrow" wrote:
> Is it possible to have a Reporting Services Data Source connect to a SAP BW
> cube?

Tuesday, February 21, 2012

samples from SSIS book do not work

the book "microsoft sql server 2005 integration services" by kirk haselden claims you can download examples and source code at www.samspublishing.com

er no

what happens is this

go to the site
look for the 'downloads' link
see there isn't one
search for authors
h etc.... lose a few minutes of your life
find the book

yay

it forces you to sign up for an account in order to get the samples - outrageous

prepare for endless spam from sams

sign up

click on download samples
find the configedit folder
load into vs
run it
it doesn't work!!

thanks

Warning 1 The referenced component 'SourceLibrary' could not be found.
Warning 2 The referenced component 'SourceGrid2' could not be found.
Error 3 Unable to find source file 'K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigurationsEditor\bin\Debug\ConfigurationsEditor.exe' for assembly 'ConfigurationsEditor.exe', located in '[TARGETDIR]' K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\SetupConfigEdit\SetupConfigEdit.vdproj SetupConfigEdit
Error 4 The type or namespace name 'SourceGrid2' could not be found (are you missing a using directive or an assembly reference?) K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigEditControl\ConfigEdit.cs 9 7 ConfigEdit
Error 5 The type or namespace name 'SourceGrid2' could not be found (are you missing a using directive or an assembly reference?) K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigEditControl\ConfigEdit.cs 10 7 ConfigEdit
Error 6 The type or namespace name 'SourceGrid2' could not be found (are you missing a using directive or an assembly reference?) K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigEditControl\ConfigEdit.cs 87 40 ConfigEdit
Error 7 The type or namespace name 'SourceGrid2' could not be found (are you missing a using directive or an assembly reference?) K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigEditControl\ConfigEdit.cs 11 15 ConfigEdit
Error 8 The type or namespace name 'SourceGrid2' could not be found (are you missing a using directive or an assembly reference?) K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigEditControl\ConfigEdit.cs 24 17 ConfigEdit
Error 9 The type or namespace name 'SourceGrid2' could not be found (are you missing a using directive or an assembly reference?) K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigEditControl\ConfigEdit.cs 25 11 ConfigEdit
Error 10 The type or namespace name 'SourceGrid2' could not be found (are you missing a using directive or an assembly reference?) K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigEditControl\ConfigEdit.Designer.cs 318 17 ConfigEdit
Error 11 Metadata file 'K:\MAS\Software and Tools\Samples\SSIS\Kirk Haselden book\Samples\SRC\Utilities\ConfigEdit\ConfigEditControl\bin\Debug\ConfigEdit.dll' could not be found ConfigurationsEditor
Warning 12 Could not resolve this reference. Could not locate the assembly "SourceGrid2". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. ConfigEdit
Warning 13 Could not resolve this reference. Could not locate the assembly "SourceLibrary". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. ConfigEdit

one could argue that ssis should have a config editor supplied with it, instead of having to go into notepad

ConfigEdit has worked for many of us, right from the site.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1239403&SiteID=1