Showing posts with label customer. Show all posts
Showing posts with label customer. Show all posts

Friday, March 30, 2012

How can I restore a SQL 2005 database on my SQL 2000?

My customer has SQL Server 2005. I have SQL Server 2000 on my laptop (on XP Pro). I believe I have an empty database the same as theirs, but I need to restore their data. They sent me a normal SQL Backup, but my laptop threw a fit and cannot work with it.

They are now trying to export the database to Microsoft Access and send me that, but I won't get that until next week now. However is there a better and easier solution for those of us with insufficient experience of this, please?

Many thanks,
CasparThere is no way to restore SQL 2005 backup on SQL 2000.

Easiest way in this case is - install Express Edition of SQL 2005, restore your backup there and then import it to SQL 2000.|||Or you might consider skipping the import to SQL 2000, and just work on it using SQL 2005 Express on your laptop.

-PatP|||Thank you so much for this advice. I am in the process of trying it, having found downloads at: http://msdn.microsoft.com/vstudio/express/sql/download/ where I am offered 2 choices - I have chosen the left-hand pair of files for a simpler setup.

If I am successful in restoring the database to this then if I do decided I want to import it into SQL 2000 then how to I go about that, please?

Many thanks,
Caspar

Wednesday, March 21, 2012

how can I manage MSDE with SQL?

please I need some help about how can I get MSDE for VB6 and I want to know how to manage this on th Customer machineWhat do you mean by manage?|||Download MSDE from here:

http://www.microsoft.com/sql/msde/downloads/download.asp

Here is a web based administrative tool:

http://www.microsoft.com/downloads/details.aspx?FamilyId=C039A798-C57A-419E-ACBC-2A332CB7F959&displaylang=en

If you want a Windows based administrative tool, you can use the SQL Server 2005 Express Manager to manage MSDE:

http://www.microsoft.com/downloads/details.aspx?familyid=C7A5CC62-EC54-4299-85FC-BA05C181ED55&displaylang=en

Before you can install the Express Manager, you must install SQL Server 2005 Express:

http://www.microsoft.com/downloads/details.aspx?familyid=1A722B0F-6CCA-4E8B-B6EA-12D9C450ED92&displaylang=en
sql

Friday, March 9, 2012

How can I insert a column using a script (instead of appending)?

Hi,

I recently had to add a new column to a table that resides off-site,
in a customer's environment. Previously, the table had around 300
columns, all of which were in alphabetical order.

I found that the ALTER TABLE command appeared to be only capable of
appending a new column, but wasn't capable of inserting one into the
middle of the table.

Since alphabetical order wasn't a requirement, but just a "nice to
look at" feature, I appended it anyway, and forgot about it.

Anyone know of a clever way to do this though?

Curiously,

Warren Wright
Scorex Development TeamWarren Wright (warren.wright@.us.scorex.com) writes:
> I recently had to add a new column to a table that resides off-site,
> in a customer's environment. Previously, the table had around 300
> columns, all of which were in alphabetical order.
> I found that the ALTER TABLE command appeared to be only capable of
> appending a new column, but wasn't capable of inserting one into the
> middle of the table.
> Since alphabetical order wasn't a requirement, but just a "nice to
> look at" feature, I appended it anyway, and forgot about it.
> Anyone know of a clever way to do this though?

The "clever" way is to fiddle with syscolumns, but I highly discourge
from this.

The normal way is to go the long way: rename the old table, create
the new table including triggers, constrains and clustered index, insert
data from the old table to the new, move referencing foreign keys, drop the
old table. Restore non-clustered index.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Wednesday, March 7, 2012

how can i give customize dataset to sql report

hi
i am new to sql reporting service, i am using for financial reporting,
in one of my requirement i have to calculate how much year customer's fund
will last and i have to show each year's balance.
in crystal report i get directly assign dataset, but how can i
assign dataset in reporting service, plz so urgentIn SSRS, you can assign an application dataset to server-based report only
if you use a custom dataset extension. In your case, I will gravitate toward
performing the data manipulation at the data source level, e.g. inside a
stored procedure. If you use SQL Server 2005 as a data source, consider
using a CLR stored procedure.
I demonstrate how this could be done in this code sample
(http://www.prologika.com/downloads/Pass/). The report invokes a CLR stored
procedure that uses data mining for sales forecasting.
As a side note, for financial reporting, I strongly suggest you evaluate
Analysis Services especially if you need to support account charts where
values substract or add (income, expenses, etc). Otherwise, you may find
yourself reinventing the wheel. I know from personal experience.
HTH
--
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Lovenish" <Lovenish@.discussions.microsoft.com> wrote in message
news:CE811BDF-1C05-4C34-9853-166E60A39D65@.microsoft.com...
> hi
> i am new to sql reporting service, i am using for financial reporting,
> in one of my requirement i have to calculate how much year customer's fund
> will last and i have to show each year's balance.
> in crystal report i get directly assign dataset, but how can i
> assign dataset in reporting service, plz so urgent|||Thx Teo Lachev,
but the code you have send is i think in visual studio 2005, i am
using 2003. so can u help me further,
u were talking about customize dataset extension but i cant get how to use
this so plz plz help me

Friday, February 24, 2012

how can i get such a result set?

For example I hv got a table 'Customer' like this:

Customer_name Customer_phone
Iverson 1234567
Kobe 2345678
Tmac 3456789
Wade 5678901
James 6789012
Bosh 7890123
Iverson 8901234
Wade 9012345
James 2987654
Iverson 3567890

.

.

.

.

And now I want to get a display like this:

Customer_name Customer_phone1 Customer_phone2 Customer_phone3
Iverson 1234567 8901234
3567890
Wade 5678901 9012345
James 6789012 2987654
Kobe 2345678
Tmac 3456789
Bosh 7890123

Please note that I don't know how many columns (Customer_phone) would appear, i just want to display all. how can i do it? thanks!

How about below one, (need SQL Server 2005).

-

Code Snippet

create table
CREATE TABLE [dbo].[T1546140](
[Customer_name] [varchar](50) NOT NULL,
[Customer_phone] [varchar](50) NOT NULL
) ON [PRIMARY];

-- insert test data
insert into T1546140 values ('Iverson','1234567');
insert into T1546140 values ('Kobe','2345678');
insert into T1546140 values ('Tmac','3456789');
insert into T1546140 values ('Wade','5678901');
insert into T1546140 values ('James','6789012');
insert into T1546140 values ('Bosh','7890123');
insert into T1546140 values ('Iverson','8901234');
insert into T1546140 values ('Wade','9012345');
insert into T1546140 values ('James','2987654');
insert into T1546140 values ('Iverson','3567890');

-- declare values
declare @.phoneCount int;
declare @.query nvarchar(max);
declare @.n int;

-- get max phone count;
select @.phoneCount = max(c)
from
(
select Customer_name, count(*) as c
from T1546140 (nolock)
group by customer_name
) cn

-- build a query for
set @.query =
N'
select
Customer_name,
';

set @.n = 1
while @.n <= @.phoneCount
begin
set @.query = @.query
+ N'[' + convert(varchar, @.n) + ']'
+ N' as Customer_phone' + convert(varchar, @.n);
if @.n < @.phoneCount
set @.query = @.query + ',';
set @.n = @.n + 1;
end

set @.query = @.query
+
N'
from
(
select
Customer_name,
Customer_phone,
ROW_NUMBER() OVER (PARTITION BY Customer_name ORDER BY Customer_phone) as [phone_number]
from T1546140 (nolock)
group by
Customer_name,
Customer_phone
) as c
PIVOT
(
max(Customer_phone)
for [phone_number]
in (
';

set @.n = 1
while @.n <= @.phoneCount
begin
set @.query = @.query
+ N'[' + convert(varchar, @.n) + ']';
if @.n < @.phoneCount
set @.query = @.query + ',';
set @.n = @.n + 1;
end

set @.query = @.query +
N'
)
) as p
order by
Customer_name
';

-- dump a query for debug purpose
print @.query;

-- execute query
exec sp_executesql @.query;

-- end;

This program create and execute below query.

Code Snippet

select
Customer_name,
[1] as Customer_phone1,
[2] as Customer_phone2,
[3] as Customer_phone3
from
(
select
Customer_name,
Customer_phone,
ROW_NUMBER() OVER (PARTITION BY Customer_name ORDER BY Customer_phone) as [phone_number]
from T1546140 (nolock)
group by
Customer_name,
Customer_phone
) as c
PIVOT
(
max(Customer_phone)
for [phone_number]
in ([1], [2], [3])
) as p
order by
Customer_name

|||

sorry this may not help because as i said before, i don't know how many phone columns would appear, so if one customer has 6000 phone no., then does that mean i hv to

select
Customer_name,
[1] as Customer_phone1,
[2] as Customer_phone2,
[3] as Customer_phone3,

.

.

.

.

.

[6000] as Customer_phone 6000

that ain't work i think, but thanks a lot buddy