Showing posts with label sp1. Show all posts
Showing posts with label sp1. Show all posts

Tuesday, March 27, 2012

Bind Variable in CURSOR

SQL Server 2000 SP4 with AWE hotfix. Windows 2003 SP1.

I have a stored procedure which is not working the way I think it
should be.

I have a CURSOR which has a variable in the WHERE clause:

DECLARE get_tabs CURSOR local fast_forward FOR
SELECT distinct tablename, id, shcontig1dt, shcontig2dt
FROM db_ind
WHERE dbname = @.dbname
ORDER BY tablename

It won't return anything, even when I verify that @.dbname has a value
and if I run the query in Query Analyzer with the value, it returns
rows:

SELECT distinct tablename, id, shcontig1dt, shcontig2dt
FROM db_ind
WHERE dbname = 'Archive'
ORDER BY tablename

DB_Rpt_Fragmentation11575791622006-03-29 09:52:11.7772006-03-29
09:52:11.823
DtsAdtStdArchive_DataSourceType5175768822006-03-29
09:52:11.8702006-03-29 09:52:11.887
DtsADTstdArchiveNotUsed3575763122006-03-29 09:52:11.8872006-03-29
09:52:12.103

I've taken out most of the guts for simplicity, but here's what I've
got:

--CREATE TABLE dbo.db_ind
--(
--db_ind_tkintIDENTITY,
-- id int NULL,
-- tablename sysname NOT NULL,
-- indid int NULL,
-- indexname sysname NOT NULL,
-- shcontig1dt datetime NULL,
-- defragdt datetime NULL,
-- shcontig2dt datetime NULL,
-- reindexdt datetime NULL
--)

ALTER PROCEDURE IDR
(@.hours int
)
AS

--SET NOCOUNT ON
--SET ANSI_WARNINGS OFF

DECLARE @.tabname varchar(100),
@.indname varchar(100),
@.dbname varchar(50),
@.vsql varchar(1000),
@.v_hours varchar(4),
@.shcontig1dtdatetime,
@.shcontig2dtdatetime,
@.defragdtdatetime,
@.reindexdtdatetime,
@.idint,
@.indidint,
@.rundbcursorint,
@.runtabcursorint,
@.runindcursorint

DECLARE get_dbs CURSOR local fast_forward FOR
SELECT dbname
FROM db_jobs
WHERE idrdate < getdate() - 4
or idrdate is null
ORDER BY dbname

DECLARE get_tabs CURSOR local fast_forward FOR
SELECT distinct tablename, id, shcontig1dt, shcontig2dt
FROM db_ind
WHERE dbname = @.dbname
ORDER BY tablename

DECLARE get_inds CURSOR local fast_forward FOR
SELECT indid, indexname, defragdt, reindexdt
FROM db_ind
WHERE dbname = @.dbname
AND tablename = @.tabname
ORDER BY indexname

OPEN get_dbs
FETCH NEXT FROM get_dbs
INTO @.dbname

IF @.@.FETCH_STATUS = 0
SELECT @.rundbcursor = 1
ELSE
SELECT @.rundbcursor = 0

SELECT @.v_hours = CONVERT(varchar,@.hours)

--================================================== ================================================== =====
--================================================== ================================================== =====
--================================================== ================================================== =====

WHILE @.rundbcursor = 1
BEGIN -- db while

PRINT '============================='
PRINT @.dbname
PRINT '============================='

--================================================== ================================================== =====
--================================================== ================================================== =====

OPEN get_tabs

FETCH NEXT FROM get_tabs
INTO @.tabname, @.id, @.shcontig1dt, @.shcontig2dt

IF @.@.FETCH_STATUS = 0
BEGIN
PRINT 'table: ' + @.tabname
SELECT @.runtabcursor = 1
end
ELSE
BEGIN
PRINT 'not getting any tables! '-- <<<<< THIS IS WHERE IT HITS
SELECT @.runtabcursor = 0
end

WHILE @.runtabcursor = 1
BEGIN
PRINT @.dbname
PRINT @.tabname

--================================================== ================================================== =====

OPEN get_inds
FETCH NEXT FROM get_inds
INTO @.indid, @.indname, @.defragdt, @.reindexdt

IF @.@.FETCH_STATUS = 0
SELECT @.runindcursor = 1
ELSE
SELECT @.runindcursor = 0

WHILE @.runindcursor = 1
BEGIN
PRINT 'Index:' + @.dbname + '.' + @.tabname + '.' + @.indname

FETCH NEXT FROM get_inds
INTO @.indid, @.indname, @.defragdt, @.reindexdt

IF @.@.FETCH_STATUS = 0
SELECT @.runindcursor = 1
ELSE
SELECT @.runindcursor = 0

END-- 1st loop through indexes
CLOSE get_inds

--================================================== ================================================== =====

--==========
PRINT 'db.tab: ' + @.dbname + '.' + @.tabname

--==========

--================================================== ================================================== =====

OPEN get_inds
FETCH NEXT FROM get_inds
INTO @.indid, @.indname, @.defragdt, @.reindexdt

IF @.@.FETCH_STATUS = 0
SELECT @.runindcursor = 1
ELSE
SELECT @.runindcursor = 0

WHILE @.runindcursor = 1
BEGIN

PRINT 'dbname: ' + @.dbname
PRINT 'tabname: ' + @.tabname
PRINT 'indname: ' + @.indname

FETCH NEXT FROM get_inds
INTO @.indid, @.indname, @.defragdt, @.reindexdt

IF @.@.FETCH_STATUS = 0
SELECT @.runindcursor = 1
ELSE
SELECT @.runindcursor = 0

END -- 2nd loop through indexes
CLOSE get_inds

--================================================== ================================================== =====

FETCH NEXT FROM get_tabs
INTO @.tabname, @.id, @.shcontig1dt, @.shcontig2dt

IF @.@.FETCH_STATUS = 0
SELECT @.runtabcursor = 1
ELSE
SELECT @.runtabcursor = 0

END-- loop through tables
CLOSE get_tabs

--================================================== ================================================== =====
--================================================== ================================================== =====

PRINT 'Index Maintenence complete. Job report in
[DB_Rpt_Fragmentation]'
PRINT ''

FETCH NEXT FROM get_dbs
INTO @.dbname

IF @.@.FETCH_STATUS = 0
SELECT @.rundbcursor = 1
ELSE
SELECT @.rundbcursor = 0

END -- loop through databases
CLOSE get_dbs
deallocate get_dbs
deallocate get_tabs
deallocate get_inds

--================================================== ================================================== =====
--================================================== ================================================== =====
--================================================== ================================================== =====

GO

And this is what I'm getting:

=============================
Archive
=============================

(0 row(s) affected)

not getting any tables!
Index Maintenence complete. Job report in [DB_Rpt_Fragmentation]

..
..
..
etc.

Am I missing something obvious?

Thank you for any help you can provide!!One of my fellow emps got it - apparently the CURSOR needed to be
declare w/in the loop right before I opened it.

I moved the get_tabs and get_inds cursor declarations and all is well .
.. .sql

Thursday, March 22, 2012

bigint problem

Hi,
I have two sql server enterprise servers running sp4 on windows server2003
sp1
I have a DTS package that does some various processing on one machine, then
at the end of the package. I copy tables to the other sql server box.
In one of the tables being copied, I have a bigint data type. The table
copies and shows that the bigint datatype is still part of the table
definition, but the values in the bigint column are negatives and positives.
Does anyone have any ideas as to what might be causing this?
thanks in advance,
TroyValues in a bigint column can be negative as well as positive, but I assume
that you have only positive values on one side and end up with negative and
positive values on the other? If that's the case it looks to me like your
bigints are accidentally treated as ints somewhere along the way, at a
binary level.
--
Jacco Schalkwijk
SQL Server MVP
"Troy Sherrill" <tsherrill@.nc.rr.com> wrote in message
news:ekzUk8kfFHA.460@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have two sql server enterprise servers running sp4 on windows server2003
> sp1
> I have a DTS package that does some various processing on one machine,
> then
> at the end of the package. I copy tables to the other sql server box.
> In one of the tables being copied, I have a bigint data type. The table
> copies and shows that the bigint datatype is still part of the table
> definition, but the values in the bigint column are negatives and
> positives.
> Does anyone have any ideas as to what might be causing this?
> thanks in advance,
> Troy
>|||What provider are you using? It may not understand a BigInt datatype.
--
Andrew J. Kelly SQL MVP
"Troy Sherrill" <tsherrill@.nc.rr.com> wrote in message
news:ekzUk8kfFHA.460@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have two sql server enterprise servers running sp4 on windows server2003
> sp1
> I have a DTS package that does some various processing on one machine,
> then
> at the end of the package. I copy tables to the other sql server box.
> In one of the tables being copied, I have a bigint data type. The table
> copies and shows that the bigint datatype is still part of the table
> definition, but the values in the bigint column are negatives and
> positives.
> Does anyone have any ideas as to what might be causing this?
> thanks in advance,
> Troy
>sql

Monday, March 19, 2012

BIDS, SP1, & Installation Account

On a "day to day" basis, the account I use to do work is not a member of the
Local Administrators group. When I do an install, I'll either do a Run As or
log on as a Local Administrator account to do the install.
On an XP Pro client (1GB RAM, 20 GB HDD), I install the SQL Client tools and
then Visual Studio 2005. All the Business Intelligence Project types work
correctly for both the installation account and the "day to day" account.
When I update the client tools to SQL SP1, the only user that can open a
Business Intelligence Projects is the Administrative account that did the
installation.
Using the "day to day" account, when I try to open an Analysis Services
Project, I get the error:
The Application for Project 'C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\PrivateAssemblies\Business Intelligence
Projects\AnalysisServicesProject.dwproj' is not installed.
Make sure the application for the type (.dwproj) is installed.
If the "day to day" account selects a different Business Intelligence
Project type, I get the error:
Object Reference not set to an instance of an Object
I can log on as the installation Administrator to do SQL work, but that
seems to me to be a security risk.
Any ideas on how to get the "day to day" account to work with Business
Intelligence projects? It works fine with all other project types in Visual
Studio?
Al
Sorry, I forgot to day, SQL Server 2005 Enterprise Edition with Client tools
loaded onto XP (SP2) from the Enterprise Edition CD. SQL 2005 SP1 installed
from SQLServer2005SP1-KB913090-x86-ENU.exe
"Al" <zyck@.tconl.com> wrote in message
news:uZ7Lv2NGHHA.2112@.TK2MSFTNGP03.phx.gbl...
> On a "day to day" basis, the account I use to do work is not a member of
> the Local Administrators group. When I do an install, I'll either do a Run
> As or log on as a Local Administrator account to do the install.
> On an XP Pro client (1GB RAM, 20 GB HDD), I install the SQL Client tools
> and then Visual Studio 2005. All the Business Intelligence Project types
> work correctly for both the installation account and the "day to day"
> account. When I update the client tools to SQL SP1, the only user that can
> open a Business Intelligence Projects is the Administrative account that
> did the installation.
> Using the "day to day" account, when I try to open an Analysis Services
> Project, I get the error:
> The Application for Project 'C:\Program Files\Microsoft Visual Studio
> 8\Common7\IDE\PrivateAssemblies\Business Intelligence
> Projects\AnalysisServicesProject.dwproj' is not installed.
> Make sure the application for the type (.dwproj) is installed.
>
> If the "day to day" account selects a different Business Intelligence
> Project type, I get the error:
>
> Object Reference not set to an instance of an Object
>
> I can log on as the installation Administrator to do SQL work, but that
> seems to me to be a security risk.
> Any ideas on how to get the "day to day" account to work with Business
> Intelligence projects? It works fine with all other project types in
> Visual Studio?
> Al
>

Thursday, March 8, 2012

BI Dev Studio - Calculations - Error in Application

Hi!

New Windows Server 2003 R2 64 Bit EN installation with new SQL Server 2005 DEV SP1 DE installation. While we open BI Development Studio and goto Cube and Calculations we do not get the Calculations Designer - instead we have an "Error in the application" error message. In the Source XML we can view the calculations, but cannot use the designer.

Is this a known issue?

Does someone know an solution to solve this issue? workarround?

Best regards

HANNES MAYER

Hello

You can probably find the answer in this post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=756982&SiteID=1, I had the same problem, I think, and it's solved in that thread.

BI Accelerator Version Error

I am evaluating the BI Accelerator samples Excel 2003 SP1, however I receive
this warning "The Analytics Builder Workbook requires Excel XP, SP1 or
greater" and then the Excel file closes.
Is there a work around for this please?Please look at this page.
http://www.webservertalk.com/archiv...p/t-954076.html
I had the same problem.
http://blogs.sqlpassj.org/nagasaki/...03/22/8178.aspx
(--Japanese)
Tomoyoshi NAGASAKI
Message posted via http://www.droptable.com

BI Accelerator Version Error

I am evaluating the BI Accelerator samples Excel 2003 SP1, however I receive
this warning "The Analytics Builder Workbook requires Excel XP, SP1 or
greater" and then the Excel file closes.
Is there a work around for this please?
Please look at this page.
http://www.webservertalk.com/archive.../t-954076.html
I had the same problem.
http://blogs.sqlpassj.org/nagasaki/a...3/22/8178.aspx
(--Japanese)
Tomoyoshi NAGASAKI
Message posted via http://www.sqlmonster.com

Friday, February 24, 2012

Beta testing SP1

Is it possible to get a list of all the fixes and enhancements that are going into SP1 for SSIS? This will make it alot easier to test seeing as we will know what we are looking for.

Regards

-Jamie

Any answer to this guys? I've got it installed but don't know what I'm looking for.

-Jamie