Activity overview
Latest activity by amachanic
To be honest, I wish you hadn't told me about the line breaks in identifiers... it's one of those things I'm going to pretend I never heard (*puts hands over eyes and ears*) [image] / comments
To be honest, I wish you hadn't told me about the line breaks in identifiers... it's one of those things I'm going to pretend I never heard (*puts hands over eyes and ears*)
Aggressive isn't necessarily a bad thing. My biggest complaint right now is that I can't do the:
SELECT * FROM hum.
... and have it automatically select HumanResources and then immediately present a list of choices from there. That's how VS2005 works (at least, the C# intellisense, which in my opinion is by far the best I've ever worked with -- the VB intellisense in 2005 is crap IMO)... I still feel like the SQLPrompt intellisense is working against me just a bit instead of with me all the time. The VS intellisense pops up all the time, but I rarely feel like it's in my way (it does happen, but only maybe 1% of the time). With SQLPrompt, that number is currently around 25%, and then of course it's not even popping up sometimes when it should. So maybe you need it to be more aggressive, but at the same time a little bit smarter. / comments
Aggressive isn't necessarily a bad thing. My biggest complaint right now is that I can't do the:
SELECT * FROM hum.
... and have it automatically select HumanResources and then immediately present...
That works -- pops up a correct list. / comments
That works -- pops up a correct list.
OK, I just checked, and yes, that's checked.
If I just hit "." after hitting [Enter] (when I select HumanResources from the candidates list), nothing happens. I don't get a list of tables until I do [Backspace], then type "." again...
By the way, some other weird behavior I just found:
Type:
SELECT * FROM hum.
(period after hum) -- A list of tables in the current database pops up, in alphabetical order. I personally don't think a candidate list makes sense there. Better would be that as soon as I hit ".", HumanResources is automatically selected and I'd see a list of tables in the schema -- that would be in-line with the way intellisense in VS works. / comments
OK, I just checked, and yes, that's checked.
If I just hit "." after hitting [Enter] (when I select HumanResources from the candidates list), nothing happens. I don't get a list of tables until I ...
I can show you one version that doesn't work...
First, the following does work:
SELECT *
FROM [HumanResources].[EmployeeAddress] ea
JOIN [HumanResources].[Employee] e ON --***
JOIN [HumanResources].[EmployeeDepartmentHistory] edh ON e.[EmployeeID] = edh.[EmployeeID]
... type space before the *** comment and you get joins between "e" and "ea" ... one comment here -- I'd like to see the joins go BOTH ways if possible. I actually prefer doing <table I'm joining to>.col = <table I'm joining from>.col. A small semantic difference, but just the way I like to write my SQL.
Now, a version that doesn't work... did you know that the ON clause can go in one of two places?
SELECT *
FROM [HumanResources].[EmployeeAddress] ea
JOIN [HumanResources].[Employee] e
JOIN [HumanResources].[EmployeeDepartmentHistory] edh ON e.[EmployeeID] = edh.[EmployeeID]
ON --***
Hit space before the *** comment and you'll get a column list rather than JOIN candidates. The ONs here are nested in the same order as the JOINs, so you should get a list of candidates for the JOIN between "e" and "ea". (Note, I absolutely *hate* this syntax, but I see it from time to time so I suppose it should be supported)
Now, another weird thing... What if I accidentally leave the ON below the JOINs?
SELECT *
FROM [HumanResources].[EmployeeAddress] ea
JOIN [HumanResources].[Employee] e ON --***
JOIN [HumanResources].[EmployeeDepartmentHistory] edh ON e.[EmployeeID] = edh.[EmployeeID]
ON
Again, hit space before the *** comment and it's broken... Until I do something like:
SELECT *
FROM [HumanResources].[EmployeeAddress] ea
JOIN [HumanResources].[Employee] e ON --***
JOIN [HumanResources].[EmployeeDepartmentHistory] edh ON e.[EmployeeID] = edh.[EmployeeID]
ON x
Some little bug in the parser, it seems? / comments
I can show you one version that doesn't work...
First, the following does work:
SELECT *
FROM [HumanResources].[EmployeeAddress] ea
JOIN [HumanResources].[Employee] e ON --***
JOIN [HumanResources]...
Comments are an interesting question... but what about strings / dynamic SQL? If this works:
/*
SELECT * FROM hum
*/
(brings up HumanResources in the AW database)
... then why shouldn't this work:
---
DECLARE @... VARCHAR(MAX)
SET @... = 'select * from hum'
---
I personally don't type a lot of SQL in comments, but I do a fairly large amount of work with dynamic SQL. / comments
Comments are an interesting question... but what about strings / dynamic SQL? If this works:
/*
SELECT * FROM hum
*/
(brings up HumanResources in the AW database)
... then why shouldn't this work:...
OK, I just tried again, and it's quite a bit better. Not sure what happened last time, as SSMS had been open for a while before I tried, but anyway...
What happens now:
SELECT *
FROM hum
-- get HumanResources
Hit [Enter]. Then type "."
-- get no tables [image]
Hit [Backspace]. Then type "." again
-- Now I get a list of tables...
So if you can just fix that extra [Backspace]/"." requirement, things will be very nice [image] / comments
OK, I just tried again, and it's quite a bit better. Not sure what happened last time, as SSMS had been open for a while before I tried, but anyway...
What happens now:
SELECT *
FROM hum
-- get Hu...
Hi Bart,
I'm not sure what the issue is. Can't you just grab the system view columns from the sys.all_columns view? What's keeping you from doing so? / comments
Hi Bart,
I'm not sure what the issue is. Can't you just grab the system view columns from the sys.all_columns view? What's keeping you from doing so?
Also, try assigning default values to one or both params and then do:
SELECT dbo.rrr(def
... and the word "default" does not come up. / comments
Also, try assigning default values to one or both params and then do:
SELECT dbo.rrr(def
... and the word "default" does not come up.
Could be more helpful when calling UDFs
Create the following UDF:
CREATE FUNCTION rrr (@id2 INT, @id int)
RETURNS INT AS
BEGIN
RETURN (@id)
END
Now do:
SELECT dbo.rrr(
I see both params -- very useful -- but they're out of order. How ab...