| Author |
Topic |
|
RajJol
Starting Member
17 Posts |
Posted - 2011-01-05 : 08:20:15
|
| Hi,On a weekly basis, myself and my manager have a meeting where we take 5/10mins out to discuss and present a T-SQL feature that may be useful for us. This week is my turn and I have no idea what I can present. Below is a list of what we have already covered so you are able to see what level of detail I am looking for. Any suggestions would be appreciated. 1. Schemas 2. Common Table Expressions (CTE's) 3. User Defined Functions in T-SQL 4. User Defined Procedures in T-SQL 5. SQL Server Triggers 6. SQL Server Database Diagrams 7. Making SQL Server Case SensitiveThank You in advanced,Raj. |
|
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2011-01-05 : 08:42:41
|
Parameterized Table Valued Functions. Poor planning on your part does not constitute an emergency on my part. |
 |
|
|
RajJol
Starting Member
17 Posts |
Posted - 2011-01-05 : 08:48:08
|
| Thank you for your suggestion Dataguru1971. Do you know of any good websites I am able to research 'Parameterized Table Valued Functions' on? I have never heard or come across these before. Any of your own examples would be great. |
 |
|
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-01-05 : 13:04:00
|
| Efficient temporal queries |
 |
|
|
RobertKaucher
Posting Yak Master
169 Posts |
Posted - 2011-01-07 : 15:50:34
|
quote: Originally posted by russell Efficient temporal queries
He probably doesn't have time to discuss that topic... Get it, he doesn't have *TIME*. Just kidding. I don't really crack myself up that much.Have you got any good resources on this topic. It strikes me as interesting.===http://www.ElementalSQL.com/ |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-01-07 : 16:46:15
|
quote: Originally posted by RobertKaucher
quote: Originally posted by russell Efficient temporal queries
He probably doesn't have time to discuss that topic... Get it, he doesn't have *TIME*. Just kidding. I don't really crack myself up that much.Have you got any good resources on this topic. It strikes me as interesting.===http://www.ElementalSQL.com/
LOL.Itzik Ben-Gan has a series of articles in SQL Mag on the subject |
 |
|
|
RobertKaucher
Posting Yak Master
169 Posts |
Posted - 2011-01-10 : 11:14:48
|
quote: Originally posted by russellLOL.Itzik Ben-Gan has a series of articles in SQL Mag on the subject
Thank you, I will go through my subscription and see what I can find. Although I must admit that anything I read by Itzik Ben-Gan generally causes me to have to re-read it 10 or 20 times before I have a full grasp of what he is saying. The amount of depth he can put into something that might seem simple is staggering. His articles/chapters on ternary logic blow my mind everytime I read them.===http://www.ElementalSQL.com/ |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-01-10 : 12:53:23
|
Yeah, a lot of his stuff is pretty advanced. But he does a LOT of performance testing and then writes about the results.Here's a very quick example; suppose you want to strip the time portion off of a datetime value:SELECT Convert(Datetime, left(getdate(), 11))SELECT DateAdd(Day, DateDiff(day, 0, getdate()), 0) Both queries will return the same correct result (at least using SQL_Latin1_General collations), but the 2nd query is far more efficient. Additionally, most of us will pass dates in ccyymmdd format, as it is not subject to misinterpretation or to regional settings ('20110110' and not '1/10/2011' for example).We can take that and start to do things like find the first or last day of the month, week or year...etc.I find it to be a great discussion topic because so many people get it wrong, and it is a very common type of question on the forums. |
 |
|
|
RobertKaucher
Posting Yak Master
169 Posts |
Posted - 2011-01-10 : 22:32:04
|
| I suppose we'd have to throw in his example from Fundamental T-SQL regarding WHERE YEAR(orderdate) = '2007' and his suggestion of using WHERE orderdate >= '20070201' AND orderdate < '20080101' to prevent full table scans and I would imagine the additional hit of converting the datetime.I'm glad you brought this up. I'm going to make sure I pay closer attention to these sorts of things from now on.===http://www.ElementalSQL.com/ |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-01-11 : 03:09:12
|
| Some more topic suggestions:- recursive cte's- quirky updates- proper parameterized dynamic sql- openrowset/openquery- bulk insert/bcp- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
 |
|
|
|