Showing posts with label servers. Show all posts
Showing posts with label servers. Show all posts

Tuesday, March 20, 2012

Problem with select to another server.

Hello All!

This is the first time I'm working between two SQL servers. Here is a simple SELECT statement.

DECLARE @.Acct nvarchar(50)

SELECT First_Name, Last_Name, Age, DOB, Account_Number

FROM [MKE01-Demo-XX].SAHPharm.dbo.Active_Orders

WHERE [MKE01-2NX2461].[Pharm Test Local].dbo.Active_Orders = @.Acct

Here is the error

Msg 4104, Level 16, State 1, Line 4

The multi-part identifier "MKE01-2NX2461.Pharm Test Local.dbo.Active_Orders" could not be bound.

What am I doing wrong?

Thanks!

Rudy

MKE01-2NX2461 is set up as a Linked Server in MKE01-Demo-XX?

|||

You are attempting to compare a table to a variable.

WHERE [MKE01-2NX2461].[Pharm Test Local].dbo.Active_Orders = @.Acct

It would be nice, but it isn't going to happen...

But more critically, I don't see any relationship between the two tables from the two databases. How would a row from [MKE01-2NX2461].[Pharm Test Local].dbo.Active_Orders be connected to the table [MKE01-Demo-XX].SAHPharm.dbo.Active_Orders in such a way that using the variable value against one table 'should' return a row from the other table.

I think that something isn't quite right here... (Perhaps a JOIN is missing.)

|||

Hi guys!

Ah yes. A JOIN would make sense. Mke Demo is the linked serve on MKe 29nx... So let me give that a shot. I'm sure I'll be back here with a question or two.

Thanks!

Rudy

|||

Perhaps something more like this?

Code Snippet


DECLARE @.Acct nvarchar(50)


SET @.Acct = {someValue}


SELECT
x.First_Name,
x.Last_Name,
x.Age,
x.DOB,
x.Account_Number
FROM [MKE01-Demo-XX].SAHPharm.dbo.Active_Orders x
JOIN [MKE01-2NX2461].[Pharm Test Local].dbo.Active_Orders t
ON x.Account_Number = t.Account_Number
WHERE x.Account_Number = @.Acct

This assumes that the values you wish to return are located in the [MKE01-Demo-XX].SAHPharm.dbo.Active_Orders table, and that both tables have the Account_Number column to link the data.

Problem with SELECT and INSERT T-sql statement

hello everybody

I want to ask for your help in an issue i am having with SQL Server 2005 Developer Edition . here is the issue:


We have 2 servers called: c10 and cweb. In both, we manually installed SQL server 2005 Dev Edition with no problems.

I created a linked server on c10 to access data on cweb. That is working fine with no problem when executing Select or Insert T-SQL statments like these ones from c10:

select * from cweb.DBNAME.dbo.TableNAME

Or

insert into cweb.DBNAME.dbo.TableNAME (f1, f2, f3)
select f1,f2,f3 from c10.DBNAME.dbo.TableNAME

All works fine up to here. But then there is a new server we setup called c7. This time we created an image of c10 and restore that image on this new server c7. That way, we didnt need to install all software needed in this new server. All software seemed to work ok..but then SQL server 2005 on that new server started failing when doing SELECT t-sql statements.

So Now if i am on c7 and i try to execute this: SELECT * from C7.DNAME.dbo.TableName, it fails

C7 in this case is the local server and it should work. however the error it gives me is that :"linked server not recognize"...it shouldnt need a linked server since it is trying to access the local server. Even with that, i tried to create a linked server to the own local server and now that Select t-sql isntruction worked with no problem..But now here is the othe issue i am having: INSERT t-sql statements are not working. When doing this:


insert into c7.DBNAME.dbo.TableNAME (f1, f2, f3)
select f1,f2,f3 from c7.DBNAME.dbo.TableNAME2

It fails with the following 2 error messages:

"OLE DB provider "SQLNCLI" for linked server "c7" returned message "Multiple-Step OLE DB operation generated errors. Check each OLE DB status, if available. No work was done

The OLE DB provider SQLNCLI for linked server citrix7 could not insert into table c7.DBNAMe.dbo.TableNAme because of column intID. the data value violated the integrity constraints for the column."


I checked that the SELECT part of the INSERT T-sql statement is not retrieving any invalid data for column intID.

I tried restoring the BD on c10 server and tried the same INSERT statement and it worked ok..which mean the data to be inserted is valid.

So i think it is related to some mis-configuration on the linked server or something in SQL server got broken when restoring c10 server image into the new c7 server

So in summary the problem is this:

1. i can not make SELECT T-sql statements using fully qualified names on the local sql server without having a linked server to the local server (which is strange)

2. I can not make INSERT T-sql statements in the local server. This errors happens when doing it

"OLE DB provider "SQLNCLI" for linked server "c7" returned message "Multiple-Step OLE DB operation generated errors. Check each OLE DB status, if available. No work was done

The OLE DB provider SQLNCLI for linked server citrix7 could not insert into table c7.DBNAMe.dbo.TableNAme because of column intID. the data value violated the integrity constraints for the column."

I have been searching thru google and forums but havent found any solutions yet.

Hope you can help me with this..i guess my only option right now is just uninstall and re-install sql server..but maybe there is any other solution to this_?


thanks a lot

Helkyn

This is a Transact-SQL question, not an SSIS question. Moving there...

Problem with Search engine access?

Hi,
We're running a Windows 2000/2003 network.
On Servers running Windows 2003 with or without SP1 and SQL Server 2000 SP3a
or 4, we cannot create any full Text Search Catalogs.
Whatever login we try to use, if we try to create a new catalog, from
Enterprise Manager, we get a dialog box stating "The Microsoft Search Engine
cannot be administered under the present user account"
Running profiler we can see the creation process starting. It appears to run
alright until it gets to the "sp_fulltext_database DBCC CALLFULLTEXT
(7,@.dbid) -- FTDropAllCatalogs("@.dbid") and then generates an Exception
"Error: 7635, Severity: 16, State: 1"
Help!
John,
The error "The Microsoft Search Engine cannot be administered under the
present user account" typically indicates that the SQL login
BUILTIN\Administrator has been removed or altered. Have you or anyone else
removed or altered the SQL Server login BUILTIN\Administrator? If so, can
you add or alter it back with the same parameters? As the MSSearch service
needs all of the default parameters to login to SQL Server, if not you can
use the following SQL code:
exec sp_grantlogin N'NT Authority\System'
exec sp_defaultdb N'NT Authority\System', N'master'
exec sp_defaultlanguage N'NT Authority\System','us_english'
exec sp_addsrvrolemember N'NT Authority\System', sysadmin
See "SQL Server 2000 Full-Text Search Resources and Links" for more SQL FTS
info & KB articles at:
http://spaces.msn.com/members/jtkane/Blog/cns!1pWDBCiDX1uvH5ATJmNCVLPQ!305.entry
Regards,
John
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"John S" <js162@.newsgroup.nospam> wrote in message
news:0C9748C6-AB94-4AC3-AEED-4F97C1FCC49B@.microsoft.com...
> Hi,
> We're running a Windows 2000/2003 network.
> On Servers running Windows 2003 with or without SP1 and SQL Server 2000
SP3a
> or 4, we cannot create any full Text Search Catalogs.
> Whatever login we try to use, if we try to create a new catalog, from
> Enterprise Manager, we get a dialog box stating "The Microsoft Search
Engine
> cannot be administered under the present user account"
> Running profiler we can see the creation process starting. It appears to
run
> alright until it gets to the "sp_fulltext_database DBCC CALLFULLTEXT
> (7,@.dbid) -- FTDropAllCatalogs("@.dbid") and then generates an Exception
> "Error: 7635, Severity: 16, State: 1"
> Help!

Wednesday, March 7, 2012

Problem with Remote Ent. Mgr. Connect through a firewall

Does the Enterprise Manager use ports other than 1433 or 1434 to connect to
a remote server?
I am trying to connect to one of our MS SQL 2000 servers via Enterprise
Manager through a firewall on the remote end. All attempts to register the
server with EM terminate with a Timeout.
Can anyone help with this issue?
tia,
Jim Evans
The ability to start and stop services from EM probably use some other port (stuff needed for Windows
authentication, I guess). But a regular SQL Server login should be fine through a firewall having only those
ports open.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"KAS Broadband Administration" <jim@.kascable.com> wrote in message
news:uwrzg5KSEHA.3296@.TK2MSFTNGP12.phx.gbl...
> Does the Enterprise Manager use ports other than 1433 or 1434 to connect to
> a remote server?
> I am trying to connect to one of our MS SQL 2000 servers via Enterprise
> Manager through a firewall on the remote end. All attempts to register the
> server with EM terminate with a Timeout.
> Can anyone help with this issue?
> tia,
> Jim Evans
>

Problem with Remote Ent. Mgr. Connect through a firewall

Does the Enterprise Manager use ports other than 1433 or 1434 to connect to
a remote server?
I am trying to connect to one of our MS SQL 2000 servers via Enterprise
Manager through a firewall on the remote end. All attempts to register the
server with EM terminate with a Timeout.
Can anyone help with this issue?
tia,
Jim EvansThe ability to start and stop services from EM probably use some other port
(stuff needed for Windows
authentication, I guess). But a regular SQL Server login should be fine thro
ugh a firewall having only those
ports open.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"KAS Broadband Administration" <jim@.kascable.com> wrote in message
news:uwrzg5KSEHA.3296@.TK2MSFTNGP12.phx.gbl...
> Does the Enterprise Manager use ports other than 1433 or 1434 to connect t
o
> a remote server?
> I am trying to connect to one of our MS SQL 2000 servers via Enterprise
> Manager through a firewall on the remote end. All attempts to register the
> server with EM terminate with a Timeout.
> Can anyone help with this issue?
> tia,
> Jim Evans
>

Problem with Remote Ent. Mgr. Connect through a firewall

Does the Enterprise Manager use ports other than 1433 or 1434 to connect to
a remote server?
I am trying to connect to one of our MS SQL 2000 servers via Enterprise
Manager through a firewall on the remote end. All attempts to register the
server with EM terminate with a Timeout.
Can anyone help with this issue?
tia,
Jim EvansThe ability to start and stop services from EM probably use some other port (stuff needed for Windows
authentication, I guess). But a regular SQL Server login should be fine through a firewall having only those
ports open.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"KAS Broadband Administration" <jim@.kascable.com> wrote in message
news:uwrzg5KSEHA.3296@.TK2MSFTNGP12.phx.gbl...
> Does the Enterprise Manager use ports other than 1433 or 1434 to connect to
> a remote server?
> I am trying to connect to one of our MS SQL 2000 servers via Enterprise
> Manager through a firewall on the remote end. All attempts to register the
> server with EM terminate with a Timeout.
> Can anyone help with this issue?
> tia,
> Jim Evans
>

Problem with queued updating in transactional repl on win/SQL 2000

Hey guys. I've 2 servers with SQL 2000. I've a publisher/distributor and a
subscriber. Now, there is a queued updating setup between this two with push
replication. I'm trying to replicate the employees table of Northwind
database only. the primary key is setup to use identity ranges on the 2
servers. The problem I'm facing is that, when I insert/update data on a
publisher, it gets replicated fine to subscriber, no matter what. But, when I
try to insert data at the subscriber, it doesn't work(update works fine). It
gives me an error msg2627. violation of a primary key constraint at the
subscriber. It says 'cannot insert duplicate key in object 'Employees'. The
thing is that I'm using identity for the primary key. So, I'm very confused
as to what this is saying. Please help. Thank you.
Tejas,
sounds like you haven't set up automatic identity range management, and hte
identity values are clashing. In the article properties you can see this
option, but it'll require reinitialization. As a stop-gap you could reseed
the identity range on the subscriber (dbcc checkident).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)