Showing posts with label dbo. Show all posts
Showing posts with label dbo. Show all posts

Thursday, March 29, 2012

Error Relational and OLAP Engine

Hi Edward,

What is wrong with my cube?

The dbo.Prescription table is in the data source view.

Please advice

Ronald

You are receiving a message during processing of one of your partitions: 'Prescrition'

The error indicates your server cannot find the source table for your partition.

In the previous post I suggested you modify source table for partition 'Prescrition'.

Have you tried it? Did it work?

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Tuesday, March 27, 2012

Error Recieved While Reindexing

Folk
i recieved an error message while doing a reindex
The error Message is
[dbo].[XX_TL_WRK109TBL
[Microsoft][ODBC SQL Server Driver]Unknown token received from SQL Serve
Connection Broke
The Command i used to reindex 'ALL' Tables is
EXEC sp_MSforeachtable @.command1="print '?' DBCC DBREINDEX ('?')
We are still at Service pack 2 cos PeopleSoft has not certified Service Pack 3a yet
We are running a Peoplesoft Application[posted and mailed, please reply in news]
=?Utf-8?B?R2lyaXNo?= (gwadhwani@.econsult.us) writes:
> Folks
> i recieved an error message while doing a reindex.
> The error Message is
> [dbo].[XX_TL_WRK109TBL]
> [Microsoft][ODBC SQL Server Driver]Unknown token received from SQL Server
> Connection Broken
That doesn't bode well.
While that error occasionally may indicate a true protocol error, it
most often means that SQL Server slammed the door in the face on
you and cut the connection. Not without reason: there was a fatal
error in the execution on the SQL Server side. If you check the SQL Server
errorlog you will probably find a stack dump there.
These kinds of errors are basically always bugs in SQL Server; you should
always get a decent error message back. But if you get this during
DBREINDEX, I'm getting nervous that you have corruption in your database.
So a DBCC CHECKDB would be in place.
Before you open a case with Microsoft, you may want try something
like:
SELECT 'DBCC DBREINDEX(' + name + ')' FROM sysobjects WHERE xtype = 'U'
to factor out sp_MSforeachdb which is undocumented and usage of
it is unsupported.
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

Monday, March 19, 2012

Error on Create Trigger

I have the following

CREATE TRIGGER dbo.tgrCacheCustomers
ON dbo.Customers
FOR INSERT, UPDATE, DELETE
AS
EXEC sp_makewebtask 'C:\DependencyFile.txt','SELECT top 1 CustomerId FROM customers'
and I get the following error that I dont understand:

Error 21037: [SQL-DMO] The name specified in the Text property's 'CREATE ...' statement must match the Name property, and must be followed by valid TSQL statements.

Any ideas someone?Before anyone can help, please kindly explain what you want to accomplish in:
EXEC sp_makewebtask 'C:\DependencyFile.txt','SELECT top 1 CustomerId FROM customers'

Thanks.|||

This error occurs sometimes when you renmae the trigger manually by using F2 Function key & rename. if the name doesent matches with the name specified in the trigger.

Regards
Salman Zafar

Error on copying the database

Hi guys,
I can't find what is wrong.
I am copying a database via DTS and I get an error mid way "Invalid object dbo.fx_get_role_from_ownerid". But the object does exist and it has benn in production for a while now.
Why would I get his error, if the object does exist?Sounds like a user defined function...|||it is, and it's there. Why would I get this error?|||On the face of it...I'd say the stupid Object Id is out of whack with the object name...

try and recompile the function...then try it...

Why are you using DTS instead of dump and restore?|||Hi,
I have recompiled the function and still get the error.
I am using DTS to copy all databases on the server to another server every week automaticaly.
Any other ideas?|||How often do you back up the databases?

Why not attach them...

Would be the fastest thing to do...

Friday, February 17, 2012

error message 8152

When I am run a Stored Procedure -
dbo.sh_UploadPreTransfer task on SQL 7 and try to upload
PreTransfer tables, it showed a erroe message "String or
binary data would be truncated (message 8152)", could you
please give some advice? thanksIt means that your stored procedure is trying to insert more data than it
would fit into a character column. For example, you have a column called
TaskURL, which is of length char(128). But you try to insert a string of
length 200 characters, into this column, and you get this error.
It is bad that the error message will not show you which column is resulting
in the error.
You could use Profiler to trap the events SP:StmtStarting, and Error (with a
filter on Error for error number 8152), to see which statement is causing
the error.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm
"YanLing" <luo_yanling@.hotmail.com> wrote in message
news:02da01c3bcd7$e890a550$a001280a@.phx.gbl...
When I am run a Stored Procedure -
dbo.sh_UploadPreTransfer task on SQL 7 and try to upload
PreTransfer tables, it showed a erroe message "String or
binary data would be truncated (message 8152)", could you
please give some advice? thanks

Error Message 443

Hi,

I'm trying to create the following function:

CREATE FUNCTION dbo.get_id(@.name NVARCHAR(50)) RETURNS INT AS
BEGIN
DECLARE @.id INT
SET @.id = (SELECT id FROM dbo.language WHERE name = @.name)
IF @.@.ROWCOUNT = 0
RAISERROR('Specified item does not exist', 16, 1)

RETURN @.id
END
GO

And I get the following error message:
Invalid use of side-effecting or time-dependent operator in 'RAISERROR' within a function.

I can't find any references to the use of RAISERROR within functions or stored procedures, so I have no idea why this is not working.
What I'm trying to do is check for the existence of the row inside the function and not outside, on all the places I need to call this function. I need to have an exception in my code if this happens, that's why I thought RAISERROR is what I needed...

Any help would be appreciated!

Thanks,
Florin

You cannot use RAISERROR from within TSQL UDFs. You need to put this logic in a stored procedure or use a SQLCLR UDF. Please take a look at http://msdn2.microsoft.com/en-us/library/ms191320(en-US,SQL.90).aspx topic also.|||

Thanks, I eventually figured out that I can't use RAISERROR within a function, so I changed it to a stored procedure. My problem now is that RAISERROR doesn't stop the execution of my stored procedure, but continues with the next statement. Is there a way to achieve the same kind of functionality as with primary key or constraint violations? I'm testing some conditions inside my stored procedure and I want to stop the execution under certain circumstances and get an exception in my .NET calling code. Is that at all possible with RAISERROR?
I noticed that when an error is produced by the SQL Server engine, besides the red error message (which I can also create using RAISERROR) there is another message saying "The statement has been terminated". How can I achieve the same? :-)

Thanks, Florin

|||While you can't raise an error in a udf. . .

this function:

CREATE FUNCTION dbo.get_id(@.name NVARCHAR(50)) RETURNS INT AS
BEGIN
DECLARE @.id INT
SELECT @.id = id FROM dbo.language WHERE name = @.name
RETURN @.id
END
GO

will return a null if name is not found.

Now, I contend, trying to select an id for a name that doesn't exist shouldn't be an error. . . It should return a null. Trying to use the null in a place that requires non-null will raise the error. . . and that might make perfect logical sense.

Just a thought.

On the other hand, if you want to use a procedure, look up @.@.ERROR in the help file.|||

Well, in the application logic, the foreign key can be null, which means that record has no references, but in this particular case I need to throw an error because the calling client has given a foreign key value that does not exist. Null is a valid case, non-existing referenced record is not. That's why I need the error. I want to do as much as I can on the database in one stored procedure call, to avoid multiple database calls/roundtrips...

Florin

|||

huh? I think you misunderstood. . .

run this script. . .

-- BEGIN SCRIPT =========================

create table Song(ID int not null identity(1,1) primary key, name varchar(255))

go

create table Band(ID int not null identity(1,1) primary key, name varchar(255))

go

create table Record(BandID int not null references Band(ID), SongID int not null references Song(ID) )

go

CREATE FUNCTION dbo.getSongID(@.name NVARCHAR(50)) RETURNS INT AS

BEGIN

DECLARE @.id INT

SELECT @.id = id FROM dbo.Song WHERE name = @.name

RETURN @.id

END

go

CREATE FUNCTION dbo.getBandID(@.name NVARCHAR(50)) RETURNS INT AS

BEGIN

DECLARE @.id INT

SELECT @.id = id FROM dbo.Band WHERE name = @.name

RETURN @.id

END

go

Insert into Song(Name) values('Love Will Tear Us Apart')

Insert into Band(Name) values('Joy Division')

-- This works

Insert into Record values(dbo.getBandID('Joy Division'), dbo.getSongID('Love Will Tear Us Apart'))

-- This doesn't and the error is on the database

Insert into Record values(dbo.getBandID('Captain and Tennille'), dbo.getSongID('Love Will Tear Us Apart'))

-- This doesn't and the error is on the database

Insert into Record values(dbo.getBandID('Joy Division'), dbo.getSongID('Love Will Keep Us Together'))

-- END SCRIPT =========================