Viewing 15 posts - 2,461 through 2,475 (of 3,957 total)
Prettiness and speed are apparently not conflicting requirements:
PRINT 'Dwain.C COLLATE + CROSS APPLY'
SET STATISTICS TIME ON
SELECT @Email=RIGHT(
STUFF(a.email
,CHARINDEX('@',...
November 21, 2012 at 2:50 am
This probably isn't what you're looking for either but we'll give it a shot:
;WITH Amounts AS (
SELECT *,
...
November 21, 2012 at 2:27 am
Mark-101232 (11/21/2012)
PRINT 'Dwain.C COLLATE'
SET STATISTICS TIME ON
SELECT @Email=RIGHT(
STUFF(email
,CHARINDEX('@', email COLLATE Latin1_General_BIN2)
...
November 21, 2012 at 1:40 am
Boys, boys. If you're going to argue about performance may I interject a new dog into this race?
DECLARE @Email VARCHAR(100) = 'John.Doe@companyabc.com'
SELECT Email=RIGHT(
STUFF(@Email
...
November 20, 2012 at 5:53 pm
kramaswamy (11/19/2012)
1) What's the difference between using an UPDLOCK and using a higher-level lock? Should I also be using ROWLOCK and XLOCK, or is that overkill?
2) How long...
November 19, 2012 at 9:38 pm
BTW I forgot to mention this.
Kudos to you for trying to think ahead to the concurrency scenarios. Many people don't and that causes untold problems that are only seen...
November 19, 2012 at 7:13 pm
Interesting problem, but you may have missed something. Shouldn't your PU table also include the quantity of product a particular user has on loan?
The code below should handle your...
November 19, 2012 at 6:57 pm
Eugene Elutin (11/19/2012)
Michael Valentine Jones (11/19/2012)
This should work also:
select
abs(sign(col1)+sign(col2)+sign(col3)+
sign(col4)+sign(col5)) as NegativeCount
sign(col1)+sign(col2)+sign(col3)+
sign(col4)+sign(col5)+5 as PositiveCount
from
MyTable
Have you tested it? You should try:
CREATE TABLE [dbo].[MyTable](
[col1] [int] NOT NULL,
[col2] [int] NOT NULL,
[col3]...
November 19, 2012 at 6:02 pm
abdul_rouf26 (11/18/2012)
Many many thanks SSCommitted.You solved my problem.:-)
While many have suggested that I should be committed, my board handle is actually Dwain.C!
You're welcome anyway.
November 19, 2012 at 12:00 am
VegasL (11/18/2012)
I tried
select LEFT(127.0.0.1,len(127.0.0.1-charindex('.',reverse(([Ip]))
from [dbo].[TestTable]
but am getting
Incorrect syntax near the keyword 'from'.
127.0.0.1 is column name.
Since I'll probably have a list of over 100k I don't think the...
November 18, 2012 at 10:47 pm
Many ways. Choose your poison:
DECLARE @T TABLE (IP VARCHAR(30))
INSERT INTO @T
SELECT '102.89.93.101'
UNION ALL SELECT '100.100.10.1'
UNION ALL SELECT '123.94.9.121'
SELECT PARSENAME(IP, 4) + '.' +
PARSENAME(IP, 3)...
November 18, 2012 at 10:24 pm
Under All Programs/Microsoft SQL Server 2008/Configuration Tools
run: SQL Server Installation Center
Then select Tools/Installed SQL Server features discovery report
November 18, 2012 at 10:12 pm
To start with, the XML you provided won't parse:
DECLARE @XML XML = '
<RuleData ReturnVariable="">
<MateProperties>
...
November 18, 2012 at 10:02 pm
CELKO (11/18/2012)
Why do you want to write proprietary, unmaintainable code?
Job security?
November 18, 2012 at 8:19 pm
CELKO (11/18/2012)
Yes, we can help you be a bad SQL programmer, if you really want to be a bad programmer. But why?
So you can be promoted to a management...
November 18, 2012 at 8:18 pm
Viewing 15 posts - 2,461 through 2,475 (of 3,957 total)