Viewing 15 posts - 3,496 through 3,510 (of 4,087 total)
It looks like you're trying to run this on a SQL 2005 server. MERGE was introduced in SQL 2008, so it will produce those exact errors when run on...
November 15, 2011 at 8:26 am
Even so, the performance may still be better using the string splitter than without. The only way to now for sure is thorough testing, which is why I initially...
November 11, 2011 at 1:21 pm
Peter Brinkhaus (11/11/2011)
drew.allen (11/11/2011)
Peter Brinkhaus (11/11/2011)
No need for a string splitter. Also Cadavre's solution can be simply modified to leave out the false positives:
Your solution is not SARGable. If...
November 11, 2011 at 12:49 pm
Peter Brinkhaus (11/11/2011)
No need for a string splitter. Also Cadavre's solution can be simply modified to leave out the false positives:
Your solution is not SARGable. If you care at...
November 11, 2011 at 10:49 am
Adi Cohn-120898 (11/11/2011)
November 11, 2011 at 10:38 am
Cadavre (11/11/2011)
Try this: -
SELECT DATEADD(DAY, DATEDIFF(DAY, 5, @calenderDate) /7 * 7, 5)
This doesn't work for dates falling on Saturday, it will give you the current Saturday rather than the previous...
November 11, 2011 at 10:00 am
shalini72011 (11/10/2011)
I have a requirement to check why the Trd_Linked column is getting 'N' for legal 206337
UPDATE #Rpt SET Trd_Linked = 'N' --setting default value...
November 10, 2011 at 12:18 pm
Dan Williams-449672 (11/10/2011)
November 10, 2011 at 9:29 am
BrainDonor (11/9/2011)
INSERT INTO TestResult(Total)
SELECT CONVERT(VarChar,Count(*) + 1)
FROM dbo.TestData
WHERE 1=1
+ ' of ' +
(SELECT CONVERT(VarChar,Count(*) + 1)
FROM dbo.TestData
WHERE 1=1);
The posted code is missing a paren.
It's looking for records where
WHERE 1...
November 10, 2011 at 9:20 am
You can also use nvarchar(max) which replaces ntext.
Drew
November 10, 2011 at 7:44 am
It's best NOT to use BETWEEN when using datetime ranges. You should use the following instead
WHERE YourDate >= StartDate
AND YourDate < EndDate
This will prevent you from double counting any...
November 9, 2011 at 3:09 pm
I assumed that Table A was a staging table of some kind and that the OP was trying to move data to Tables B and C.
Drew
November 9, 2011 at 11:45 am
The other option is to use the OUTPUT clause to return ALL of the new IDs rather than just the LAST new ID that you would get with scope identity.
Drew
November 9, 2011 at 11:32 am
There are problems with your data model that make this problem more difficult. Specifically, it allows conflicting values. For example,
SELECT '7','Nov 16 2011 12:00AM','Nov 16 2011 11:59PM','Available' UNION...
November 9, 2011 at 7:21 am
Welsh Corgi (11/8/2011)
I probably won't be able to use this for the SSIS Excel Worksheet as Dynamic Headers followed by the Output from a CTE.
If SSRS is a possibility, it...
November 8, 2011 at 9:29 am
Viewing 15 posts - 3,496 through 3,510 (of 4,087 total)