Showing posts with label requirement. Show all posts
Showing posts with label requirement. Show all posts

Sunday, March 11, 2012

Copy database changes without data

Hi,

This requirement is for our development and test environment. We have a database server which we use for development hence many changes are done on the database objects on daily basis like tables def changes, view def changes, sp changes, new sp etc.

On the other hand our testing team connects to another database server where they perform testing hence any internal test release would need the changes like tables def changes, view def changes, sp changes, new sp etc.

Since testing team already have their test data set in the test environment hence they want to keep their data but new test release should only provide with datbase object changes. The difficult part is, we have over 500 tables and about 1000 views and somewhere about 400 stored procs, so its not possible to manually perform the above task.

I dont do database admin job hence clueless as what would be the best way to accomplish the above. Pl advice.

we are using sql server 2005 on both test and dev environemts.

cheers!
d2

Check out SQL Compare from RedGate.

http://www.red-gate.com/

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

Check out Visual Studio Team Suite for Database Professionals

http://msdn2.microsoft.com/en-us/teamsystem/aa718807.aspx

|||Hi Vishal,

Thanks for your response.

We have license for team system but we are not using visual studio for database professionals as yet. Could you pl point me to some good tutorial on this subject.

thanks,
d2
|||

http://msdn2.microsoft.com/en-us/teamsystem/aa718764.aspx

|||i tested SQL Compare [www.red-gate.com] with SQL Server 2005. it is very good tool and it enables you to synchronize changes on DB Schema.|||I have used the VSTS for Database Professionals tool as we have VSTS licenses. It works like a charm.

Thanks for all the advises.

Copy database changes without data

Hi,

This requirement is for our development and test environment. We have a database server which we use for development hence many changes are done on the database objects on daily basis like tables def changes, view def changes, sp changes, new sp etc.

On the other hand our testing team connects to another database server where they perform testing hence any internal test release would need the changes like tables def changes, view def changes, sp changes, new sp etc.

Since testing team already have their test data set in the test environment hence they want to keep their data but new test release should only provide with datbase object changes. The difficult part is, we have over 500 tables and about 1000 views and somewhere about 400 stored procs, so its not possible to manually perform the above task.

I dont do database admin job hence clueless as what would be the best way to accomplish the above. Pl advice.

we are using sql server 2005 on both test and dev environemts.

cheers!
d2

Check out SQL Compare from RedGate.

http://www.red-gate.com/

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

Check out Visual Studio Team Suite for Database Professionals

http://msdn2.microsoft.com/en-us/teamsystem/aa718807.aspx

|||Hi Vishal,

Thanks for your response.

We have license for team system but we are not using visual studio for database professionals as yet. Could you pl point me to some good tutorial on this subject.

thanks,
d2
|||

http://msdn2.microsoft.com/en-us/teamsystem/aa718764.aspx

|||i tested SQL Compare [www.red-gate.com] with SQL Server 2005. it is very good tool and it enables you to synchronize changes on DB Schema.|||I have used the VSTS for Database Professionals tool as we have VSTS licenses. It works like a charm.

Thanks for all the advises.

Copy database changes without data

Hi,
This requirement is for our development and test environment. We have
a database server which we use for development hence many changes are
done on the database objects on daily basis like tables def changes,
view def changes, sp changes, new sp etc.
On the other hand our testing team connects to another database server
where they perform testing hence any internal test release would need
the changes like tables def changes, view def changes, sp changes, new
sp etc.
Since testing team already have their test data set in the test
environment hence they want to keep their data but new test release
should only provide with datbase object changes.
I dont do database admin job hence clueless as what would be the best
way to accomplish the above. Pl advice.
we are using sql server 2005 on both test and dev environemts.
cheers!
d2
D2
Visit at http://www.red-gate.com/products/SQL_Compare/index.htm
"D2" <dhapola@.yahoo.com> wrote in message
news:1185784582.666495.164430@.x35g2000prf.googlegr oups.com...
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>
|||* D2 wrote, On 30-7-2007 10:36:
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>
If you're using Visual Studio Team System, have a look at the new
Database professional add-in for the suite.
http://msdn2.microsoft.com/en-us/teamsystem/aa718807.aspx
I can also heartily recommend Red-gate SQL Compare, I've used that
product many times before with great results:
http://www.red-gate.com/products/SQL_Compare/index.htm
Jesse
|||I like xsql. http://www.xsqlsoftware.com/Main.aspx
They have an sdk which is very handy for custom applications.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"D2" <dhapola@.yahoo.com> wrote in message
news:1185784582.666495.164430@.x35g2000prf.googlegr oups.com...
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>

Copy database changes without data

Hi,
This requirement is for our development and test environment. We have
a database server which we use for development hence many changes are
done on the database objects on daily basis like tables def changes,
view def changes, sp changes, new sp etc.
On the other hand our testing team connects to another database server
where they perform testing hence any internal test release would need
the changes like tables def changes, view def changes, sp changes, new
sp etc.
Since testing team already have their test data set in the test
environment hence they want to keep their data but new test release
should only provide with datbase object changes.
I dont do database admin job hence clueless as what would be the best
way to accomplish the above. Pl advice.
we are using sql server 2005 on both test and dev environemts.
cheers!
d2D2
Visit at http://www.red-gate.com/products/SQL_Compare/index.htm
"D2" <dhapola@.yahoo.com> wrote in message
news:1185784582.666495.164430@.x35g2000prf.googlegroups.com...
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>|||* D2 wrote, On 30-7-2007 10:36:
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>
If you're using Visual Studio Team System, have a look at the new
Database professional add-in for the suite.
http://msdn2.microsoft.com/en-us/te...m/aa718807.aspx
I can also heartily recommend Red-gate SQL Compare, I've used that
product many times before with great results:
http://www.red-gate.com/products/SQL_Compare/index.htm
Jesse|||I like xsql. http://www.xsqlsoftware.com/Main.aspx
They have an sdk which is very handy for custom applications.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"D2" <dhapola@.yahoo.com> wrote in message
news:1185784582.666495.164430@.x35g2000prf.googlegroups.com...
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>|||I recommend ApexSQL Diff. http://www.apexsql.com/sql_tools_diff.asp
TheSQLGuru
President
Indicium Resources, Inc.
"D2" <dhapola@.yahoo.com> wrote in message
news:1185784582.666495.164430@.x35g2000prf.googlegroups.com...
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>

Copy database changes without data

Hi,
This requirement is for our development and test environment. We have
a database server which we use for development hence many changes are
done on the database objects on daily basis like tables def changes,
view def changes, sp changes, new sp etc.
On the other hand our testing team connects to another database server
where they perform testing hence any internal test release would need
the changes like tables def changes, view def changes, sp changes, new
sp etc.
Since testing team already have their test data set in the test
environment hence they want to keep their data but new test release
should only provide with datbase object changes.
I dont do database admin job hence clueless as what would be the best
way to accomplish the above. Pl advice.
we are using sql server 2005 on both test and dev environemts.
cheers!
d2D2
Visit at http://www.red-gate.com/products/SQL_Compare/index.htm
"D2" <dhapola@.yahoo.com> wrote in message
news:1185784582.666495.164430@.x35g2000prf.googlegroups.com...
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>|||* D2 wrote, On 30-7-2007 10:36:
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>
If you're using Visual Studio Team System, have a look at the new
Database professional add-in for the suite.
http://msdn2.microsoft.com/en-us/teamsystem/aa718807.aspx
I can also heartily recommend Red-gate SQL Compare, I've used that
product many times before with great results:
http://www.red-gate.com/products/SQL_Compare/index.htm
Jesse|||I like xsql. http://www.xsqlsoftware.com/Main.aspx
They have an sdk which is very handy for custom applications.
--
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"D2" <dhapola@.yahoo.com> wrote in message
news:1185784582.666495.164430@.x35g2000prf.googlegroups.com...
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>|||I recommend ApexSQL Diff. http://www.apexsql.com/sql_tools_diff.asp
--
TheSQLGuru
President
Indicium Resources, Inc.
"D2" <dhapola@.yahoo.com> wrote in message
news:1185784582.666495.164430@.x35g2000prf.googlegroups.com...
> Hi,
> This requirement is for our development and test environment. We have
> a database server which we use for development hence many changes are
> done on the database objects on daily basis like tables def changes,
> view def changes, sp changes, new sp etc.
> On the other hand our testing team connects to another database server
> where they perform testing hence any internal test release would need
> the changes like tables def changes, view def changes, sp changes, new
> sp etc.
> Since testing team already have their test data set in the test
> environment hence they want to keep their data but new test release
> should only provide with datbase object changes.
> I dont do database admin job hence clueless as what would be the best
> way to accomplish the above. Pl advice.
> we are using sql server 2005 on both test and dev environemts.
> cheers!
> d2
>

Sunday, February 12, 2012

converting rows to columns

have a urgent requirement. Please somebody help me.

I have a table departinfo with following records

begin_time end_time Name Pieces

10:00 10:15 PopCorn 3
10:15 10:30 Biscuits 5
10:30 10:45 PopCorn 2

Now I need to run a sql query and the output should be as below :

begin_time end_time PopCorn Biscuits

10:00 10:15 3 0
10:15 10:30 0 5
10:30 10:45 2 0

Please note that only one column i.e. PopCorn is created in spite of
having multiple records in the table. Similarly the records are not
fixed. I mean that
there can be n number of records and the columns should be uniquely
created.

Can somebody help me out
PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZHere's one solution:

CREATE TABLE MyTable
(
begin_time smalldatetime NOT NULL,
end_time smalldatetime NOT NULL,
Name varchar(10) NOT NULL,
Pieces int NOT NULL
CONSTRAINT PK_MyTable PRIMARY KEY
(
begin_time,
end_time,
Name
)
)

INSERT INTO MyTable
SELECT '10:00', '10:15', 'PopCorn', 3
UNION ALL SELECT '10:15', '10:30', 'Biscuits', 5
UNION ALL SELECT '10:30', '10:45', 'PopCorn', 2

SELECT
CONVERT(char(5), a.begin_time, 108) AS begin_time,
CONVERT(char(5), a.end_time, 108) AS end_time,
ISNULL(SUM(b.Pieces), 0) AS PopCorn,
ISNULL(SUM(c.Pieces), 0) AS Biscuits
FROM
(
SELECT DISTINCT
begin_time,
end_time
FROM MyTable
) AS a
LEFT JOIN MyTable b ON
b.begin_time = a.begin_time AND
b.end_time = a.end_time AND
b.Name = 'PopCorn'
LEFT JOIN MyTable c ON
c.begin_time = a.begin_time AND
c.end_time = a.end_time AND
c.Name = 'Biscuits'
GROUP BY
a.begin_time,
a.end_time
ORDER BY
a.begin_time
GO

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Pooj" <poojaahirrao@.hotmail.com> wrote in message
news:94541780.0401100526.5d3178ae@.posting.google.c om...
> have a urgent requirement. Please somebody help me.
> I have a table departinfo with following records
> begin_time end_time Name Pieces
> 10:00 10:15 PopCorn 3
> 10:15 10:30 Biscuits 5
> 10:30 10:45 PopCorn 2
> Now I need to run a sql query and the output should be as below :
> begin_time end_time PopCorn Biscuits
> 10:00 10:15 3 0
> 10:15 10:30 0 5
> 10:30 10:45 2 0
> Please note that only one column i.e. PopCorn is created in spite of
> having multiple records in the table. Similarly the records are not
> fixed. I mean that
> there can be n number of records and the columns should be uniquely
> created.
>
> Can somebody help me out
PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZ|||Hi

Check out a crosstab query that will transform your rows to columns:

http://support.microsoft.com/defaul...b;EN-US;q175574

There are many posts about pivot tables or crosstab queries.. Search google
for more.

John

"Pooj" <poojaahirrao@.hotmail.com> wrote in message
news:94541780.0401100526.5d3178ae@.posting.google.c om...
> have a urgent requirement. Please somebody help me.
> I have a table departinfo with following records
> begin_time end_time Name Pieces
> 10:00 10:15 PopCorn 3
> 10:15 10:30 Biscuits 5
> 10:30 10:45 PopCorn 2
> Now I need to run a sql query and the output should be as below :
> begin_time end_time PopCorn Biscuits
> 10:00 10:15 3 0
> 10:15 10:30 0 5
> 10:30 10:45 2 0
> Please note that only one column i.e. PopCorn is created in spite of
> having multiple records in the table. Similarly the records are not
> fixed. I mean that
> there can be n number of records and the columns should be uniquely
> created.
>
> Can somebody help me out
PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZ|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:<btp2ft$h0i$1@.titan.btinternet.com>...
> Hi
> Check out a crosstab query that will transform your rows to columns:
> http://support.microsoft.com/defaul...b;EN-US;q175574
> There are many posts about pivot tables or crosstab queries.. Search google
> for more.
> John
> "Pooj" <poojaahirrao@.hotmail.com> wrote in message
> news:94541780.0401100526.5d3178ae@.posting.google.c om...
> > have a urgent requirement. Please somebody help me.
> > I have a table departinfo with following records
> > begin_time end_time Name Pieces
> > 10:00 10:15 PopCorn 3
> > 10:15 10:30 Biscuits 5
> > 10:30 10:45 PopCorn 2
> > Now I need to run a sql query and the output should be as below :
> > begin_time end_time PopCorn Biscuits
> > 10:00 10:15 3 0
> > 10:15 10:30 0 5
> > 10:30 10:45 2 0
> > Please note that only one column i.e. PopCorn is created in spite of
> > having multiple records in the table. Similarly the records are not
> > fixed. I mean that
> > there can be n number of records and the columns should be uniquely
> > created.
> > Can somebody help me out
> PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZ
> ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZ

Another solution would be using a union statement

select * from departinfo where popcorn = 0
union select * from departinfo where bisuits = 0
order by begin_time|||Hello Dan,
Thanks for the quick response !
The solution you have provided wil not solve my problem due to
following reason :

The departinfo table records are not fixed as shown below. The time
difference can vary also the remainig data. The table will be
populated in the following format. Only the format is fixed the
records are not.

begin_datetime end_datetime Name Pieces

So my requirement is to convert the Name field into unique distinct
columns and match the pieces.
for example if the Name field contains items like Biscuits, Pizza,
PopCorn
then these many columns should be created and matched with the pieces.
Please help !
Thanks
Pooj

"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message news:<8HTLb.1542$i4.11@.newsread1.news.atl.earthlink.net>...
> Here's one solution:
> CREATE TABLE MyTable
> (
> begin_time smalldatetime NOT NULL,
> end_time smalldatetime NOT NULL,
> Name varchar(10) NOT NULL,
> Pieces int NOT NULL
> CONSTRAINT PK_MyTable PRIMARY KEY
> (
> begin_time,
> end_time,
> Name
> )
> )
> INSERT INTO MyTable
> SELECT '10:00', '10:15', 'PopCorn', 3
> UNION ALL SELECT '10:15', '10:30', 'Biscuits', 5
> UNION ALL SELECT '10:30', '10:45', 'PopCorn', 2
> SELECT
> CONVERT(char(5), a.begin_time, 108) AS begin_time,
> CONVERT(char(5), a.end_time, 108) AS end_time,
> ISNULL(SUM(b.Pieces), 0) AS PopCorn,
> ISNULL(SUM(c.Pieces), 0) AS Biscuits
> FROM
> (
> SELECT DISTINCT
> begin_time,
> end_time
> FROM MyTable
> ) AS a
> LEFT JOIN MyTable b ON
> b.begin_time = a.begin_time AND
> b.end_time = a.end_time AND
> b.Name = 'PopCorn'
> LEFT JOIN MyTable c ON
> c.begin_time = a.begin_time AND
> c.end_time = a.end_time AND
> c.Name = 'Biscuits'
> GROUP BY
> a.begin_time,
> a.end_time
> ORDER BY
> a.begin_time
> GO
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Pooj" <poojaahirrao@.hotmail.com> wrote in message
> news:94541780.0401100526.5d3178ae@.posting.google.c om...
> > have a urgent requirement. Please somebody help me.
> > I have a table departinfo with following records
> > begin_time end_time Name Pieces
> > 10:00 10:15 PopCorn 3
> > 10:15 10:30 Biscuits 5
> > 10:30 10:45 PopCorn 2
> > Now I need to run a sql query and the output should be as below :
> > begin_time end_time PopCorn Biscuits
> > 10:00 10:15 3 0
> > 10:15 10:30 0 5
> > 10:30 10:45 2 0
> > Please note that only one column i.e. PopCorn is created in spite of
> > having multiple records in the table. Similarly the records are not
> > fixed. I mean that
> > there can be n number of records and the columns should be uniquely
> > created.
> > Can somebody help me out
> PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZ
> ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZ|||Hi John,

Thanks for the quick reply.I checked the link u have provided but it
seems it
won't solve my problem b'coz DaypartInfo table records are not fixed.
They can vary E.g.my table format is as below:
begin_time end_time Name Pieces

10:00 10:15 PopCorn 3
10:15 10:30 Biscuits 5
10:30 10:45 PopCorn 2

In this table I want to convert the Nae field records as columns i.e.
Name field may contain PoCorn ,Pizza ,Biscuits,Cheese etc . Basically
these records can vary and those should be converted as columns at
runtime...

Please help...

Thanks,
Pooj.

"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:<btp2ft$h0i$1@.titan.btinternet.com>...
> Hi
> Check out a crosstab query that will transform your rows to columns:
> http://support.microsoft.com/defaul...b;EN-US;q175574
> There are many posts about pivot tables or crosstab queries.. Search google
> for more.
> John
> "Pooj" <poojaahirrao@.hotmail.com> wrote in message
> news:94541780.0401100526.5d3178ae@.posting.google.c om...
> > have a urgent requirement. Please somebody help me.
> > I have a table departinfo with following records
> > begin_time end_time Name Pieces
> > 10:00 10:15 PopCorn 3
> > 10:15 10:30 Biscuits 5
> > 10:30 10:45 PopCorn 2
> > Now I need to run a sql query and the output should be as below :
> > begin_time end_time PopCorn Biscuits
> > 10:00 10:15 3 0
> > 10:15 10:30 0 5
> > 10:30 10:45 2 0
> > Please note that only one column i.e. PopCorn is created in spite of
> > having multiple records in the table. Similarly the records are not
> > fixed. I mean that
> > there can be n number of records and the columns should be uniquely
> > created.
> > Can somebody help me out
> PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZ
> ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZ|||Hi

This may help...

http://www.sqlteam.com/item.asp?ItemID=2955

John|||You can do this very easily and without any
sql coding with the RAC utility for S2k.
It can be used to generate dynamic crosstabs
and solve all types of problems in an easy way.
It's similar in concept to Access crosstab but
much more powerful.

RAC v2.2 and QALite @.
www.rac4sql.net