With all due respect, I don't think @James's answer is a solution here (the article yes, it's brilliant, the proposed solution I don't think so because it's not feasible to do computed columns every time estimate/actuals don't match). And also it doesn't match what your own fix was. By seeing the execution plan we could've seen that your query doesn't use the composite index but probably does a table scan with implicit conversion on that condition (just a guess now). — Marian44 secs ago
@Marian I agree. The article's case is similar but not exactly the same as the question.
@Marian And the OP's comment above (" When I added single quotes around the numbers in the IN clause the cardinality problem went away.") suggests it's an implicit conversion issue.
I spent 3 semesters teaching a C++ class at the local community college. It was interesting. I think that'd be what I'd like to do whenever I start winding down (and no longer need money because there ain't diddly there)
Some of the students were awesome. One was a non-traditional that ... man, he must have done a lot of drugs
I let them do a paper as extra credit and he turned in this crazy hippie manifesto talking about how all things are connected in the universe and love and such
@ypercube thanks for clarifying that. Same was my thought, but didn't articulate so well.
@JNK asked our licensing expert (@Mark) and it seems that your friend is right, now you can only buy the current version (2014) with permissions to downgrade one back version. That's kind of it, sorry.
Hi All, Just to clarify why I accepted James answer. It got me looking into multiple predicate issues. So I tested using single predicates and noticed that integers were being stored as varchar for the RateItemType field. When you hover over the accept tick you see the following tooltip: "Click to accept this answer because it solved your problem or was the most helpful in finding your solution". This was the most helpful answer in solving my problem. — Alan T24 mins ago
@AlanT fair enough. The problem with this is that future readers may not read the comments but in a similar problem, read the accepted answer that says "your problem is the fact your WHERE clause has multiple predicates on the same table" and get confused because that is not the main issue. And neither was a computed column how you solved it. — ypercube1 min ago
But find out who does the actual purchasing there, I suspect you're a SMB so you'll have a reseller attached to your account and they'll know this stuff off the top of their head
I have a stored procedure that populates the temp table #employee_benefits with a list of Ids. This table ends up being roughly 10,000 rows long. The query below then selects from a table called EmployeeBenefitData that has around 4 million rows.
SELECT ebd.EmployeeBenefitDataId, ebd.EmployeeB...
What value would index-seek have? Oh crap, I have an index-scan and all of these questions say it's bad, I need to mangle this plan for seeks. Meanwhile, their performance goes to shite because they did something dumb but they got their seeks
@rm-rf never been to sf. is it a nice area? in denver, our ballpark area is a case study in gentrification. went from a seedy area to where all of the yuppie kids move ;)
The Curse of the Billy Goat is a sports-related curse that was supposedly placed on the Chicago Cubs in 1945 when Billy Goat Tavern owner Billy Sianis was asked to leave a World Series game against the Detroit Tigers at the Cubs' home ballpark of Wrigley Field because his pet goat's odor was bothering other fans. He was outraged and declared, "Them Cubs, they ain't gonna win no more," which has been interpreted to mean that there would never be another World Series game won at Wrigley Field. The Cubs have not won a National League pennant since this incident and have not won a World Series since...
Your code does not make much sense at all. Build a comma separated value that you transform to XML that shred to rows. Why not just get the rows in the first place? — Mikael Eriksson7 mins ago
I'm sure I'm doing something totally stupid, but how do I get bcp to connect using TCP instead of trying to use named pipes? I'm connecting to an instance, so I'm using -SSERVER\INSTANCE
@MaxVernon If it is on the same server that is probably using shared memory. If it is a different server it is probably using named pipes. Why are you so bent on forcing BCP to use TCP/IP when other methods will probably work?
@MaxVernon PS I got this to work no problem: -S"SHELDON,56737" - I validated the port number in SQL Server Configuration Manager, not using netstat.
And yes, some people even move a default instance away from 1433, because they think 1433 is more vulnerable than any other port. A port scanner doesn't give a crap what number is used...
I'm going to turn auto-shrink off on our SQL Server 2008, but I was wondering if I need to wait until the end of the day when no one is on the server? Or, can I just make the change now? Thanks!
Real Men Don't Eat Quiche, by American Bruce Feirstein, is a bestselling tongue-in-cheek book satirizing stereotypes of masculinity, published in 1982 (ISBN 0-671-44831-5).
It popularized the term quiche-eater, referring to a man who is a dilettante, a trend-chaser, an over-anxious conformist to fashionable forms of 'lifestyle', and socially correct behaviors and opinions, one who eschews (or merely lacks) the traditional masculine virtue of tough self-assurance. A 'traditional' male might enjoy the ironically not so exotic egg-and-bacon pie if his wife served it to him; a quiche-eater, or Sensitive...
@AaronBertrand I got the port number from configuration manager, and I've tried connecting both from my workstation, and from the server itself. No go either way. As I said, I can get sqlcmd to connect using just the SERVER\INSTANCE name. So weird.
@AaronBertrand I'm not saying bcp can't use named pipes. Named Pipes is disabled in SQL Server Configuration Manager for the server in question. TCP/IP is enabled.
OK, brain aneurism. I can do this in PowerShell easy-peasy but C# not so much. I need to pull a list of just user databases using SMO in C#. Have this so far: var sourceSrv = new Server(sourceServer); var importDBList = sourceSrv.Databases;
I just can't seem to figure out how to filter out the system databases or is there another way of doing this stuff?
I have a table A on MySQL and a table B on SQL Server.
Now, I need to keep B in sync with A (one-way), but B should "always" remain accessible for querying (now, one second of downtime won't hurt anyone...). The sync should occur once every hour.
Some scenarios come to mind:
Check A for updat...
@AaronBertrand thanks very much for confirming that it works. Perhaps I'm doing something wrong with the command-line: bcp dbo.TableName out -SSERVER\INSTANCE -T -ddatabasename -oC:\TEMP\output.bcp
I think you can only do this with dynamic SQL. Replace the body of your SP with the following:
DECLARE @BACKUP_PATH as nvarchar(max) = 'Z:\BACKUPS\my_database_backup.bak'
IF object_id('sp_restore') IS NOT NULL
drop procedure sp_restore
go
CREATE PROCEDURE sp_restore AS
BEGIN
DECLARE...
@AaronBertrand this is SO DUMB. It seems bcp is, shall we say, anal, about the command-line. I had to use: bcp dbname.schema.tablename out c:\path\to\output.bcp -SSERVER\INSTANCE -T -n seems using the -o option to specify the output path is a no-no.
`SQLState = 08001, NativeError = 2 Error = [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [2]. SQLState = 08001, NativeError = 2 Error = [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a con nection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to a llow remote connections. For more information see SQL Server Books Online.
@AaronBertrand not much in there about the output file.
I am in the process of creating a stored procedure that creates a calendar table output that provides fields related to calendar day, fiscal date, and normalized date (I will explain normalized date in more detail shortly).
I have excluded a number of fields that I have already created successfu...
Ha ha, Aaron, I know this is unusual. We definitely a calendar table already. The idea is to have a stored procedure that we can hand off to any of our clients to implement quickly that will give us some customized date fields for reporting purposes. — k_j_s_brdsRblue6 mins ago
As I said, it sounds like you need another table for this. But how can I know?, the database design is heavily dependent on the requirements and I don't understand them clearly — Lamak24 secs ago
@swasheck They've been really easy to work with. They fixed the bugs we reported over a weekend and were happy to put us on a call with a software engineer (not sales or tech support) to discuss some questions about their de-duplication and compression internals.
@swasheck Yeah, i negotiated a signing bonus at my previous job because i was going to lose out on some vesting in my 401k match and would have to pay back a couple grand that former company had reimbursed me for grad school
I wasn't making enough that it really mattered, so everyone was cool
I think we are finally going to hire a DBA/database architect to wrangle in our developer's horrible DB designs. This will be nice. I've been helping review OLTP database designs since the application developer manager who was actually good with databases left the company.
If the BI consultant can spot how awful your OLTP design is, you have problems :-)
Wikipedia's page on "Ebola Virus Disease" states:
No specific treatment for the virus is available.
Wikipedia's page on "Ebola Virus" also states:
There is no cure for Ebola, but if people get care quickly from
doctors and nurses at a hospital, more of them live.
So how are there ne...