Showing posts with label exists. Show all posts
Showing posts with label exists. Show all posts

Thursday, March 22, 2012

Error in using DTUTIL /Exists

hi group,

i have to check whether SSIS package is present in MSDB or not.

I am using DTUTIL for this perpose . Command goes like this.

dtutil /SQL Package_for_testing /Exists

Error(0xC0014014) while checking for the existence of package "Package_for_testing" on SQL server

this is giving the error "The specified package does not exist.
Description: The ExistsOnSQLServer method has encountered OLE DB error code 0x80
004005 (Login timeout expired). The SQL statement issued has failed.
Source:"

But the package is there in MSDB when i checked manually.

I want to know what this error signify? and how i can solve it.

With advance thanks

Srinivasa Mahendrakar

It means that simply that package doesn't exist at all.

Sunday, February 19, 2012

Error in an SQL Script

USE master
GO
IF EXISTS(SELECT * FROM sysdatabases
WHERE name = 'Products')
DROP DATABASE Products
GO
CREATE DATABASE Products
ON (NAME=Product,
FILENAME = ‘C:\APPS\Products.mdf’,
SIZE=10 )
GO
USE Products
GO
CREATE TABLE Categories (
catid VARCHAR(10) NOT NULL,
name VARCHAR(50) NOT NULL,
[desc] VARCHAR(MAX) NOT NULL,
PRIMARY KEY(catid) )
GO
CREATE TABLE Products (
productid VARCHAR(10) NOT NULL,
catid VARCHAR(10) NOT NULL,
name VARCHAR(50) NOT NULL,
shorttext VARCHAR(MAX) NOT NULL,
longtext VARCHAR(MAX) NOT NULL,
price MONEY NOT NULL,
thumbnail VARCHAR(40) NOT NULL,
image VARCHAR(40) NOT NULL,
PRIMARY KEY(productid),
FOREIGN KEY(catid) REFERENCES Categories(catid) )
GO
CREATE TABLE FeaturedProducts (
productid VARCHAR(10) NOT NULL,
featuretext VARCHAR(MAX) NOT NULL,
saleprice MONEY NOT NULL,
PRIMARY KEY(productid),
FOREIGN KEY(productid) REFERENCES Products(productid) )
GO

When I run the SQL script above from the command prompt, I get this :

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\HP_Administrator>cd My Documents

C:\Documents and Settings\HP_Administrator\My Documents>sqlcmd -S localhost\SQLE
xpress -i CreateProducts.sql
Changed database context to 'master'.
Msg 102, Level 15, State 1, Server YOUR-C6B5E4EABC\SQLEXPRESS, Line 3
Incorrect syntax near '`'.
Msg 911, Level 16, State 1, Server YOUR-C6B5E4EABC\SQLEXPRESS, Line 1
Could not locate entry in sysdatabases for database 'Products'. No entry found with that name. Make sure that the name is entered correctly.

I am unable to get to the cause of this problem. Thanks for your assistance in advance!

Hello,

The only thing i can see is that your create statement is using "smart quotes" around the data file:

‘C:\APPS\Products.mdf’

I'm not sure if the site just formatted it that way when you copy and pasted, but use single quotes.

Also, just as an aside, it's good practice to explicitly specify the log file in your create statement:

CREATE DATABASE Products

ON (NAME=Product,

FILENAME = 'C:\Products.mdf',

SIZE=10 )

LOG ON (NAME=ProductLOG,

FILENAME = 'C:\Products.ldf',

SIZE=10)

GO

Cheers

Rob

|||

But it is using single quotes right? Or did you mean double quotes?

Thanks for your assistance anyway.

|||No, you are not using single quotes, but smart quotes. You should be using single quotes...

smart quote: `
single quote: '

So instead of writing: `C:\Products.mdf′
write: 'C:\Products.mdf'

Wednesday, February 15, 2012

error handling while processing a cube

hi

in analysis services when i process a cube i got an error that
data from the fact table isnt exists in the dimenstion table
for example : fact table sales has column suplier that one of its row
has data(suplier id = 170) that doesnt match with the dimension table ( in the dimension table there isnt such supier id)
how can i handle this error ?
can i insert instead someyhing else so that the proccess can continue and not failed ?


Thanks

Eyal

Ideally, you've addressed this problem in your data warehouse/data mart. I recommend to my clients they never allow NULLs in their foreign keys. This requires you to place a NULL member in each dimension -- we usually assign that member the surrogate key value of -1 -- and eliminates this issue.

It sounds like in your example, you have a valid key in your partition, so I would suggest you make sure you dimension is processed before you process your cube/partitions.

If that is not an option, you use use the UnknownMember and ErrorConfiguration properties in SSAS to handle this issue. In the dimension that is causing problems (the supplier dimension in your example?) set the UnknownMember property to either visible or hidden. It defaults to None which makes the UnknownMember inaccessible.

Then, on the measure group that points to this dimension table, change the error configuration to replace missing key values with unknown (using the KeyErrorAction and KeyNotFound properties). Be certain to also set the KeyErrorLimitAction property to Stop Logging when the max error is hit.

One important gotcha on this. If your dimension member lands in your dimensions, the facts assigned to the unknown member do not revert to your new dimension value. To line your facts up correctly with the values in your dimension, you will need to do a full reprocess of the partition.

B.