|
You mean SQLDeveloper- it's an IDE from Oracle (FREE) - Never been a TOAD guy either but it does do explain plans, intellisense, run scripts and even do a diff between schemas.
hth
Al
|
|
|
|
|
J4amieC wrote: All of that just to output a date WTF I'll stick to SQL Server
I'll second that
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
is there really any difference between these things or they're just name differently in Oracle and SQL Server respectively for the same thing?
|
|
|
|
|
AFAIK basically they are the same thing. Different restrictions etc may apply, but the idea is to have an intermediate result set.
The need to optimize rises from a bad design
|
|
|
|
|
Good Afternoon Guys
Am Accessing the table from another link Server in a Join and this gives my ASP Classic application an Error , here is where the Join is happening
SELECT DISTINCT
FARM_BOUND.OBJECTID AS BOUNDARY_AREA_ID, LB.CLASS AS CLASS_ID,
LB.GENERAL_PLAN_NO AS GP_NUMBER, LB.REMARK AS REMARKS,
LB.DATE_CAPTURED, LB.DATE_MODIFIED,
LB.PROCLAMATION_DATE AS DATE_PROCLAIMED, FILEMAP.REGION AS SG_REGION,
sde.VW_BOUNDARY_AREA_CLASS.CLASS AS CLASS, BC.EXTENSION, BC.NUMKEY AS NUM_KEY,
FARM_BOUND.GEOCODE AS GEO_CODE, FARM_BOUND.NAME, FARM_BOUND.NAME AS BOUNDARY_AREA, FARM_BOUND.STATUS AS STATUS_ID,
sde.VW_BOUNDARY_AREA_STATUS.STATUS,
CASE WHEN LB.MUNICIPAL_STATUS = 0 --changed from VARCHAR to INT 2005-11-24 --'0'
THEN 'WITHIN'
--ELSE
-- CASE WHEN LB.MUNICIPAL_STATUS = 'WITHIN'
-- THEN 'WITHIN'
ELSE 'OUTLYING'
-- END
END AS MUNIC_STATUS
FROM sde.VW_BOUNDARY_AREA_STATUS
RIGHT OUTER JOIN sde.FARMBOUNDARY_PLUS_LANDBOUNDARY FARM_BOUND
ON sde.VW_BOUNDARY_AREA_STATUS.STATUS_ID COLLATE SQL_Latin1_General_CP1_CI_AS = FARM_BOUND.STATUS COLLATE SQL_Latin1_General_CP1_CI_AS
LEFT OUTER JOIN CENETGIS001.Surveyor_General.sg_admin.SG_INDEX FILEMAP
RIGHT OUTER JOIN CENETGIS001.SDE.sde.LANDBOUNDARY LB
LEFT OUTER JOIN sde.VW_BOUNDARY_AREA_CLASS
ON LB.CLASS COLLATE Latin1_General_CI_AS = VW_BOUNDARY_AREA_CLASS.CLASS_ID COLLATE SQL_Latin1_General_CP1_CI_AS
ON FILEMAP.SG_NO COLLATE Latin1_General_CP1_CI_AS = LB.GENERAL_PLAN_NO COLLATE SQL_Latin1_General_CP1_CI_AS
ON FARM_BOUND.GEOCODE COLLATE Latin1_General_CP1_CI_AS = LB.GEOCODE COLLATE Latin1_General_CP1_CI_AS
LEFT OUTER JOIN CENETGIS001.SDE.SDE.BOUNDARY_CODES BC
ON BC.GEOCODE COLLATE Latin1_General_CI_AS = FARM_BOUND.GEOCODE COLLATE SQL_Latin1_General_CP1_CI_AS
i have added the Collation methods as you see , but still giving me an Error
Msg 447, Level 16, State 0, Procedure VW_BOUNDARY_AREA, Line 7
Expression type int is invalid for COLLATE clause.
and in my Application it Shows
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
The int datatype has no collation - one of your types must be an integer...
|
|
|
|
|
What is the difference between IS NULL, = 'NULL' in MS SQL. When I query a table to get the first 10 rows with the following condition:
SELECT TOP 10 *
FROM TableA
WHERE ColumnX IS NULL
It gives me random rows, not the first 10 rows. ColumnX is all nulls but I need the first n rows. I noticed when I use this condition then I always get the first 10 rows:
WHERE ColumnX = 'NULL'
I know IsNull is a function but what is the difference between the other two?
|
|
|
|
|
= 'NULL' always evaluates to true...
|
|
|
|
|
Do you really mean = 'NULL' (in quotation marks)? If so, 'NULL' is just a string whereas would be 'ABC' so it doesn't have anything to do with the reserver word NULL in SQL.
If you mean = NULL (without quotation marks), that condition based on ANSI standard is always false (nothing is equal to NULL.
In different databases this may vary and in SQL Server the logic can be modified in database settings.
The need to optimize rises from a bad design
|
|
|
|
|
Mika Wendelius wrote: If you mean = NULL (without quotation marks), that condition based on ANSI standard is always false (nothing is equal to NULL.
Actually, they can evaluate to (unknown)
check this article[^]
|
|
|
|
|
Couldn't open the article, but that's exactly my point.
NULL is never equal to anything since it means unknown. For example NULL = NULL is not true since we don't know the values that are compared. Same goes with != (or <> ) operators etc.
The need to optimize rises from a bad design
|
|
|
|
|
use is null like you would use ...== null in c# ok? dont place "=" near null.
isnull() you use if you can get a null value in a column (or whatever) and you place a 2nd value (of same type) there if null happens.
declare @a int
set @a = 15
if (@a is not null)
begin
SELECT id,name,age,isnull(adress,'no adress') FROM dbo.Clients
end
got it?!
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
CodingYoshi wrote: SELECT TOP 10 *
FROM TableA
WHERE ColumnX IS NULL
This will give you random records where ColumnX is null.
A top qualifier really needs an Order By as well
CodingYoshi wrote: WHERE ColumnX = 'NULL'
This is testing for the string value of the characters "NULL"
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
When run the following script returns an ORA-00936 missing expression error.
[Code]
select MemNumber,
Turnover
from
(
select mem_number MemNumber,
sum(trans_turnover) Turnover
from members
join transact
on mem_number = trans_code
where Trans_date between '&Start' and '&End'
and mem_barred = 0
group by mem_number
order by turnover desc
)
where rownum <=200
/
[/code]
Please tell me how I should fix it.
Regards,
Alf Stockton
|
|
|
|
|
[Code]
where rownum <=200
[/code]
Your where clause references a "rownum" column...
Your select statement does not produce a column named "rownum"...
hth
Al
|
|
|
|
|
Thank you. I will try your suggestion.
Regards,
Alf Stockton
|
|
|
|
|
rownum is a pseudocolumn so it's created automatically and defining it in the inner select would change the logic of the statement.
The need to optimize rises from a bad design
|
|
|
|
|
|
Didn't quite understand your point? There's a good example in the article:
select *
from
(select *
from t
order by id)
where rownum <= 10
which returns top 10 rows. Rownum is placed on the outer query and the inner query selects only columns from the table t. Rownum is used on the ordered result set to ensure that really top 10 rows based on id column are returned.
I understood that the original query in this question was doing top N fetch.
The need to optimize rises from a bad design
|
|
|
|
|
I know that's why I said good catch... when I saw the rownum I was thinking of it as
(
SELECT col1, col2,ROW_NUMBER() OVER (PARTITION BY col1_id ORDER BY col1) AS rownum
FROM employee
)
where rownum < 200
My bad..
hth
Al
|
|
|
|
|
Oh, I see.
I clearly misunderstood your reply to my post. Sorry for that.
The need to optimize rises from a bad design
|
|
|
|
|
If you're running this in SQL*Plus or a program based on that, I would guess that the problem is in & character. This is normally reserved for prompting values so your statement may evaluate to
where Trans_date between '' and ''
Also you 'should' provide an alias for sub select in FROM.
If you're using tools mentioned above, they should show you the line where the problem is.
The need to optimize rises from a bad design
|
|
|
|
|
Please can someone help me!!! I use SQL Server 2005 and I need to import the data in a sample SQL Db into my own SQL database.... I dont know how to do this please help. my boss is on my neck
|
|
|
|
|
Check this google result.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|