Showing posts with label procedure. Show all posts
Showing posts with label procedure. Show all posts

Monday, March 26, 2012

Miningmodel-Viewer: Parser Error

Parser for XMLA (XML for Analysis): Timeout geting XMLA-Request (XML for Analysis).
Error when executing the administrated stored procedure 'GetItemsets': Exception has been thrown by the target of an invocation.Microsoft::AnalysisServices::AdomdServer::AdomdException.

I get this Error in Miningmodel-Viewer, what to do? This occurs when I set the MAXIMUM_ITEMSET_COUNT to 1,500,000 .

The same problem was solved in thread "Lift chart - Time out error SSAS data minign 2005 "

Monday, March 12, 2012

mildly complex query. need senior dba advise.

Hi there,
I have this stored procedure I am trying to optimize:
CREATE PROCEDURE uspLeaderboardStateResults
@.StateID int
AS
BEGIN
CREATE TABLE #ResultsOutput (
rowID int not null identity(1,1),
Rank int,
MemberID int,
MemberCode varchar(50),
State varchar(5),
MemberName varchar(510),
StateID int,
TotalScore int,
TotalEvents int,
PRIMARY KEY (TotalScore, MemberID, rowID),
UNIQUE(TotalScore, MemberID, rowID)
)
CREATE TABLE #TotalScoreCount (
rowID int not null identity(1,1),
TotalScore int,
TotalScoreCount int
PRIMARY KEY (TotalScoreCount, TotalScore, rowID),
UNIQUE (TotalScoreCount, TotalScore, rowID)
)
INSERT INTO #ResultsOutput
SELECT 0, --rank. gets updated later.
Results.MemberID,
Members.MemberCode,
Members.State,
Members.FirstName + ' ' + Members.Surname,
State.StateID,
SUM(Results.Score) AS TotalScore,
COUNT(Results.ResultsID) AS TotalEvents
FROM Members
INNER JOIN Results ON Members.MemberID = Results.MemberID
INNER JOIN Event ON Results.EventID = Event.EventID
INNER JOIN Venue ON Event.VenueID = Venue.VenueID
INNER JOIN Region ON Venue.RegionID = Region.RegionID
INNER JOIN State ON Region.StateID = State.StateID
WHERE Results.Valid = 1 AND Event.EventType = 0 AND State.StateID =
@.StateID
GROUP BY Results.MemberID,
Members.MemberCode,
Members.State,
Members.FirstName,
Members.Surname,
State.StateID
ORDER BY TotalScore DESC, Results.MemberID ASC
INSERT INTO #TotalScoreCount
SELECT TotalScore,
COUNT(TotalScore) AS TotalScoreCount
FROM #ResultsOutput
GROUP BY TotalScore
ORDER BY TotalScore DESC
UPDATE #ResultsOutput
SET Rank = (SELECT ISNULL(SUM(TSC.TotalScoreCount), 0) FROM
#TotalScoreCount TSC WHERE TSC.TotalScore > RO.TotalScore) + 1
FROM #ResultsOutput RO
SELECT * FROM #ResultsOutput ORDER BY TotalScore DESC, MemberID ASC
DROP table #ResultsOutput
DROP table #TotalScoreCount
END
I did a SQL Execution plan and saw no table scans on my selects/updates
(Only on my inserts ofcourse)
The query still runs poorly it takes up to 7 seconds to run!
Members has 44621 rows
Results has 121158
Venue has 336
Event has 3298
Region has 58
I am quite new and poor at SQL so any help would be appreciated.
Thanks!to be perfectly honest... its not 'that' bad already.
You could try using table variable (sql2k +) instead of temp table and also
remove the order by on the insert as you are ordering the select after
anyway.
<robert@.relate.com.au> wrote in message
news:1147350229.650320.155550@.g10g2000cwb.googlegroups.com...
> Hi there,
> I have this stored procedure I am trying to optimize:
>
> CREATE PROCEDURE uspLeaderboardStateResults
> @.StateID int
> AS
> BEGIN
> CREATE TABLE #ResultsOutput (
> rowID int not null identity(1,1),
> Rank int,
> MemberID int,
> MemberCode varchar(50),
> State varchar(5),
> MemberName varchar(510),
> StateID int,
> TotalScore int,
> TotalEvents int,
> PRIMARY KEY (TotalScore, MemberID, rowID),
> UNIQUE(TotalScore, MemberID, rowID)
> )
> CREATE TABLE #TotalScoreCount (
> rowID int not null identity(1,1),
> TotalScore int,
> TotalScoreCount int
> PRIMARY KEY (TotalScoreCount, TotalScore, rowID),
> UNIQUE (TotalScoreCount, TotalScore, rowID)
> )
>
> INSERT INTO #ResultsOutput
> SELECT 0, --rank. gets updated later.
> Results.MemberID,
> Members.MemberCode,
> Members.State,
> Members.FirstName + ' ' + Members.Surname,
> State.StateID,
> SUM(Results.Score) AS TotalScore,
> COUNT(Results.ResultsID) AS TotalEvents
> FROM Members
> INNER JOIN Results ON Members.MemberID = Results.MemberID
> INNER JOIN Event ON Results.EventID = Event.EventID
> INNER JOIN Venue ON Event.VenueID = Venue.VenueID
> INNER JOIN Region ON Venue.RegionID = Region.RegionID
> INNER JOIN State ON Region.StateID = State.StateID
> WHERE Results.Valid = 1 AND Event.EventType = 0 AND State.StateID =
> @.StateID
> GROUP BY Results.MemberID,
> Members.MemberCode,
> Members.State,
> Members.FirstName,
> Members.Surname,
> State.StateID
> ORDER BY TotalScore DESC, Results.MemberID ASC
>
> INSERT INTO #TotalScoreCount
> SELECT TotalScore,
> COUNT(TotalScore) AS TotalScoreCount
> FROM #ResultsOutput
> GROUP BY TotalScore
> ORDER BY TotalScore DESC
> UPDATE #ResultsOutput
> SET Rank = (SELECT ISNULL(SUM(TSC.TotalScoreCount), 0) FROM
> #TotalScoreCount TSC WHERE TSC.TotalScore > RO.TotalScore) + 1
> FROM #ResultsOutput RO
>
> SELECT * FROM #ResultsOutput ORDER BY TotalScore DESC, MemberID ASC
> DROP table #ResultsOutput
> DROP table #TotalScoreCount
> END
>
> I did a SQL Execution plan and saw no table scans on my selects/updates
> (Only on my inserts ofcourse)
> The query still runs poorly it takes up to 7 seconds to run!
> Members has 44621 rows
> Results has 121158
> Venue has 336
> Event has 3298
> Region has 58
> I am quite new and poor at SQL so any help would be appreciated.
> Thanks!
>|||Well, 7 seconds is hardly poor.
Anyway, make sure you have the following indexes:
- on Members(MemberID)
- on Results(EventID, MemberID, Valid)
- on Results(MemberID, EventID, Valid)
- on Event(EventID, VenueID, EventType)
- on Event(VenueID, EventID, EventType)
- on Venue(VenueID, RegionID)
- on Venue(RegionID, VenueID)
- on Region(RegionID, StateID)
- on Region(StateID, RegionID)
- on State(StateID)
and then try the SP below. Of course, you can remove the indexes that
you created above if they are not used in the query below.
CREATE PROCEDURE uspLeaderboardStateResults
@.StateID int
AS
BEGIN
SET NOCOUNT ON
CREATE TABLE #ResultsOutput
(MemberID int
,MemberCode varchar(50)
,State varchar(5)
,MemberName varchar(510)
,StateID int
,TotalScore int
,TotalEvents int
)
INSERT INTO #ResultsOutput (MemberID, MemberCode, State, MemberName,
StateID, TotalScore, TotalEvents)
SELECT Results.MemberID
, MAX(Members.MemberCode)
, MAX(Members.State)
, MAX(Members.FirstName + ' ' + Members.Surname)
, MAX(State.StateID)
, SUM(Results.Score)
, COUNT(Results.ResultsID)
FROM Members
INNER JOIN Results ON Results.MemberID = Members.MemberID
INNER JOIN Event ON Event.EventID = Results.EventID
INNER JOIN Venue ON Venue.VenueID = Event.VenueID
INNER JOIN Region ON Region.RegionID = Venue.RegionID
INNER JOIN State ON State.StateID = Region.StateID
WHERE Results.Valid = 1
AND Event.EventType = 0
AND State.StateID = @.StateID
GROUP BY Results.MemberID
Declare @.SQL varchar(1000)
Set @.SQL='CREATE NONCLUSTERED INDEX IX_ResultOutput_spid'+CAST(@.@.spid
as varchar(12))+' ON #ResultsOutput(TotalScore)'
EXEC (@.SQL)
SELECT
ISNULL((
SELECT COUNT(*)
FROM #ResultsOutput R2
WHERE R2.TotalScore > R1.TotalScore
),0)+1 AS Rank
,MemberID
,MemberCode
,State
,MemberName
,StateID
,TotalScore
,TotalEvents
FROM #ResultsOutput R1
ORDER BY TotalScore DESC, MemberID ASC
DROP TABLE #ResultsOutput
END
Hope this helps,
Gert-Jan
"robert@.relate.com.au" wrote:
> Hi there,
> I have this stored procedure I am trying to optimize:
> CREATE PROCEDURE uspLeaderboardStateResults
> @.StateID int
> AS
> BEGIN
> CREATE TABLE #ResultsOutput (
> rowID int not null identity(1,1),
> Rank int,
> MemberID int,
> MemberCode varchar(50),
> State varchar(5),
> MemberName varchar(510),
> StateID int,
> TotalScore int,
> TotalEvents int,
> PRIMARY KEY (TotalScore, MemberID, rowID),
> UNIQUE(TotalScore, MemberID, rowID)
> )
> CREATE TABLE #TotalScoreCount (
> rowID int not null identity(1,1),
> TotalScore int,
> TotalScoreCount int
> PRIMARY KEY (TotalScoreCount, TotalScore, rowID),
> UNIQUE (TotalScoreCount, TotalScore, rowID)
> )
> INSERT INTO #ResultsOutput
> SELECT 0, --rank. gets updated later.
> Results.MemberID,
> Members.MemberCode,
> Members.State,
> Members.FirstName + ' ' + Members.Surname,
> State.StateID,
> SUM(Results.Score) AS TotalScore,
> COUNT(Results.ResultsID) AS TotalEvents
> FROM Members
> INNER JOIN Results ON Members.MemberID = R
esults.MemberID
> INNER JOIN Event ON Results.EventI
D = Event.EventID
> INNER JOIN Venue ON Event.
VenueID = Venue.VenueID
> INNER JOIN Region
ON Venue.RegionID = Region.RegionID
> INNER JOIN
State ON Region.StateID = State.StateID
> WHERE Results.Valid = 1 AND Event.EventType = 0
AND State.StateID =
> @.StateID
> GROUP BY Results.MemberID,
> Members.MemberCode,
> Members.State,
> Members.FirstName,
> Members.Surname,
> State.StateID
> ORDER BY TotalScore DESC, Results.MemberID ASC
> INSERT INTO #TotalScoreCount
> SELECT TotalScore,
> COUNT(TotalScore) AS TotalScoreCount
> FROM #ResultsOutput
> GROUP BY TotalScore
> ORDER BY TotalScore DESC
> UPDATE #ResultsOutput
> SET Rank = (SELECT ISNULL(SUM(TSC.TotalScoreCount), 0) FRO
M
> #TotalScoreCount TSC WHERE TSC.TotalScore > RO.TotalScore) + 1
> FROM #ResultsOutput RO
> SELECT * FROM #ResultsOutput ORDER BY TotalScore DESC, MemberID AS
C
> DROP table #ResultsOutput
> DROP table #TotalScoreCount
> END
> I did a SQL Execution plan and saw no table scans on my selects/updates
> (Only on my inserts ofcourse)
> The query still runs poorly it takes up to 7 seconds to run!
> Members has 44621 rows
> Results has 121158
> Venue has 336
> Event has 3298
> Region has 58
> I am quite new and poor at SQL so any help would be appreciated.
> Thanks!|||Try moving the filters from the where clause because they get applied
after building the set of rows from the JOIN statements. Also, the
JOIN to States doesn't appear to be needed because the StateID can be
filltered directly from Results.
This may be faster:
INSERT INTO #ResultsOutput
SELECT 0, --rank. gets updated later.
Results.MemberID,
Members.MemberCode,
Members.State,
Members.FirstName + ' ' +
Members.Surname,
State.StateID,
SUM(Results.Score) AS TotalScore,
COUNT(Results.ResultsID) AS TotalEvents
FROM Members
INNER JOIN Results ON Members.MemberID =
Results.MemberID AND Results.Valid = 1
INNER JOIN Event ON Results.EventID = Event.EventID AND
Event.EventType = 0
INNER JOIN Venue ON Event.VenueID = Venue.VenueID
INNER JOIN Region ON Venue.RegionID = Region.RegionID
AND Region.StateID = @.StateID
GROUP BY Results.MemberID,
Members.MemberCode,
Members.State,
Members.FirstName,
Members.Surname,
State.StateID|||On Thu, 11 May 2006 20:56:02 +0200, Gert-Jan Strik wrote:

> Declare @.SQL varchar(1000)
> Set @.SQL='CREATE NONCLUSTERED INDEX IX_ResultOutput_spid'+CAST(@.@.spid
>as varchar(12))+' ON #ResultsOutput(TotalScore)'
> EXEC (@.SQL)
Hi Gert-Jan,
Why are you addind the spid to the index name here? I have always been
under the assumption that you only have to prefix indexes on temp tables
with the # symbol, just like you do with temp tables.
In fact, I just tested this. I executed the code below from two
different connections in SSMS and didn't get an error:
create table #test (a int)
go
create nonclustered index #ind on #test(a)
go
Hugo Kornelis, SQL Server MVP|||Thanks for the tip. It was about time that I learnt something new :-)
Gert-Jan
Hugo Kornelis wrote:
> On Thu, 11 May 2006 20:56:02 +0200, Gert-Jan Strik wrote:
>
> Hi Gert-Jan,
> Why are you addind the spid to the index name here? I have always been
> under the assumption that you only have to prefix indexes on temp tables
> with the # symbol, just like you do with temp tables.
> In fact, I just tested this. I executed the code below from two
> different connections in SSMS and didn't get an error:
> create table #test (a int)
> go
> create nonclustered index #ind on #test(a)
> go
> --
> Hugo Kornelis, SQL Server MVP|||Thanks for everyone's help everyone. Immy, i originally was using table
variables but was gettign table scans because of lack of indexing.
I guess i'm going to have to setup a scheduled task to run a stored
proc that will run every half an hour to do that 1 query and select it
all into a table with every field in one row and already sorted, that
way when my website application goes to run it only has to do a simple
select.
Thanks again all for confirming nothings majorly wrong.

Friday, March 9, 2012

Migration SQL server 2000 to 2005, with heavy use of DTS

We have a big migration from SQL server 2000 to 2005
It is a big procedure aith millions of records and it uses DTSs
heavily, so I am asking some hints on s your experience on
1. "basic" migration of DB ib itself
2. DTS: we read that the Dynamic Properties used by DTS are NOT fully
supported and that would be a great problem for us
Any reporting of other known issues - small, medium or big -
will be greatly appreciated.
Thank you so muchSeveral things to do, the ones I remember:
1) Check BOL section 'Upgrading to SQL Server 2005', 'Backward
Compatibility'. Look for deprecated and discontinued features, breaking
changes and behavior changes.
2) Use the SQL Server Upgrade Advisor and follow its recommendations
3) You may want to consider moving the DTS packages without converting to
SSIS. Check also 'Upgrading to SQL Server 2005', 'Backward Compatibility' fo
r
DTS.
4) Test everything.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"baruffa66@.gmail.com" wrote:

> We have a big migration from SQL server 2000 to 2005
> It is a big procedure aith millions of records and it uses DTSs
> heavily, so I am asking some hints on s your experience on
> 1. "basic" migration of DB ib itself
> 2. DTS: we read that the Dynamic Properties used by DTS are NOT fully
> supported and that would be a great problem for us
> Any reporting of other known issues - small, medium or big -
> will be greatly appreciated.
> Thank you so much
>|||Hi,
First, if you have not yet done so, get the "Microsoft SQL Server 2005
Upgrade Advisor". You can run this against your SQL Server 2000 server and
it will produce a report on problem areas that you may need to fix. We did
not have much problem, but the old style outer joins (*=, =*) are
deprecated. Also, if you have code that uses system tables some of those
have changed or vanished.
Passwords on 2005 are case-sensitive. This will cause you some problems if
you have code registered to login with a password in a different case from
that stored on the server. (SQL Server 2000 would forgive that, 2005 will
not.)
Since you are DTS heavy, there are "Microsoft SQL Server 2005 Backward
Compatibility Components" and the "Microsoft SQL Server 2000 DTS Designer
Components" to run on SQL Server 2005. Of course, it is the course of
wisdom to upgrade your packages to SSIS prior to SQL Server 2008, but this
can get you into SQL Server 2005 faster, and let you catch up on your DTS
packages one at a time, rather than all at once.
http://technet.microsoft.com/en-us/...aspx#designtime
These additional packages can be found at Feature Pack for Microsoft SQL
Server 2005 - February 2007
a42ec403d17&displaylang=en" target="_blank">http://www.microsoft.com/downloads/...&displaylang=en
RLF
<baruffa66@.gmail.com> wrote in message
news:b48d3fdf-2700-4855-b220-7bd616f33e40@.n20g2000hsh.googlegroups.com...
> We have a big migration from SQL server 2000 to 2005
> It is a big procedure aith millions of records and it uses DTSs
> heavily, so I am asking some hints on s your experience on
> 1. "basic" migration of DB ib itself
> 2. DTS: we read that the Dynamic Properties used by DTS are NOT fully
> supported and that would be a great problem for us
> Any reporting of other known issues - small, medium or big -
> will be greatly appreciated.
> Thank you so much|||Ben and Russel,
thanks a lot.
We asked 5 professionals,
4 of them have not even indirect experience on this migration,
the fifth says that he didn't migrate but is using a module of 2005
that allows to keep those oldies but goodies DTS
and launch them from 2005, without migrating to the new SSIS.
Ciao

Migration SQL server 2000 to 2005, with heavy use of DTS

We have a big migration from SQL server 2000 to 2005
It is a big procedure aith millions of records and it uses DTSs
heavily, so I am asking some hints on s your experience on
1. "basic" migration of DB ib itself
2. DTS: we read that the Dynamic Properties used by DTS are NOT fully
supported and that would be a great problem for us
Any reporting of other known issues - small, medium or big -
will be greatly appreciated.
Thank you so muchSeveral things to do, the ones I remember:
1) Check BOL section 'Upgrading to SQL Server 2005', 'Backward
Compatibility'. Look for deprecated and discontinued features, breaking
changes and behavior changes.
2) Use the SQL Server Upgrade Advisor and follow its recommendations
3) You may want to consider moving the DTS packages without converting to
SSIS. Check also 'Upgrading to SQL Server 2005', 'Backward Compatibility' for
DTS.
4) Test everything.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"baruffa66@.gmail.com" wrote:
> We have a big migration from SQL server 2000 to 2005
> It is a big procedure aith millions of records and it uses DTSs
> heavily, so I am asking some hints on s your experience on
> 1. "basic" migration of DB ib itself
> 2. DTS: we read that the Dynamic Properties used by DTS are NOT fully
> supported and that would be a great problem for us
> Any reporting of other known issues - small, medium or big -
> will be greatly appreciated.
> Thank you so much
>|||Hi,
First, if you have not yet done so, get the "Microsoft SQL Server 2005
Upgrade Advisor". You can run this against your SQL Server 2000 server and
it will produce a report on problem areas that you may need to fix. We did
not have much problem, but the old style outer joins (*=, =*) are
deprecated. Also, if you have code that uses system tables some of those
have changed or vanished.
Passwords on 2005 are case-sensitive. This will cause you some problems if
you have code registered to login with a password in a different case from
that stored on the server. (SQL Server 2000 would forgive that, 2005 will
not.)
Since you are DTS heavy, there are "Microsoft SQL Server 2005 Backward
Compatibility Components" and the "Microsoft SQL Server 2000 DTS Designer
Components" to run on SQL Server 2005. Of course, it is the course of
wisdom to upgrade your packages to SSIS prior to SQL Server 2008, but this
can get you into SQL Server 2005 faster, and let you catch up on your DTS
packages one at a time, rather than all at once.
http://technet.microsoft.com/en-us/library/ms143706.aspx#designtime
These additional packages can be found at Feature Pack for Microsoft SQL
Server 2005 - February 2007
http://www.microsoft.com/downloads/details.aspx?FamilyID=50b97994-8453-4998-8226-fa42ec403d17&displaylang=en
RLF
<baruffa66@.gmail.com> wrote in message
news:b48d3fdf-2700-4855-b220-7bd616f33e40@.n20g2000hsh.googlegroups.com...
> We have a big migration from SQL server 2000 to 2005
> It is a big procedure aith millions of records and it uses DTSs
> heavily, so I am asking some hints on s your experience on
> 1. "basic" migration of DB ib itself
> 2. DTS: we read that the Dynamic Properties used by DTS are NOT fully
> supported and that would be a great problem for us
> Any reporting of other known issues - small, medium or big -
> will be greatly appreciated.
> Thank you so much|||Ben and Russel,
thanks a lot.
We asked 5 professionals,
4 of them have not even indirect experience on this migration,
the fifth says that he didn't migrate but is using a module of 2005
that allows to keep those oldies but goodies DTS
and launch them from 2005, without migrating to the new SSIS.
Ciao

Migration of Extended Stored Procedure

Hi ,

Any Body can help in knowing, How i can migrate the Extended Stored Procedure from one server to another.

Hi,

sure you can simply copy the dll which contains the logic for the xp to the new server in the BINN directory and run the command:

exec sp_addextendedproc 'xp_proc_Name', 'xplibrary.dll'

That′s it.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

Wednesday, March 7, 2012

Migration in SSIS

Does anyone know about procedure of doing the migration of project in SSIS. We just need to copy the project folder or something else, so that every connection also gets configured on the new server. What is to be done to move the project onto other server?

Which aspect is not covered adequately by Books Online? There is an entire section on "Deploying Integration Services Packages."

-Doug

|||

Amarpreet wrote:

Does anyone know about procedure of doing the migration of project in SSIS. We just need to copy the project folder or something else, so that every connection also gets configured on the new server. What is to be done to move the project onto other server?

Refer to the section(s) in BOL for:

- Creating deployment utility.
- Using DTSInstall.EXE to install packages on another/same server.
- Using DTUtil.EXE for moving packages between machines.
- Using package configurations (specially using environment variable to hold the configuration file path and then using property expressions to dynamically assign connection properties using variables).

Basically, it takes some work.

HTH,
Nitesh|||Thanks Nitesh,

I am very much new to SSIS. If you could explian the last point of yours.
I have created the deployment utility and have copied my deployment folder to the other machine. Then I am using install package utility provided with SSIS. But the error is with the connections (OLE DB and Flat File), which had been created on my machine. How do I dynamically change the server name, username and password. All the required databases and flat files are present on the new server.
If you could provide the steps...
Thanks,|||Amarpreet,
Configurations are the method for doing this in SSIS. Here are some links that may help:

Location independant packages - http://www.windowsitpro.com/Article/ArticleID/47688/47688.html
Easy package configuration - http://www.sqlis.com/?26
Indirect configurations - http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2342.aspx
Dynamicly changing packages - http://blogs.conchango.com/jamiethomson/archive/2005/03/01/1093.aspx
Another method is to change such values via the command-line:
Command-line params: http://blogs.conchango.com/jamiethomson/archive/2004/12/13/451.aspx
Configurations or command-line - http://blogs.conchango.com/jamiethomson/archive/2005/05/17/1424.aspx

Regards
Jamie

Migration in SSIS

Does anyone know about procedure of doing the migration of project in SSIS. We just need to copy the project folder or something else, so that every connection also gets configured on the new server. What is to be done to move the project onto other server?

Which aspect is not covered adequately by Books Online? There is an entire section on "Deploying Integration Services Packages."

-Doug

|||

Amarpreet wrote:

Does anyone know about procedure of doing the migration of project in SSIS. We just need to copy the project folder or something else, so that every connection also gets configured on the new server. What is to be done to move the project onto other server?

Refer to the section(s) in BOL for:

- Creating deployment utility.
- Using DTSInstall.EXE to install packages on another/same server.
- Using DTUtil.EXE for moving packages between machines.
- Using package configurations (specially using environment variable to hold the configuration file path and then using property expressions to dynamically assign connection properties using variables).

Basically, it takes some work.

HTH,
Nitesh|||Thanks Nitesh,

I am very much new to SSIS. If you could explian the last point of yours.
I have created the deployment utility and have copied my deployment folder to the other machine. Then I am using install package utility provided with SSIS. But the error is with the connections (OLE DB and Flat File), which had been created on my machine. How do I dynamically change the server name, username and password. All the required databases and flat files are present on the new server.
If you could provide the steps...
Thanks,
|||Amarpreet,
Configurations are the method for doing this in SSIS. Here are some links that may help:

Location independant packages - http://www.windowsitpro.com/Article/ArticleID/47688/47688.html
Easy package configuration - http://www.sqlis.com/?26
Indirect configurations - http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2342.aspx
Dynamicly changing packages - http://blogs.conchango.com/jamiethomson/archive/2005/03/01/1093.aspx
Another method is to change such values via the command-line:
Command-line params: http://blogs.conchango.com/jamiethomson/archive/2004/12/13/451.aspx
Configurations or command-line - http://blogs.conchango.com/jamiethomson/archive/2005/05/17/1424.aspx

Regards
Jamie

Migration from Sybase to SQL 2000 problems

Hello,
I'm having a problem migrating a particular stored Procedure wich runs
nested and interdependent Fetching from temporary tables.
There is a main cursor and from that, a var is retrieved for use as a
parameter for other cursors. The most important is that the Cursor's queryes
all run successfully independently and with the parameters filled in.
//main cursor
declare CritSelAgr cursor for
select CodCritSelec, TodosSectInst, TodosPrzContr, TodosPais,
TodosMoeda, Coeficiente
from P_TRMCCSE0
where MRCUIC = @.PCodRub and
MRCUKN = @.PVersRub
order by CodCritSelec
for read only
select @.ErroSql = @.@.error
if @.ErroSql <> 0
begin
exec PCRMZZZZ0itratamsg @.ErroSql
return @.ErroSql
end
//dependent cursor *uses CodCritSelec from the main cursor
declare CritInstrFin cursor for
select CodInstrFin, CIF.CodTpConta, DescTpConta
from P_TRMCCIF0 CIF,
VRMCTCO00 TCO
where MRCUIC = @.PCodRub and
MRCUKN = @.PVersRub and
CodCritSelec = @.CodCritSelec and
CIF.CodTpConta = TCO.CodTpConta
order by CodInstrFin, TCO.CodTpConta
for read only
select @.ErroSql = @.@.error
if @.ErroSql <> 0
begin
exec PCRMZZZZ0itratamsg @.ErroSql
return @.ErroSql
end
In the stored procedure they do not work, only the main query, wich has all
parameters set works well.
//this is an extract of the code from the stored procedure
open CritSelAgr
select @.ErroSql = @.@.error
if @.ErroSql <> 0
begin
exec PCRMZZZZ0itratamsg @.ErroSql
return @.ErroSql
end
select @.SqlStat = 0
while( @.SqlStat = 0 )
begin
fetch CritSelAgr into @.CodCritSelec, @.TodosSectInst, @.TodosPrzContr,
@.TodosPais,
@.TodosMoeda, @.Coeficiente
select @.ErroSql = @.@.error, @.SqlStat = @.@.fetch_status
if @.ErroSql <> 0
begin
exec PCRMZZZZ0itratamsg @.ErroSql
return @.ErroSql
end
if @.SqlStat <> 0
break
select @.InstrFin = NULL, @.SectInst = NULL, @.PrzContr = NULL, @.Pais =
NULL, @.Moeda = NULL
open CritInstrFin
select @.ErroSql = @.@.error
if @.ErroSql <> 0
begin
exec PCRMZZZZ0itratamsg @.ErroSql
return @.ErroSql
end
select @.SqlStatCrit = 0
while( @.SqlStatCrit = 0 )
begin
fetch CritInstrFin into @.CodInstrFin, @.CodTpConta, @.DescTpConta
select @.ErroSql = @.@.error, @.SqlStatCrit = @.@.fetch_status
//*****@.@.fetch_status is ALWAYS -1 here and in the other cursors as well
Is there a way to pass explicitly the parameters to a cursor or it's enough
to have the vars defined in the scope? (I think that's the problem)
Thaks in advanceSince you are changing platforms, wouldn't now be a good time to get rid of
any legacy cursor code? I expect this could be done much more quickly and
efficiently with set-based code.
If you need more help, please post a fuller description of the problem as
explained in the following article:
http://www.aspfaq.com/etiquette.asp?id=5006
David Portas
SQL Server MVP
--|||Thanks for the reply,
Do you mean
Set @.var = value?
"David Portas" wrote:

> Since you are changing platforms, wouldn't now be a good time to get rid o
f
> any legacy cursor code? I expect this could be done much more quickly and
> efficiently with set-based code.
> If you need more help, please post a fuller description of the problem as
> explained in the following article:
> http://www.aspfaq.com/etiquette.asp?id=5006
> --
> David Portas
> SQL Server MVP
> --
>|||No. Set-based code means declarative SQL code that operates on entire sets o
f
rows. On the other hand, cursor code only processes one row at a time. SQL
Server is optimized for set-based code, not for cursors.
Without more information it's hard to guess how to do it in your case but
you should aim to write code using regular SELECT, UPDATE, INSERT and DELETE
statements *without* cursors. Cursors are rarely a good idea and most of the
time you don't need them.
David Portas
SQL Server MVP
--|||do you mean set based logic like in joins?
as for ex: in http://techrepublic.com.com/5100-6228_11-5532304.html
"David Portas" wrote:

> No. Set-based code means declarative SQL code that operates on entire sets
of
> rows. On the other hand, cursor code only processes one row at a time. SQL
> Server is optimized for set-based code, not for cursors.
> Without more information it's hard to guess how to do it in your case but
> you should aim to write code using regular SELECT, UPDATE, INSERT and DELE
TE
> statements *without* cursors. Cursors are rarely a good idea and most of t
he
> time you don't need them.
> --
> David Portas
> SQL Server MVP
> --|||Joins are set based operations, yes.
David Portas
SQL Server MVP
--

Migration from SQL 6.5 to SQL 2000

We are migrating our SQL 6.5 application to SQL 2000 & having some difficulties for one Stored procedure . It is failing . Is there any problem
with "TINYINT" ? . Same stored procedure is working fine in SQL 6.5.

We are getting error msg while inserting some rows in following table.

tbl_sd_cmp_hier_detail
(

cmp_hier_id tinyint,
prnt_cmp_int smallint,
chld_cmp_int smallint
)

i will appriciate any help on this.Originally posted by ajayu
We are migrating our SQL 6.5 application to SQL 2000 & having some difficulties for one Stored procedure . It is failing . Is there any problem
with "TINYINT" ? . Same stored procedure is working fine in SQL 6.5.

We are getting error msg while inserting some rows in following table.

tbl_sd_cmp_hier_detail
(

cmp_hier_id tinyint,
prnt_cmp_int smallint,
chld_cmp_int smallint
)

i will appriciate any help on this.

There shouldn't be any problem with SQL 2000. I just ran this code in 2000:

USE pubs
GO

CREATE TABLE tbl_sd_cmp_hier_detail (
cmp_hier_id tinyint,
prnt_cmp_int smallint,
chld_cmp_int smallint
)
GO

INSERT INTO tbl_sd_cmp_hier_detail (
cmp_hier_id,
prnt_cmp_int,
chld_cmp_int
)
VALUES (
123,
456,
789
)
GO

SELECT * FROM dbo.tbl_sd_cmp_hier_detail
GO

I got this:

cmp_hier_id prnt_cmp_int chld_cmp_int
---- ---- ----
123 456 789

Try the code I pasted here. If that works, there is probably some other problem with the stored procedure.

Rob

Migration from PervasiveSQL 7 to SQL Server 2000(Recomendations)

*sorry for spelling mistakes - im forigne
If you have experience with this procedure please let me know of any difficulties/problems that occured because of the change over. What procedure did you go through to make them compatible and perform at a reasonable level? Do you know the appox. size increase of the database (GB/MB) from one version to the other?

Current platform:
Compaq Proliant
Netware 4.5
4.5 GB database (accounting/inventory)

New platform:
IBM eserver X235
Win 2000 SQL Server
avalible HDD space approx. 100gb

If you could make any suggestions it would be appreciated.bump

Monday, February 20, 2012

Migrating to SQL Server 2005;

Hi all,

I have a Database in SQL Server 2000 with several objects (tables, views , stored procedures , functions ).

Is there any specific procedure or tool by which I could migrate the entire database to SQL Server 2005.

Any help would be appreciated.

Thanks,

Hari Haran ArulmozhiAs far as I have seen, backup/restore works as an upgrade path.