12,082 reputation
33371
bio website getsql.wordpress.com
location CT, USA
age
visits member for 3 years, 10 months
seen 14 hours ago

I'm a dude!


Mar
17
comment Joining two inline functions, slows considerably when filtering on second function
If you add a WHERE for that, it makes this an INNER join instead of an outer join. You're actually changing the shape of the plan.
Mar
16
comment Is there any way to set stored procedure options like ANSI NULLs to true or false outside of creation?
You can see the value in sys.sql_modules that the object was created with.
Mar
16
comment Is there any way to set stored procedure options like ANSI NULLs to true or false outside of creation?
It's stored in the metadata about the object, and I think you can set it through SMO though that essentially is rescripting it.
Mar
12
comment Why am I unable to use a temporary table more than once on my Stored Procedure?
You handle it like an actual table. CREATE TABLE #mytable (<columns>); insert into #mytable...
Mar
9
comment SQL Server hitting System.OutOfMemoryException but server has 10GB free
This is client side, I'm guessing. Whatever machine you are running these queries on is choking with the result set.
Mar
9
comment Is it possible to execute queries in random order?
You really need to get the statements in order, there's not going to be a dependable way to sort this out after the fact. And if you DO determine a way, it's not gonna scale or run with acceptable performance.
Mar
7
answered Join 2 columns in one table based on equal values in a third column
Mar
5
revised Deadlock scenario, where is this S lock coming from?
added 83 characters in body
Mar
5
answered Deadlock scenario, where is this S lock coming from?
Mar
4
comment Performance of Combination lookup
Good point, @ypercube. That would cover the group by as well I think.
Mar
4
answered Performance of Combination lookup
Feb
26
comment A transition table, is it a good idea?
Probably...It's fairly well normalized so whatever your parent record is for the import can be tied to the import data. Then you can have multiple versions if needed but know which records tie to which import.
Feb
26
comment A transition table, is it a good idea?
You need to share your schema to get more help. I don't think this should be hard to solve with some extra elements in your tables, like linking to an "import" table that tells who ran it, what version of the API, and what time.
Feb
25
comment Trying to attach a .mdf with missing .ldf
@Quent it's probably not a great idea to start off on a site by antagonizing the moderator who is trying to help you ask a better question.
Feb
25
comment How to speed up query which is using <@> operator?
@user606521 arguably being able to tune your database queries is MORE important on a big project, is it not?
Feb
19
comment SQL Server's aggregate functions ignore nulls. How do I correct this?
Aggregate functions are NOT concatenation operators. And as @ypercube mentioned this is defined in the SQL Standard.
Feb
16
comment Work queue with complex select and long processing: Ensuring concurrency
To be more specific, the methods in Remus' blog post are not really intended for letting users pick their own records - they are record delivery systems. If you're going to allow user autonomy it's a lot easier to track it as an attribute of the row.
Feb
16
comment Work queue with complex select and long processing: Ensuring concurrency
We solve this problem with a UserID column in the record. If the record has a UserID then someone is working on it. It works great for high-concurrency and we don't have to use a bunch of hints.
Feb
12
comment How can a primary key be inserted as foreign key?
In the SP you would declare @ORDERID as a variable internal to the SP, not as a param, and use it just like I listed above.
Feb
12
reviewed Approve How can a primary key be inserted as foreign key?