Showing posts with label friends. Show all posts
Showing posts with label friends. Show all posts

Friday, March 30, 2012

How to insert the value from the text box (ASP.NET 2.0) to the microsoft sql server 2000 d

Hello Friends,

I have a problem with ASP.net with dynamic data transfer from asp page to microsoft sql server 2000. For example , I have asp web page with one text field and a buttion.When I click the buttion, the value entered in the text field should be transfered from the text field to database.

Kindly See the following section c# code ....

SqlConnection objconnect = new SqlConnection(connectionString);

SqlCommand cmd = new SqlCommand();

cmd.Connection = objconnect;

cmd.CommandText = " select * from Table_Age where Age = @.Age";

cmd.CommandType = CommandType.Text;

SqlParameter parameter = new SqlParameter();

parameter.ParameterName = "@.Age";

parameter.SqlDbType = SqlDbType.VarChar;

parameter.Direction = ParameterDirection.Output;

parameter.Value = TextBox1.Text;

objconnect.Open();

// Add the parameter to the Parameters collection.

cmd.Parameters.Add(parameter);

SqlDataReader reader = cmd.ExecuteReader();

********************this section c# code is entered under the button control************************************

connection string is mentioned in the web.config file.

In the above c# code , I have a text field , where I entered the age , the value entered in the text field should be sent to database. I have used SqlParameter for selecting the type of data should be sent from ASP.NET 2.0 to the microsoft sql server 2000. I am facing a problem where I am unable to sent the random datas from a text field to the database server.I have a created a database file in the microsoft server 2000.

after the excution of the fIeld value is assinged to NULL in the main database i.e microsoft the sql server 2000.

Can anyone help with this issue.

My mail id phijop@.hotmail.com

- PHIJO MATHEW PHILIP.

Hi

Remove :

parameter.Direction = ParameterDirection.Output;

since your direction should be input.

Monday, March 19, 2012

How to import the data from oracle to SQL Server?

Hello friends,

I am working for a project. At my college I used to work with oracle. Now as requirement changes I have to change my database to SQL Server.

Is there any simple way one can suggest me?

Wow, I believe that you may have posted in the wrong forum.

This should have been posted in the "Oracle to SQL Server in I step...Data, DDL and Procedures" forum.

|||

Ryan.Kelley wrote:

Wow, I believe that you may have posted in the wrong forum.

This should have been posted in the "Oracle to SQL Server in I step...Data, DDL and Procedures" forum.

Is this meant to be helpful?

This may be of value (and other Google sites): http://www.sql-server-performance.com/np_migrating_from_oracle_to_sql_server.asp

Friday, March 9, 2012

How to import bulk data

Hi friends,
How can I import data from remote database. My local DB is Sql
Server 2005 and remote DB is Oracle. The data to be imported is very
large data(in GB).
How can I import faster? The table structures in both the DBs are
same.
Can you give a clear idea.
Thanks in advanceHi,
You can use SSIS. In Management Studio, right click your source database
and choose "Tasks > Import Data..." Then for your data source choose OLE DB
for Oracle. Fill in all the blanks in the Wizard and check "Save SSIS
Package" at the end if you want to run it more than once.
One thing to watch out for transferring Oracle to SQL Server. I was
transferring a table with a couple hundred rows on a daily basis over a WAN
VPN, and it would take about 45 minutes. I finally figured out why it was
so friggin' slow. There were three or four Oracle columns defined as
VARCHAR2(4000). Even though each one has only 3 to 8 characters of data,
they were getting padded out to 4000 characters. That was about 2.4 GB of
padding. I got the Oracle DBA to redefine them to VARCHAR2(10), and my
transfers dropped to 4 1/2 min!
--
Thank you,
Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org
<rajkm42@.googlemail.com> wrote in message
news:1190061613.152877.107680@.o80g2000hse.googlegroups.com...
> Hi friends,
> How can I import data from remote database. My local DB is Sql
> Server 2005 and remote DB is Oracle. The data to be imported is very
> large data(in GB).
> How can I import faster? The table structures in both the DBs are
> same.
> Can you give a clear idea.
> Thanks in advance
>

How to import apache log file into a table in SQL 2000

Hi friends,
I need to import a web log file coming from apache server into a table.But the problem is that log file is in some strange format.Its not in a comma delimited or not a tab delimited.
I am sending u some records of that file for a refrence.

62.219.115.5 - - [01/Mar/2007:04:26:51 -0700] "GET http://zdpub.dl.llnw.net/flvplayer3.../c4/window4.jpg HTTP/1.0" 304 177 "http://zdpub.vo.llnwd.net/o2/flvplayer/frontend6.swf" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; NetCaptor 7.5.4; .NET CLR 1.1.4322; FDM; .NET CLR 2.0.50727)"

165.21.154.9 - - [01/Mar/2007:04:53:53 -0700] "GET http://zdpub.dl.llnw.net/crankygeek...geeks.052.i.mp4 HTTP/1.0" 206 100740 "-" "iTunes/7.0.2 (Macintosh; N; PPC)"

217.255.204.70 - - [01/Mar/2007:10:30:01 -0700] "GET http://zdpub.dl.llnw.net/crankygeek...kygeeks.053.mov HTTP/1.0" 200 107184139 "-" "iTunes/7.0.2 (Macintosh; N; Intel)"

194.94.44.4 - - [01/Mar/2007:10:30:43 -0700] "GET http://zdpub.dl.llnw.net/crankygeek...geeks.053.i.mp4 HTTP/1.0" 200 687979 "-" "iTunes/7.0.2 (Macintosh; N; Intel)"

85.124.149.78 - - [01/Mar/2007:10:31:51 -0700] "GET http://zdpub.dl.llnw.net/crankygeek...kygeeks.053.mov HTTP/1.0" 200 138751823 "-" "Democracy/0.9.5.2 (http://www.participatoryculture.org)"

I m so confused how to import this file to a table.
And that is something that I need to do urgently.
Any help will be greatly apreciated.
Thanks.[color=black][font=Arial]I would change this file extension to txt. [/font]

[color=black][font=Arial] [/font]

[color=black][font=Arial]In Enterprise Manager go to Tools - Data Transformation Services - Import Data and follow a wizard. Change Data Source to txt file. [/font]

[color=black][font=Arial] [/font]

[color=black][font=Arial] [/font]

[color=black][font=Arial]It should create a table as is. [/font]


Hope it helps.|||

Quote:

Originally Posted by iburyak

[color=black][font=Arial]I would change this file extension to txt. [/font]

[color=black][font=Arial] [/font]

[color=black][font=Arial]In Enterprise Manager go to Tools - Data Transformation Services - Import Data and follow a wizard. Change Data Source to txt file. [/font]

[color=black][font=Arial] [/font]

[color=black][font=Arial] [/font]

[color=black][font=Arial]It should create a table as is. [/font]


Hope it helps.


Hi,
Actually I didnt understand what you are saying.
I mean I have table ready in my database in which I need to import this file.
e.g first column in my table is I.P add. in which it takes 62.219.115.5.
Second field is browser i.d.In that field instead of taking [01/Mar/2007:04:26:51 -0700] ,it takes - and so on.
So my problem is when I try to import data using DTS its not fetching correct data in respective columns.I guess this is because of the format of the file.
Thanks|||Do you need this as one time deal or on a permanent basis like on schedule every day?

You are having a hard case it is true.

What I was trying to tell you let SQL generate a new temporary table on a server and then deal with it on a server side. It probably will create one column with all text in it for each record. But then you would be able to process it and insert into production table if possible.

I don't think server would be able to split this record into correct columns with no delimiters.|||Had you ever seen this?

http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en

It is a log parser. I used it once with pretty good success.

Good Luck.|||Actually I'll have to do this once in a month.
I'll get log files for whole month from some other server.
And at the end of the month,I'll have to parse all files in to a table.|||Try to use logparser then.

Wednesday, March 7, 2012

How to implement this in SSIS

Greetings SQL friends!

I have the following transact SQL code which I want to change to a set of SSIS components.

SELECT blah, blah

FROM PSTAGE..[stage_OFFER_PRICE_DIVIDEND] AS SOPD
LEFT OUTER JOIN PSTAGE..[stage_PRICE_GRP] AS SPG
ON SOPD.PRICE_GRP_ID = SPG.PRICE_GRP_ID
LEFT OUTER JOIN PSTAGE..[stage_type] AS TYP
ON TYP.TYPE_CD=SPG.PRICE_TYPE_TYPE4_CD
and TYP.TYPE_CL_CD = '0017'

I know I can join two data sets using a merge join (left join) but how do I combine a third merge join? Should I be doing this or should I just stick my code in a SQL Task instead?

Your help would be appreciated.

You can do this in SSIS by adding another data source for your third table and adding a second MergeJoin downstream of the first - joining the output of the first merge join to the output of the third data source.

It may be more efficient to push this on to your server using the query you give in a source component, especially as you are performing outer joins.

When doing an outer join in a client such as SSIS, you will pull all the data from the server just to throw some away as unjoined - that's somewhat inefficient use of the server-client transport. It may be more efficient to perform the join in SQL and only pull onto the client data that you will processing further.

Donald