Viewing 15 posts - 1,216 through 1,230 (of 8,416 total)
drew.allen (1/11/2012)
ASCII(0) is interpreted as end-of-string by some software, but SQL Server is most definitely NOT one of them, although it appears that the grid view in SSMS is.
Yes, well...
January 11, 2012 at 1:59 pm
drew.allen (1/11/2012)
I think it's actually even simpler.
That has a different semantic though. Example:
CREATE TABLE #Students
(
StudentID integer,
Programme ...
January 11, 2012 at 1:54 pm
stephen99999 (1/11/2012)
Wouldnt a date table work in this situation as well? sort of like what we find in data warehouses?
Yes it would.
January 11, 2012 at 1:12 pm
Greg Snidow (1/11/2012)
The 'B' shows up no matter what I put in for the length parameter of CHAR. I still don't know what it means.
So 'B' is just ASCII...
January 11, 2012 at 12:57 pm
You could use the sys.dm_exec_connections view.
January 11, 2012 at 12:35 pm
DB2 HEX appears to do a similar thing as using the optional style parameter of CONVERT when converting from binary to a string type:
SELECT
CONVERT(char(4), 0xDEADBEEF),...
January 11, 2012 at 11:52 am
Jack Corbett (1/11/2012)
Oh, and as far as inserting a NULL code, you shouldn't have NULL's:-P
:laugh: But seriously, the example code did not specify NOT NULL as a constraint...
January 11, 2012 at 11:18 am
Gianluca Sartori (1/11/2012)
AFAIK, HOLDLOCK means SERIALIZABLE: doesn't that cut concurrency at all?
Not really, it only applies to the one table, and there would ordinarily be an index on the CODE...
January 11, 2012 at 11:11 am
Gianluca Sartori (1/11/2012)
@paul-2: why HOLDLOCK? Is there a chance of intra-query non-repeatable reads in MERGE statements?
http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condition-With-MERGE.aspx
You broke my code! That doesn't allow me to insert a NULL code. ...
January 11, 2012 at 10:57 am
Jack Corbett (1/11/2012)
1. I haven't really used MERGE much so I don't think it of it, but it is probably the best solution in this case.
It has many fine...
January 11, 2012 at 10:55 am
Also none of the options allows you to insert a NULL code.
January 11, 2012 at 10:44 am
None of them for the reasons already stated, plus option 2 also contains a race condition.
DECLARE @MYCODE int = NULL
DECLARE @ID int = NULL
DECLARE @OUTPUT TABLE (ID int)
MERGE dbo.myTable WITH...
January 11, 2012 at 10:35 am
drew.allen (1/11/2012)
I disagree.
No worries.
Granted, if this method was being used in production code you would have to consider the context to determine whether it was worth rewriting the code to...
January 11, 2012 at 9:50 am
drew.allen (1/11/2012)
If you read the article, you'll see that even the mere 4000 row CTE has a significant performance impact. That's how badly recursive CTEs can perform.
You might have...
January 11, 2012 at 8:14 am
drew.allen (1/11/2012)
Bob Cullen-434885 (1/10/2012)
I started to look at an alternative approach, using a recursive CTE to generate a continuous list of dates that covered the report range
Jeff Moden has an...
January 11, 2012 at 7:08 am
Viewing 15 posts - 1,216 through 1,230 (of 8,416 total)