Hi,
I need some SQL syntax to do the following:
Compare 2 integer values (from 2 different tables) and make sure that the values DO NOT DIFFER by more than 10%.
Not sure how to write this!
Thanks
I seem to have narrowed down the performance problem somewhat.
Seems to be tied to a "like" clause, e.g.
...
AND e.myCol LIKE CASE @myParam
WHEN '<All>' THEN '%'
ELSE @myParam END
If I specify NULL for @myParam, the query runs in 15 seconds. If I specifiy a value for @myParam...
I have 2 servers, one is 2000, the other is 2005, sp1. The databases are identical, because I am restoring the database from the 2000 server onto the 2005 server.
I am running some stored procs on both servers. They take about 30 seconds on 2000. However, on 2005, they are taking like over 15...
Never thought about this before. But I'm calling a stored proc from a stored proc. The inside proc returns a couple rows to the screen, like this:
This is the sp output...
NULL
I want to capture the first row (message) into a variable. How would I do this??
Thanks much
Hi,
I realize that I don't really understand how sp_addlinkedsrvlogin works.
If you have a local user that you want to be able to log on to a remote (linked) server, does that user also have to exist on the remote server?
Or if by using sp_addlinkedsrvlogin, does it enable the local user to...
Hi,
I have a part of a query that is quite expensive:
LEFT JOIN
myTable t1
ON t1.SyId = pos.SyId and t1.CuId = cu.CuId and t1.Date = @AsOfDate
LEFT JOIN
myTable t2
ON t2.SyId = pos.SyId and t2.CuId = cu.CuId and t2.Date = @StartDate-1
LEFT JOIN
myTable t3...
Hi,
RE: SQL Server 2005
Is anyone familiar with this error message?
A non-sysadmin user received this error. Running sp_xp_cmdshell_proxy_account solved the problem.
Does this mean that ALL non-sysadmin users must have proxy accounts in order to use xp_cmdshell? Or is there something...
Hi,
This is not a sql server question, per se, but everyone here is so helpful I figured it would be a good place to ask!
I have an extract that is named like:
myFile.txt.pgp.20070820
It's stupid because the timestamp is AFTER the .pgp extension. However, that is how it is and I can't change...
Hi,
I have table where I need to reverse the signs of all the numbers in the table.
e.g)
2,000 needs become -2,000
and
-2,000 needs to become 2,000
Help... do I need a cursor to do this? Or is there an easier way??
Thanks
Hi,
Basically, I want a query to detect if the data in TableA is the *exact same data* as in TableB, row for row, column for column.
Help, is there a way to do this using SQL?
Thank you
Hi,
I want to set the result of EXEC(@SQL) to a variable. That is, I want the MAX(ProductionDate) to be stored in a variable called @MaxTradeDate.
It has to be dynamic because @myTable will be a parameter whose value will change.
SET @SQL =
'SELECT MAX(ProductionDate) FROM ' + @myTable...
Hi,
Getting errors on:
SELECT
ab.ClosingBalance,
CASE
WHEN v1.Broker = 'Smith Barney'
THEN NULL
ELSE
COALESCE(v1.Balance1, v2.Balance2) AS BegBalance
END
FROM myView1 v1
LEFT OUTER JOIN myView2 v2
ON v1.Broker = v2.Broker
The error is:
Msg 156, Level 15, State...
This isn't a sql server question, per se, but it's definitely related to a sql server ssis project.
Basically, every day I download a bunch of files from an ftp site using ssis.
I want to keep 2 weeks worth of files. Sometimes I load the same files every day, for example:
8/3 download...
Help. Can't figure this out. These queries *should* operate on the same number of rows but they don't:
-- updates 2 rows
begin tran
UPDATE t1
SET t1.IndustryCode = t3.Industry
FROM IndustryTable t1
JOIN CompanyTable t2
ON t1.IndustryID = t2.IndustryID
JOIN CorrectTable t3
ON...
Hi,
Here's my problem. I need to write a query that checks to see if some values do NOT exist in a table (as compared to another table). If they don't exist, I want the query to select the non-existing values in a "array", so that I can email the list.
This is what I have so far, but it's...
I just want to verify: Running DBCC REINDEX *only* works if the table has a CLUSTERED index, correct?
My testing shows that heap tables are not affected at all by reindexing.
Just want to confirm this!!
Hi,
I am attempting to troubleshoot a "mysterious" performance problem. We have an Excel vba application that calls a function in SQL Server 2000.
The function performs very differently from Excel than it does from QA. That is, it's a lot slower from Excel. Also, the performance changes due to...
Hi,
Is there a way to see the same data one sees in TASK PAD (in 2000), as there is in 2005?
I have (or had) a script that did this, but I can't find it now - arggghh.
I just want to be able to see when the LAST LOG backup occurred, but task pad doesn't exist in 2005.
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.