Viewing 15 posts - 886 through 900 (of 1,228 total)
Put a PRINT before the INSERT statement, like this:
PRINT @l_sql_string
insert into TSTDB.dbo.CAPACITY...
The last query printed will be the one which fails. Copy and paste it into a new query window...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 1:05 pm
DROP TABLE #Test
CREATE TABLE #Test (Col1 VARCHAR(250))
INSERT INTO #Test (Col1) VALUES ('abc123 , xyz789')
INSERT INTO #Test (Col1) VALUES ('a1 , z9')
INSERT INTO #Test (Col1) VALUES ('b123456 , x99')
SELECT Col1,
Col2...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 12:55 pm
GaMusicMan (4/26/2011)
Print (5596 / 11784)
This should return the decimal .47 . Instead...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 12:23 pm
PSB (4/26/2011)
...
SELECT DISTINCT txn.Terminal,txn.ActivityDate,datepart (hh,ActivityTime) As H
FROM dbo.ABCD txn
WHERE ActivityDate...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 11:46 am
SQLRNNR (4/26/2011)
Steve Jones - SSC Editor (4/26/2011)
RainWe have SNOW
Throughout the four-day Easter break here in the UK (that's the country with Cambridge in it, oh, and London too), the weather...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 11:30 am
What are the rules associating different names?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 11:24 am
Select A, B, C, D, E = CAST(NULL AS CorrectDataType)
from tabl1
Union
Select A, B, C, D = CAST(NULL AS CorrectDataType), E
from tbl2
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 11:14 am
Syed Jahanzaib Bin hassan (4/22/2011)
Check this script if you have any problem or modification required then tell me
Regards,
Syed Jahanzaib Bin Hassan
MCTS | MCITP | OCA | OCP | OCE |...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 10:24 am
SELECT c.CompanyId, i.IndustryId
FROM dbo.[source] s
INNER JOIN dbo.Industry i ON s.Industry = i.IndustryName
INNER JOIN dbo.Company c ON s.company = c.CompanyName
WHERE c.CompanyId IS NOT NULL AND i.IndustryId IS NOT NULL...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 9:05 am
Can you post the actual error message, and the actual statement which causes it? The following works just fine on SP1:
CREATE TABLE #TableD (FieldE VARCHAR(10) NOT NULL)
INSERT INTO #TableD VALUES...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 3:54 am
-- What is the odd character and how many rows are affected?
SELECT ASCII(LEFT(REVERSE(MyColumn),1)) FROM MyTable WHERE ASCII(LEFT(REVERSE(MyColumn),1)) < 48
-- How does this work?
DECLARE @MyString VARCHAR(15)
SET @MyString = 'Something' + CHAR(13)
SELECT...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 3:44 am
The values returned by each condition of a CASE construct must be of the same data type. Change
,CASE When APrio1 = 4 then RespT1
When APrio2 = 4 then RespT2
When...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 26, 2011 at 2:22 am
Jeff Moden posted an elegant proof not so long ago that simple CASE is converted internally to searched CASE, I'll see if I can find it.
http://www.sqlservercentral.com/Forums/FindPost989878.aspx
Edit: added link
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 25, 2011 at 11:48 pm
Even with NOT EXISTS?
SELECT d.*
FROM Data d
WHERE NOT EXISTS (SELECT 1 FROM Intervals i WHERE d.dValue BETWEEN i.ivFrom AND i.ivTo)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 25, 2011 at 11:45 pm
I'd try adding IvTo to that clustered index on IvFrom. Guessing wildly, both versions of the query would take about the same time, and rather less than you're currently getting....
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 25, 2011 at 9:18 am
Viewing 15 posts - 886 through 900 (of 1,228 total)