Showing posts with label covert. Show all posts
Showing posts with label covert. Show all posts

Friday, March 9, 2012

How to create a DTS package in 2005

I am 100% new to SQL. I have used Access for ever. I need to know how to take a Access 2003 database and covert it over to SQL 2005. I have no idea how to complete this. I was told to do a DTS package but I do not see any options for this.

Any help would be great!

Thank you

hi,

DTS is now known as SSIS pacakage

you can create a new database in sql management studio

after creating a new database. you can right click the database

and then click on task. then clcik import data.

choose microsoft access as a data source.

near the end of the wizard is an option to

execute immedietely and "save to SSIS package"

clcik the desired option and then click next.

to creat a package manually.

open microsoft visual studio 2005 then clcik on

file>new>project>business intelliegience project>integration service project

enter the project name and click next

regards,

joey

|||Thank you! :-)

Wednesday, March 7, 2012

How to covert Oracle Store Procedure to SQLServer

Is there any easy to do this, covert Oracle store procedure to SQL Server 2000.
Any help is thankful.
--iqueen.try using the oracle stored procedure directly in oracle.
I hope it will execute.
Again it depends on what version of oracle u have.

I have used sql SP on oracle with minor changes|||Originally posted by cyrus
I have used sql SP on oracle with minor changes

I doubt it...

Why not post some code to show us though...|||the problem is : I have change my Database Server, Oracle->SQLServer2000, the data have transfer to SQL Server, easy done with DTS, but Store Procedure won't, what shall I do ,wanna enable the same store procedure in SQL Server.
Any help is thankful.
--iqueen.|||There is really a lot of store procedure , more than 2000.|||I do not have ORACLE here however I think it can be done using DTS.

After you select the Target Source and Destination Source, you are provided with 3 options one of which says "Copy Objects and..."

If you opt for this option, you get options for all types of objects.

Please let me know if that does not work. Thanks.|||DTS can NOT transfer the store procedure... :(:(:(
Originally posted by tampu
I do not have ORACLE here however I think it can be done using DTS.

After you select the Target Source and Destination Source, you are provided with 3 options one of which says "Copy Objects and..."

If you opt for this option, you get options for all types of objects.

Please let me know if that does not work. Thanks.|||Oracle uses PL-SQL and SQL Server uses T-SQL.. . . .although they are much similar as regards ANSI standards but syntactical differences are definitely there. .. . .. ..functions... . processes and other things sre different
you can refer to microsoft site for they provide much info as to shift orcale code to SQL Server ... ..|||see if this attachment helps u|||the attachment contains basics of oracle Architecture :D
it will not help for Oracle to Sql 2k conversion.

Regards,
Selva Balaji B.|||Sorry ,Probably I gave a wrong one
There no concrete help but difference between oracle and sql
see if it helps u|||Hi cyrus

This is an useful document. :)

Regards,
Selva Balaji B.

HOw to covert horizontal resultset to vertical resultset

Hi!
I have a table like this

Continent Country State
Asia India Tn
Asia India AP
Asia India Ka
Asia Pakistan Lh
Asia Pakistan Kh
Asia China Ka
Asia China SS
Asia China OP
Asia China KO
America Canada ON
America Canada TO

Now i want to generate a resulset like this

Continent Country State1 State2 State3 State4
Asia India Tn AP Ka
Asia Pakistan Lh Kh
Asia China Ka SS OP Ko
America Canada ON TO

HOw to do it?
I can do it using the resultset and building the query dynamically by using "Case Statement" but , is there any other way of directly reversing horizontal resultset to vertical ?????.

Kindly reply me

Thank You
Venkat LakshminarayananDo your state have to put in separate columns, or can they be formatted as a delimited string?

Do you have a column which indicates whether a given state is a "state1", "state2", "state3"... state. Otherwise, how do you want to assign states to columns?

Is there a limit on the number of states per country? Do they all have the same number of states?

I'm trying to decide whether a cross-tab query is possible or appropriate.

blindman|||i'd love to see a crosstab query done in sql server

in access, i can do, but in sql server, it is messy code, yes?

i always just tell people to handle it with application code

which includes the "cursor in a stored proc" approach

edit: p.s. toronto is not (yet) a state|||Crosstabs are not that complicated in TSQL. You just have to predefine the columns, which is good practice in Access too even though Access will construct the result set dynamically.

Books Online does a pretty good job of explaining and demonstrating cross-tabl calculation.

In my experience though, cross-tabulation is usually the last step complete in a process prior to formatting the output, and so it is often best handled by the interface (crystal, Access, whatever).

blindman|||heh

"just" predefine the columns...

:rolleyes:|||I agree about this being a presntation layer issue...

but I couldn't resist...just wish I could figure out a set based method...

USE Northwind
GO

CREATE TABLE myTable99 (col1 varchar(20), col2 varchar(20), col3 varchar(20))
GO

INSERT INTO myTable99 (Col1, Col2, Col3)
SELECT 'Asia', 'India', 'Tn' UNION ALL
SELECT 'Asia', 'India', 'AP' UNION ALL
SELECT 'Asia', 'India', 'Ka' UNION ALL
SELECT 'Asia', 'Pakistan', 'Lh' UNION ALL
SELECT 'Asia', 'Pakistan', 'Kh' UNION ALL
SELECT 'Asia', 'China', 'Ka' UNION ALL
SELECT 'Asia', 'China', 'SS' UNION ALL
SELECT 'Asia', 'China', 'OP' UNION ALL
SELECT 'Asia', 'China', 'KO' UNION ALL
SELECT 'America', 'Canada', 'ON' UNION ALL
SELECT 'America', 'Canada', 'TO'
GO

SET NOCOUNT ON

DECLARE IdontWantToUseACursor CURSOR
FOR
SELECT DISTINCT Col1, Col2 FROM myTable99

DECLARE @.Col1 varchar(20), @.Col2 varchar(20), @.Col3 varchar(7000)

DECLARE @.temp TABLE (Col1 varchar(20), Col2 varchar(20), Col3 varchar(7000))

OPEN IdontWantToUseACursor

FETCH NEXT FROM IdontWantToUseACursor
INTO @.Col1, @.Col2

WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Col3 = ''
SELECT @.Col3 = @.Col3 + ', ' + Col3 FROM myTable99 WHERE Col1 = @.Col1 AND Col2 = @.Col2
INSERT INTO @.temp (Col1, Col2, Col3) SELECT @.Col1, @.Col2, SUBSTRING(@.Col3,2,LEN(@.Col3)-2)
FETCH NEXT FROM IdontWantToUseACursor
INTO @.Col1, @.Col2
END

CLOSE IdontWantToUseACursor
DEALLOCATE IdontWantToUseACursor

SELECT * FROM @.Temp
GO
SET NOCOUNT OFF
GO

DROP TABLE myTable99
GO|||Set based...Thanks to Nigel Rivett

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=29931&whichpage=2|||set based? smoke and mirrors, i say

buried deep within that function is a SELECT statement which is executed for every single distinct combination of col1 and col2

however, there's no getting around the fact that in order to do the denormalization of many rows to one, something like this is necessary, whether in a user-defined function or in application code

but consider the bandwidth, to return multiple rows to the application from the database, where each returned row has "redundant" col1 and col2 values, compared to returning just one with the UDF method

for example, this technique might come in awfully handy when col1 is article_id and col2 is article_text varchar(6000), and the multiple col3 values are keywords describing the article...

rudy|||Hi EveryBody
Thank you all for replying me,I had found a solution and I will mail you that tommorow (if you would like to know),I like to know about Cross tab queries,can anyone help me....?
I have a master table in which Continent, countries and states are defined and What I did is , used a Select Case Statement and a cursor.
I had found a worderful solution for this.But still i like to know about cross tab qeuries which some of you were discussing.

Thank You
Repsor|||Look up CROSSTAB in Books Online. It really does a good jog of explaining it.

And for another example, check out this thread:

http://www.dbforums.com/t956654.html

This is a classic crosstab problem, and hkamatgi's post is a classic crosstab solution.

blindman

How to covert data from visual foxpro database to SQL server

Hi,
I have my data all store in visual foxpro
database, if i want to change my database to SQL server,
how do i copy all the data in visual foxpro and save in
SQL Server Database? Thank you.We are currently taking a lot of our data from Foxpro to SQL Server. We are
only taking Data and Structure. We simply used the Foxpro drivers and
created a link to the Foxpro DB. Using DTS we sucked the Data in. The
usual things are worth looking out for like Dates but besides that we have
no real problems with it.
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"florence" <florencelee@.visualsolutions.com.my> wrote in message
news:696501c3437c$d5f33f40$a401280a@.phx.gbl...
> Hi,
> I have my data all store in visual foxpro
> database, if i want to change my database to SQL server,
> how do i copy all the data in visual foxpro and save in
> SQL Server Database? Thank you.|||The converse of this method is to create an SQL Server table to receive the
data and then create a remote view to that table on the FoxPro side. After
that you only need to APPEND FoxPro data to the view and issue a
TABLEUPDATE().
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@.mvps.org, www.cindywinegarden.com
"Allan Mitchell" <allan@.no-spam.sqldts.com> wrote in message
news:e2klnp4QDHA.1564@.TK2MSFTNGP12.phx.gbl...
> We are currently taking a lot of our data from Foxpro to SQL Server. We
are
> only taking Data and Structure. We simply used the Foxpro drivers and
> created a link to the Foxpro DB. Using DTS we sucked the Data in. The
> usual things are worth looking out for like Dates but besides that we have
> no real problems with it.
> --
>
> Allan Mitchell (Microsoft SQL Server MVP)
> MCSE,MCDBA
> www.SQLDTS.com
> I support PASS - the definitive, global community
> for SQL Server professionals - http://www.sqlpass.org
> "florence" <florencelee@.visualsolutions.com.my> wrote in message
> news:696501c3437c$d5f33f40$a401280a@.phx.gbl...
> > Hi,
> >
> > I have my data all store in visual foxpro
> > database, if i want to change my database to SQL server,
> > how do i copy all the data in visual foxpro and save in
> > SQL Server Database? Thank you.
>