Showing posts with label object. Show all posts
Showing posts with label object. Show all posts

Thursday, March 22, 2012

_hypmv error

I just tried to update a column type from varchar(32) to varchar(64) in a
table,but got some dependency error like:
The object '_hypmv_0' is dependent on column 'EMAILREFERENCE'.
The object '_hypmv_0_9625' is dependent on column 'EMAILREFERENCE'.
The object '_hypmv_0_7898' is dependent on column 'EMAILREFERENCE'.
The object '_hypmv_0_6539' is dependent on column 'EMAILREFERENCE'.
But,in the dependency listing for the table I cant view any of the above,but
I have
got admin access.What are these dependecies for?any pointer will be greatly
appreciated.
A wild guess is that someone has been running Index Tuning izard which has created "Hypothetical
Materialized Views" (called Indexed Views), and these from some reason haven't been dropped. I'd
check if these are views and if your applications aren't using these, consider dropping them, using
DROP VIEW command.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"c_ani" <cani@.discussions.microsoft.com> wrote in message
news:53B89EB6-C82A-49B2-96C2-84A98CB02FC0@.microsoft.com...
>I just tried to update a column type from varchar(32) to varchar(64) in a
> table,but got some dependency error like:
> The object '_hypmv_0' is dependent on column 'EMAILREFERENCE'.
> The object '_hypmv_0_9625' is dependent on column 'EMAILREFERENCE'.
> The object '_hypmv_0_7898' is dependent on column 'EMAILREFERENCE'.
> The object '_hypmv_0_6539' is dependent on column 'EMAILREFERENCE'.
> But,in the dependency listing for the table I cant view any of the above,but
> I have
> got admin access.What are these dependecies for?any pointer will be greatly
> appreciated.
sql

_hypmv error

I just tried to update a column type from varchar(32) to varchar(64) in a
table,but got some dependency error like:
The object '_hypmv_0' is dependent on column 'EMAILREFERENCE'.
The object '_hypmv_0_9625' is dependent on column 'EMAILREFERENCE'.
The object '_hypmv_0_7898' is dependent on column 'EMAILREFERENCE'.
The object '_hypmv_0_6539' is dependent on column 'EMAILREFERENCE'.
But,in the dependency listing for the table I cant view any of the above,but
I have
got admin access.What are these dependecies for?any pointer will be greatly
appreciated.A wild guess is that someone has been running Index Tuning izard which has created "Hypothetical
Materialized Views" (called Indexed Views), and these from some reason haven't been dropped. I'd
check if these are views and if your applications aren't using these, consider dropping them, using
DROP VIEW command.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"c_ani" <cani@.discussions.microsoft.com> wrote in message
news:53B89EB6-C82A-49B2-96C2-84A98CB02FC0@.microsoft.com...
>I just tried to update a column type from varchar(32) to varchar(64) in a
> table,but got some dependency error like:
> The object '_hypmv_0' is dependent on column 'EMAILREFERENCE'.
> The object '_hypmv_0_9625' is dependent on column 'EMAILREFERENCE'.
> The object '_hypmv_0_7898' is dependent on column 'EMAILREFERENCE'.
> The object '_hypmv_0_6539' is dependent on column 'EMAILREFERENCE'.
> But,in the dependency listing for the table I cant view any of the above,but
> I have
> got admin access.What are these dependecies for?any pointer will be greatly
> appreciated.

Tuesday, March 20, 2012

[strange] date format issue: 2 servers, one query, 2 different results.

I'm running 2 WIN2K SP4 servers with MSSQL Server (v 7.00.1077). Both NT servers seems to have the same setup. I use the ADODB object to connect to MSSQL via OLE DB and notice that the following query generates an error on one server, not the other:

SELECT DATA FROM TABLE_1 WHERE ((TRANSACTION_DATE >='13/11/2003') AND (TRANSACTIONS_DATE <='20/11/2003')) [dates are DD/MM/YYYY]

Query on server_1:
- using OLE DB: correct
- using ODBC: correct
- using Query Analyzer: error <The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value>

On server_2:
- using OLE DB: error <The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value>
- using ODBC: correct
- using Query Analyzer: error <The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value>

Both servers have MDAC 2.8 RTM installed and a <select @.@.language> returns <us_english> via query analyzer and <franais> via ODBC.

I'd like to setup Server 2 so that queries can be executed the same as on server 1.

Any ideas are welcomed!There's a problem with 20/11/2003 in us_english format. Default is: MDY, so it's reading 20th as month, which is why you're getting that error.

Here's an article I found: http://members.lycos.nl/digispy/C2/P56/C2P56A1806.htm

G'luck!
Meera|||Possible there is something to do with locale settings of windows, check the "Region Options" in Control Panel for both servers.|||I'd say the languages are different...and accordingingly each date format is different

Di SELECT * FROM master..syslanguages

I think English is the only one that mdy|||(D/M/Y is a French date format).

I just had to set <French> to user's default language instead of <US_ENGLISH>. This means ODBC settings override the default SQL Server settings as OLE DB uses the default SQL Server setting.sql

Thursday, March 8, 2012

'[object name]' - what is the purpose of '' in t-sql?

[] is SQL Server specific. ANSI SQL is to delimit identifiers using double-q
uotes. SQL Server
supports the later as well, which is what I prefer, but rest of SQL Server c
ommunity seems to
disagree with me.
I find code using delimiters *much* harder to read, so follow the rules for
"standard identifiers"
when you create your objects, and you can skip these types of delimiters and
laugh at those poor
souls who need to maintain code that uses delimiters.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Dan" <nobody@.nospam.com> wrote in message news:O0CcexwjGHA.5036@.TK2MSFTNGP04.phx.gbl...[co
lor=darkred]
> Hi,
> It's got to be a simple question. I'm about to write a relatively simple
queries to manipulate
> data in a MS SQL database. I've got some experience with DB/2 and MySQL.
I've been going through
> some samples/tutorials and noticed that object names are quite often surro
unded by '[]'.
> Could someone please explain the purpose of square brackets surrounding ab
ject names as in the
> below example?
> I think that they are not really needed in this particular example (used f
or illustration purposes
> only?). Still, I'd like to know what their purpose in t-sql is (outside o
f multi-dimensional
> queries)?
> Thanks,
> Dan
> use AdventureWorksDW
> GO
> SELECT
> FirstName as 'First'
> , [MiddleName] as 'Middle'
> , [LastName] as 'Last'
> , [Title]
> FROM [AdventureWorksDW].[dbo].[DimEmployee] as AWD
> WHERE AWD.MiddleName like 'B'
> Order by LastName Asc
> GO
>[/color]As I undestand the ANSI standard, quoted identifiers are supposed to be case
sensitive as well, so that "ColumnA" would not be the same as "columna". In
SQL Server they're not case sensitive (unless you are using a case-sensitive
collation I believe).
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:ezKuK24jGHA.3780@.TK2MSFTNGP03.phx.gbl...
> [] is SQL Server specific. ANSI SQL is to delimit identifiers using
> double-quotes. SQL Server supports the later as well, which is what I
> prefer, but rest of SQL Server community seems to disagree with me.
> I find code using delimiters *much* harder to read, so follow the rules
> for "standard identifiers" when you create your objects, and you can skip
> these types of delimiters and laugh at those poor souls who need to
> maintain code that uses delimiters.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Dan" <nobody@.nospam.com> wrote in message
> news:O0CcexwjGHA.5036@.TK2MSFTNGP04.phx.gbl...
>

Saturday, February 25, 2012

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name on Linked Server

Hi Folks,
I'm having a strange situation here between 2 Linked MS SQL 2K servers.
One of the servers died recently and I rebuilt it.
All seems to be working fine, except that when I create views that access tables on the other (linked) server, I can not modify any data, because I get the [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name server.database.dbo.TableName error.
The View does work fine otherwise, ie displays the data in it, I just can't modify.
The Linked Servers are done with the sa user between these 2 servers.

Any ideas what could be causing this error?
Thanks!-- bump --
no one ideas on this?|||I'm also having problems with this - mine is in relation to a labeler printer, it is present in my ODBC and the test is successful. However, when I go to print I get the following error: [microsoft][ODBC SQL Server Driver][SQL SERVER] Invalid object name 'table name' ODBC -- call failed

I can't seem to see what the problem is as my project server works from this client.

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name

hi
i m connect to the sQL SERVER using system DSN in JREPORT
but it is not working
get the following error
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name

Quote:

Originally Posted by daxter

hi
i m connect to the sQL SERVER using system DSN in JREPORT
but it is not working
get the following error
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name


Try using

\Control Panel\Administrative Tools\Data Sources (ODBC)

And System DNS tab up the top of that window

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name

From Enterpise Manager I create a user, giving all available rights. I have created a DB and set this user to be everything for it (except deny). I create tables as this user on the above DB. When I try to access these tables with an app using ODBC, the specific error appears.
Please assist fellas - situation critical.
Thanx.Refer to this KBA (http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q218/9/95.asp&NoWebContent=1) to resolve the issue.|||Thanx for the info but it didn't work.|||If you created the objects as the user, then they are owned by the user, and will be named [ownername].[objectname].

If your sql code does not specify a ownername sqlserver assumes dbo ownership, and your objects don't exists as dbo.[objectname].

Either specify the owner name when you reference the objects,
or instead of granting all individual rights to the user just grant it dbo access to the database. Then any objects it creates will be dbo owned and will not need to be fully referenced.

blindman

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name

I have a ms sqlserver 2000 database installed on my Windows NT4 PC.

I want to access this database from a java program using JDBC - ODBC

Here are the relavent lines of code from my java source code file.

Note : I am attempting to access the sample database "Northwind Traders" that came with the installation.

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
datasource = "NORTHDS";
url = "jdbc:odbc:" + datasource;
con = DriverManager.getConnection(url,username,password) ;
query = "SELECT * from " + datasource + "." + username + "." + tablename;
ResultSet rs = stmt.executeQuery(query);

The connection succeeds but the query fails with :
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL
Server]Invalid object name 'NORTHDS.username.Customers'.

Using the program "Microsoft Access" I was able to verify that the "Customers" table is intact.

Any ideas ?Take a look at the following:

In your select statement there are a couple of potential problems that you need to verify.

select * from datasource.username.table ... which is returning 'NORTHDS.username.Customers'

should be

select * from Northwind.dbo.Customers ... (unless you renamed the database ...)

In other words, check to make sure your are referencing the correct database/owner/table in your select statement. It appears that the variables you are using are incorrect. tablename appears to be ok, but the username variable is returning username. Also, the datasource variable may not be your database name.

Friday, February 24, 2012

[Help] EXECUTE permission denied on object

Microsoft OLE DB Provider for SQL Server error '80040e09'

EXECUTE permission denied on object 'wwfSpTimeAndDateSettings', database 'iobmi6_ETSasp', owner 'dbo'.

/forum/functions/functions_date_time_format.asp, line 82


What does the EXECUTE permission denied on object... line mean?It means that the object owner decided NOT to run the following statement:

grant execute on dbo.wwfSpTimeAndDateSettings to <you>|||Ok i spent time trying to figure out how to fix it bymyself... but i have no idea. I'm trying to install Iportal... so i remade sure i installed all the files completly. Looked up my database info to see that correct. Is it somthing with my database not having dbo autority? (cause then i'll need to ask my hosting for it)|||What is the User ID specified in the connection string? Issue the statement from the previous post and replace <you> with that value.|||Dude! did you read rdjabarob post? if yes, read it again .. if you still don't get it, then I suggest you do some BOL reading about "permissions-SQL Server: Managing permissions"

Saturday, February 11, 2012

@@TRANCOUNT - always 0 or 1 ?..

I am trying to debug our production problem, and I'm stuck...

A C# .NET 1.1 method creates a SqlTransaction object on a SqlConnection. [This method is called from an ASP.NET 1.1 web application.]

The command invokes a stored procedure on SQL Server 2000 SP4 database.

The stored procedure itself is inside a transaction (that is, all batch code is between BEGIN TRANSACTION and COMMIT/ROLLBACK...).

DECLARE @.a_tran_count INT

SET @.a_tran_count = @.@.TRANCOUNT

DECLARE @.a_tran_name CHAR(13)

SET @.a_tran_name = CONVERT(CHAR(13), @.a_tran_count)

BEGIN TRANSACTION

DECLARE @.a_error INT

<Statements>

SET @.a_error = @.@.ERROR

IF 0 = @.a_error

<Statements>

SET @.a_error = @.@.ERROR

IF 0 = @.a_error

<Statements>

SET @.a_error = @.@.ERROR

IF @.@.TRANCOUNT > @.a_tran_count

BEGIN

IF 0 <> @.a_error

ROLLBACK TRANSACTION @.a_tran_name

COMMIT TRANSACTION

IF 0 = @.a_error

END

RETURN(@.a_error)

Apparently, there is an error in the last IF block (there should be ELSE just before COMMIT), and I don't like the error handling (it would be much more efficient to just rollback the transaction as soon as @.@.ERROR <> 0), but what I got stuck with is the following:

Is it possible that @.@.TRANCOUNT server variable will ever be other than 0 or 1?

I wrote some test page in C#, and it proved that SqlConnection indeed cannot support parallel transactions. But that's a .NET object, NOT a SQL Server's transaction...

I researched BOL and MSDN, but failed to find an answer to the question: if there can be only one transaction per one connection, then what's the point of using @.@.TRANCOUNT? So far, the only usage of it that I can imagine is for checking whether the current transaction has been started...

Also, using the @.a_tran_count (which is @.@.TRANCOUNT) to build the transaction name is kinda confusing as well... Is this name really needed in a procedure like this one?.. And what happens if there is another transaction running on this server which name is the same (such as "0")? Which transaction will be rolled back?

If the value of the @.@.TRANCOUNT can (at least, theoretically, - under certain rare circumstances) be greater than 1, it would mean I have found the cause of our current critical production issue and would be able to fix it relatively easily. So, any help would be greatly appreciated.

Thank you.

@.@.trancount is incremented by one for each "begin tran" and is decremented by one for each "commit":

if @.@.trancount > 0 rollback

begin tran

select @.@.trancount --1

begin tran

select @.@.trancount --2

commit

select @.@.trancount --1

commit

select @.@.trancount --0

It is set to zero when a "rollback" is issued:

if @.@.trancount > 0 rollback

begin tran

select @.@.trancount --1

begin tran

select @.@.trancount --2

rollback

select @.@.trancount --0

Because of the fact that a "rollback" sets the transaction count to zero, SQL Server is not usually considered to fully support "nested transactions".

Ron

|||as explained...@.@.trancount count does increase with each transaction added...rollback its it to zero just to add that... commit does @.@.trancount - 1...