Making A Select Between Two Diferent SQL Servers...Urgent Please Help
Mar 16, 2004
Hi there friend...I'm in a midle of a program(vb.net). and i've got this problem, I've got do compare two tables from two diferent sql servers. Is this possible??? How can I do this???
The following code is a front end parameter - Quantity but when the user enters '0' it is not returning any rows (there are). Is there something wrong here or to add something?
(Select {?Quantity} CASE "ALL": 1=1 CASE "Negative": ({ACBALMPK.IRQOH#}<0) OR ({ACBALMPK.IEQOH#}<0) CASE "Zero": ({ACBALMPK.IRQOH#}=0) OR ({ACBALMPK.IEQOH#}=0) CASE "Greater than Zero": ({ACBALMPK.IRQOH#}>0;) OR ({ACBALMPK.IEQOH#}>0;))
I have a scenario where the second SELECT statement in my query has to be removed such that the logic needs to be included in the CTE select statement itself.
How this can be done? The columns in the final SELECT statement is having bit complexity.
My query is below:
WITH Local_EOL_Dioxin_Statistic_Import_New AS ( SELECT CASE WHEN ISNUMERIC(vr.stringValue) = 1 THEN vr.stringValue
can anyone give the syntax for executing a stored procedure which is sitting on server1 from server2. Name of the server1 is having dashes in it like 'a-b-c'.
I am trying to run something like this from server2 using linked servers concept.Servers are successfully linked.But I am not able to run the query from server2.Here is the error I am getting.
Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'b'.
Apparently because of the dash in the name of the server1. Can anyone give me the correct syntax here?? Thanks!
I have AMD X2 64 bit processor, and try to install sql server 2005 developer edition. Which one should I choose x86 or x64 ?Is there a problems if I migrating file database from x86 platform to x64 and from x64 to x86 ? thanx
Is there any easy way to move users between SQL Servers for a particular database? We have tests and development servers I would like to make sure the user lists are in sync for that db.
My name is daniel ledesma, I have a little problem here...
How I can make so that two different collation' s in different languages, interact to each other, with no need to change constantly configuration to the PC (Software or Hardware)?
These two collation' s are Moder Spanish and Chinese.
I have to Lists filtered by the same field. One List shows all records with the field IsClokedIn value = TRUE and the other list =FALSE. I have only one dataset that retrieve the ClockIn and Clock out for one user. In a perfect world, the user MUST clock in and always clock out. So, when i created my dataset i ordered by UserClockingID (whick is primary key). So, this MUST retrieve a dataset with alternate records IN / OUT (TRUE or FALSE)
Ex.
UserClokingID UserID Time IsClockedIN
2323 34 8:32:03 TRUE
2324 34 12:07:02 FALSE
2325 34 13:05:03 TRUE
2326 34 14:53:02 FALSE
2327 34 15:10:03 TRUE
2328 34 17:32:02 FALSE
All i need is to calculate (sum then divide by 60) the minutes returned by the method DateDiff between the first row in my TRUE filtered list and the first row in my FALSE filetered list... and so on for the 2nd, 3rd ..... I can get the minutes by taking the values directly from the Fields!IsClockedIn.Value and using a condition to "grab" the previous record if the current record ClockedIn.Value=FALSE. I already did that.
my problem is that when i try to perform a calculation of textboxes values(those with the ammount of minutes for every pair of records from the datalist) out of the group. It says you can only do that inside the group or dataregion.
Hi. I'm trying to copy from one table to another across 2 differentservers with the following:select *into #Tmp_Hdrfrom parsaleshdrwhere businessday = '9/20/07'select *into [pdsqla01pdsqla01].impact_exec.dbo.parsaleshdrfrom #Tmp_HdrThis gives me an error:The object name 'pdsqla01pdsqla01.impact_exec.dbo.' contains morethan the maximum number of prefixes. The maximum is 2.Not really sure how to get around it. I was trying to use OpenQuery,but that's really for selecting from, not into. How can I get aroundthis?Thanks,Jennifer
It just seems like I should be able to use a 4 part naming convention to compare database tables that exist on 2 servers. It isn't always possible to link dbs because of security. Is there any other way to query between servers?
I've run into the following problem using "select rowguidcol from [LinkedServer].[DBName].dbo.MyTable" (as opposed to using "select <rowguid column name>...".
Against a locally-connected database, the following SQL command works as expected:
SELECT rowguidcol from dbo.MyTable
However, If I run the same query against a linked server (using the 4-part notation), it fails with an 'Invalid column name 'rowguidcol'' error:
SELECT rowguidcol from [LinkedServer].[MyDB].dbo.MyTable
Msg 207, Level 16, State 1, Line 1 Invalid column name 'rowguidcol'.
I've searched around but can't seem to find any info that tells me definitively that I can't use rowguidcol against linked tables, so I'm wondering if I'm just doing something wrong?
Any ideas on how to get around this issue would be greatly appreciated. I really don't want to use actual column names, as this is for generated scripts.
More Info: > I can select the data just fine from the linked server if I use the column name - so I don't think it's a configuration or permissions issue.
> The row I'm trying to view is, in fact, a rowguidcol. I used the exact same script to create the table on both the local (where select rowguidcol works) and the linked (where it doesn't) servers.
I administer several servers. My login is a SysAdmin on all servers with not only the same Name and Password, but also the same SID. In setting up Linked Servers, I can successfully SELECT data from a server other than the host server, but if I try to SELECT * INTO I get the following error:
The object name 'DB1.ogSerial.dbo.' contains more than the maximum number of prefixes. The maximum is 2.
Here are the queries I've tried (using DB3 as the host, DB1 as the linked server).
SELECT * INTO DB1.MyDB.dbo.TestTableNew FROM DB3.MyDB.dbo.TestTable SELECT * INTO DB1.MyDB.dbo.TestTableNew FROM DB1.MyDB.dbo.TestTable SELECT * INTO DB1.MyDB.dbo.TestTableNew FROM MyDB.dbo.TestTable
Hi, i wanted to take all the orderID that fall between a certain date. I was thinking of using this syntax... Dim sql as string = "SELECT orderID " & _ "FROM orders " & _ "WHERE orderDate BETWEEN 11/11/2007 AND 15/11/2007" in my database i set the date to nvarchar, not date... so will this syntax works?? thx
Hi, I have a query as follows:select transactionDate, (select count(transID) from ......)I am having a problem which is that dates are not shown uniquely.For example,oct 1, 2005 00:12:00 - 12oct 1, 2005 01:30:00 - 12oct 1, 2005 01:13:00 - 12I want only to have:oct 1, 2005 01:13:00 - 12The select is working on time and not on a date, can you help me please?thank you.
I need a hand in this script. SELECT a.id ,value = CASE when (x1-x0) = 0 then ((Y2-Y0)-(Y1-Y0))/(0.000000001*(X2-X0)) ELSE ((-111.48277-Y0)-(Y1-Y0))/((X1-X0)*(32.72383-X0)) END ,value2 = CASE when (x1-x0) = 0 then ((Y2-Y0)-(Y1-Y0))/(0.000000001*(X2-X0)) ELSE ((-111.48277-Y0)-(Y1-Y0))/((X1-X0)*(32.72383-X0)) END FROM table_name a where value > 0 ORDER BY VALUE
The problem I'm having is in the where clause. Because the value is not a column name sql server is giving me an error. I need to evaluate the value returned. How can I get around this problem? Any sort of advise will help! Thank you in advance!
hey friends! pleaze help, i am using sql server 2000.i have tried to fix my problem for more than five weeks just to solve for one problem and just still now it is unsolved, opps my due date is almost approaching, i don't know what to do more than what i did, i have search through the net, but still i did not get the correct answer to my problem, friends please just forward your answer to me, it may be best answer to my question . create table mytable( english varchar(120), tigrigna Nvarchar(120)) insert into mytable values('peace',N'sälam') insert into mytable values('kiss',N'samä ') insert into mytable values('to kiss each other',N'täsasamä ') then select * from mytable where english='peace'; this works fine but select * from mytable where tigrigna=N'sälam'; this doesnot work; select * from mytable where tigrigna='sälam'; this also doesnot work, so what should i do to select this unicode select statement?
tigrigna is one of the spoken language in east africa(ethiopia). Hopefully, i have joined this forum today, and just looking for your reply
proj_name res_name yr SumOfHours x Mike 2007 1 x Mike 2008 2 x Mike 2008 3
Here is table dbo._LastWeekTotalHours
proj_name res_name yr td_hours Week x Mike 2007 1 1 x Mike 2008 2 8 x Mike 2008 3 9
now here is what the output should look like
Lets assume the user well enter 8 for week number
proj_name res_name totalHours LastWeekHours x Mike 6 2 Y AJ .. €¦.
I am trying to write a select statement for that:
Here is what I have:
SELECT a.proj_name, a.res_name,a.TotalHours,g.TotalHours as LastWeekhours FROM
Line 1( SELECT r.proj_name,r.res_name, SUM(r.td_hours) AS TotalHours FROM line 2 dbo._LastWeekTotalHours as r, _vw_Employee as e Line 3 WHERE e.RES_NAME = r.res_name and r.Week = 5 and r.yr = 2008 Line 4 GROUP BY r.proj_name, r.res_name ) as g
Line 5(SELECT r.proj_name, r.res_name, r.TotalHours Line 6 FROM Line 7 (SELECT proj_name, res_name, SUM(td_hours) AS TotalHours FROM line 8 dbo._LastWeekTotalHours line 9 GROUP BY proj_name, res_name ) r , line 10 (SELECT proj_name, res_name, SUM(SumOfHours) AS TotalHours FROM dbo.vw_TimebyProjectAll line13 GROUP BY proj_name, res_name )w )a
if i excute line 1 - 4 i will get the last week hour correctly if i excute line 5 - 13 i will get the totalhours correctly
my problem i can't put these two pieces work togather. feel free to re-write the select statment thanks
Code Snippet use master select top 25 percent id from ( select top 112 * from syscolumns ) d order by id desc
Script below returns 57 rows, must return 56!
Code Snippet use master select top 50 percent id from ( select top 112 * from syscolumns ) d order by id desc
Reproducable on
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)
and
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
Could anyone from MS SQL server team clarify what's happened and WHAT TO DO?
I have a stored procedure in an Informix-database that returns a string. Its used in a SELECT statement like this. SELECT t1.id, t2.id, sp_name(t1.id, t2.id) FROM table1 t1, table2 t2
I want to write it in SQLserver. I have tried this syntax but get error. Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 't'.
i run a sql command like this select * from table_name what i want is that if no. of records found are greater then 500 than it should stop the query and only show those 500 records dont go further and stop the process waiting for reply ashish bhatnagar
Hi Everyone,All the very best for 2004!!i need urgent help with this problem, the users are about to skin mealive!!we have an access front end with linked to sql server 2k tables.when a user tries to insert a record into one of the tables it"randomly" returns a generic ODBC error and fails to save. on otheroccasions the same record will save.a trace was applied and the following select seemed to appear rightafter the insert statement whenever it failed:select substring('NY',status/1024&1+1,1) from master..sysdatabaseswhere name=DB_NAME()i had a look at other articles in the groups re this select statement,but could not find a clear answer.i have tried the insert statements as both SQL pass throughs and justplain docmd.runsql'scan someone help me with the following:* what is the purpose of the select?* what other investigations can i do to get more info on why thisshould be happening?* how can i stop it?the table i am doing the inserts into is showing as have a numericdata type field in sqlserver, but the linked table shows this numericfield as text - could this be the problem?? this field is not used inthe insert statement.i could not find any references in the MS knowledge base.any and all help would very gratefully received.Edwinah63
I have a report that was designed using SQL Reporting Services that sits on a SQL reporting server. It's nothing too exciting, it is essentially a three page application with legal jumbo on pages 2 and 3 and applicant data in fields on page 1.
We use rectangles to force page breaks to page 2 and to page 3.
When running the report on the report server, it shows and prints fine.
When running the report from the QA website internally, it shows and prints just fine.
When running the report from the production website from a machine internally, it shows and prints just fine.
When running the report from outside of the company network, the report is jacked. It obliterates large chunks of text, crams text together, and creates blank pages.
I need help in determining where I even begin with trouble shooting this!
can anyone tell me if they know of a way to automate the update process from development servers to live server, with little interference from an administrator
I have a development team that are constantly updating their databases along with their ASP code, and want to publish changes an a weekly basis. They have asked me for a way to take their new structures, tables, procedures etc, and copy them to the live servers, but NOT to interfere with existing customer data.
Funny I know – and I hate the idea btw :(
Any references, contacts, 3rd party tool recommendations welcome,
I am in the middle of a major migraton project, moving from x86 SQL 2000 to IA64 SQL 2005. I have a business need to link to several legacy servers. I have a number of problems I am trying to solve.
1) Linking a Kerberos server to a non-Kerberos server. 2) Linking x64 or IA64 servers to x86 servers. 3) Linking SQL 2005 to SQL 2000.
Two of the errors I am encountering are: ------------------------------ TCP Provider: An existing connection was forcibly closed by the remote host. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. OLE DB provider "SQLNCLI" for linked server "SCDC250DB" returned message "Communication link failure". (Microsoft SQL Server, Error: 10054) ------------------------------ And ------------------------------ The OLE DB provider "SQLNCLI" for the linked server "SCDC250DB" reported an error. Authentication failed. Cannot initialize the data source object of OLE DB provider "SQLNCLI" for linked server "SCDC250DB". OLE DB provider "SQLCLI" for linked server "SCDC250DB" returned message "Invalid authorization specification". (Microsoft SQL Server, Error: 7399)
If someone has worked through these problems before, I would appreciate it if you could direct me to the relevant documentation to resolve these issues.
Thanks!
Brandon Forest
Database Administrator
Data & Web Services Team
Sutter Connect Information Technologyforesb@sutterhealth.org
I need to write a 'select' statement to fetch data from different tables, which are located on different servers. Can any one help in writing this 'select' statement with out moving the tables on to same server.
This morning I can not connect to our SQL Server 7.0 whatever from client or server. The error message which I list below:
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ A connection could not be estabished to server--Timeout expired Please verfy SQL Server is running and check your SQL Server registration properties and try again. ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++
We use windows NT authentication. We did not do any change on NT. The SQL Server daily schedule job usally stoped at 10:00AM, but today from the Window NT Task Manager, we can see that the SQL Server is still running untill now.
hi, I have settup up sql mail and did the following: 1. created an E-mail account and configured Out look by creating a pop3 mail profile. tested it by sending and receiving mail, that is ook 2. I Created one domain account for MSsqlserver and Sql Agent service. both services use same account and start automatically in the control panel-services 3. I used the profile that I created in outlook to test the sql mail but got an error: Error 22030 : A MAPI error ( error number:273) occurred: MapiLogon Ex Failed due to MAPI Error 273: MAPI Logon Failed
I really do not know what went wrong. I followed the steps from bol and still having a problem. Am I missing something.
I do have a valid email account I do have a valid domain account I tested outlook using the email account and it worked. so why sql server does not recognise MAPI.
My next question, How to configure MAPI in Sql server if what I did was wrong.
Hi, I have 2 windows 2000 server in cluster with sql server 2000 enterprise edition installed. I have activated the Server-Requested Encryption by using the sql server network utility (Force Protocol Encryption). After this, I have stoped sql server service. But I can't start it at this moment. The error is: 19015: The encrypton is required but no available certificat has been found.