Viewing 15 posts - 1,366 through 1,380 (of 2,894 total)
This kind of question appears on SQL forums quite often...
There are few possible reasons for this to happen, parameter sniffing is one of them.
August 10, 2012 at 9:56 am
...
I like the idea of having a sid (a surrogate id) on my tables, even if I do have a natural key that can serve as a primary key. ...
August 10, 2012 at 9:52 am
In your case you can use:
;WITH SUM_SALES_SUMMARY
AS
(
SELECT CSCODE AS CSCODE
...
August 10, 2012 at 9:33 am
Some people will tell you that you should always use natural keys (JC the master of them :-)) and others will tell you that you should always use surrogate keys....
August 10, 2012 at 9:22 am
Use this:
'%[^a-z ''^-]%'
August 10, 2012 at 9:14 am
Sector7G (8/10/2012)
I’d like to confirm if what I am attempting is possible. I suspect it’s not, but wanted to ask. I am trying to re-write a query that...
August 10, 2012 at 8:59 am
You should learn about aggregate functions.
In your case you will need to use SUM()
August 10, 2012 at 8:45 am
I guess to answer OP given question any of T-SQL solution would do, I also think that interviewer will be looking for answer in SQL. I wouldn't go with...
August 10, 2012 at 8:09 am
I don't have VS to test...
try:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Text.RegularExpressions;
public partial class UserDefinedFunctions
{
static readonly Regex _regex = new Regex(@"[^0][0-9]*[^0]", RegexOptions.Compiled);
...
August 10, 2012 at 4:54 am
try to return
(SqlString) s.Value.TrimStart('0').TrimEnd('0');
instead of
new SqlString(s.Value.TrimStart('0').TrimEnd('0'));
what about Regex?
Don't forget to create static Regex object instead of instance in the function.
To remove leading and trailing...
August 10, 2012 at 4:44 am
...
Possibly so, although I can confirm that PATINDEX does not.
You cannot even remotely compare performance of PATINDEX and .NET Regex...
PATINDEX can only find the pattern in the string, but to...
August 10, 2012 at 4:20 am
...
Wow, I'm glad I don't have to debug your code:-D
Yeah,
you better not
debug my code
without note
it can explode!
:hehe:
August 10, 2012 at 4:12 am
You can find a most of details about this one in BoL.
Usually this one is used for aggregation-like string concatenation...
August 10, 2012 at 4:07 am
dwain.c (8/10/2012)
Eugene Elutin (8/10/2012)
You should try CLR too...
Hah! I was waiting to hear someone suggest that. Not surprised it was you.
Where have you been lately Eugene? Haven't...
August 10, 2012 at 4:04 am
Viewing 15 posts - 1,366 through 1,380 (of 2,894 total)