« first day (3024 days earlier)      last day (1860 days later) » 

6:26 AM
Morning
 
Morning
 
Morning
 
 
1 hour later…
7:40 AM
morning
 
8:18 AM
Morning
@ConcernedOfTunbridgeWells I see it more as dedicating a Saturday night to meeting a load of awesome people & having a good time. Definitely no giving up involved
3
 
9:02 AM
morning
 
9:21 AM
Morning all
 
10:30 AM
what I don't understand is that the user has real answers over on SO
 
@dezso Maybe their account was breached
 
 
2 hours later…
12:29 PM
@George.Palacios you are such an optimist (or sarcastic)
 
@dezso Hahaha. I like to think both
 
@Philᵀᴹ I've done my best. Not done great haha
 
 
1 hour later…
2:02 PM
So...I had a question closed yesterday as being a typo (Which it isn't), I believe it's actually due to a constraint. How do I view what the action of a constraint is, in MSSQL management studio 2014?
 
@JohnP You mean you just want the definition?
Should be Database > Tables > Table > Constraints > Right click -> script as > Create To
in the object explorer menu in SSMS
 
Hrm. This is weird then.
ALTER TABLE [dbo].[fdmConfigs] ADD CONSTRAINT [DF_fdmConfigs_isNew] DEFAULT ((0)) FOR [isNew]
GO
 
@JohnP So that just means that if you leave out the isNew column from an INSERT statement, 0 will be inserted instead of NULL
As in literally, the default value for the column is 0
 
Yeah, that's what is wierd.
 
@JohnP How so? That by default a new row isn't 'new'?
 
2:09 PM
I have a query I wrote to move a single entry from an archive table to an active table.
If I leave the isNew field out of the query, the row gets inserted again into the archive table (duplicated, essentially). If I add the isNew field into the query, it moves it to the active table.
 
@JohnP Did you check for triggers on [db1].[dbo].[table1]?
If you expand the table in SSMS, there is a folder named "Triggers"
 
@JoshDarnell Yeah, and there aren't any listed
 
@JohnP Are there any views that reference [db1].[dbo].[table1]?
 
only system views afaict
and does ms sql not use primary keys?
 
@JohnP It does but doesn't HAVE to
 
2:15 PM
@George.Palacios ok, thanks.
Anything besides a constraint or a view that would do this?
 
@JohnP It feels to me like a trigger like @JoshDarnell said. I can't think of anything else. Unless there's a separate job running to move the data between those tables
 
Maybe Synonyms?
Although that would be a cruel joke.
 
@JoshDarnell I am going through all the folders under the database, and synonyms doesn't have anything.
Neither does "database triggers"
 
It's difficult to tell without the actual table definitions and query text. All you've provided is pseudocode, so there's only so much we can do.
I think that may be why the question was closed.
Although I can only guess since I didn't vote to close.
 
Well, it's not a typo, I know that. And I'm squidgy about putting company info out there.
 
2:23 PM
Have you looked at the execution plan for the one that inserts into the wrong table?
 
@JohnP Anonymise it then - if we're going to provide a real fix, we likely need real code
 
@George.Palacios Yeah, I will. Give me a few minutes.
@JoshDarnell execution plan? I'm just running the query in the studio manually, it's a one off.
 
@JohnP Before running your query, hit CTRL+M
 
@JohnP You click the little "Include Actual Execution Plan" button on the toolbar.
 
you should get an extra result tab in the results pain at the bottom
 
2:25 PM
Or what @George said =P
Smarty pants keyboard shortcuts.
 
You can then Right Click - Save plan as XML - upload to PasteThePlan.com
@JoshDarnell I totally didn't just go check SSMS because I thought it'd be easier than describing the weird picture :P
 
@JohnP Anyway, that should show you the actual objects being accessed in your query. You could compare it to the one that works (where you include the bit column) and see what's different.
@George.Palacios Haha well done.
 
@George.Palacios I get "Waiting for second key of chord" with CRTL+M
 
@JohnP In SSMS? :O
 
@JohnP From the top menu, "Query" -> "Include Actual Execution Plan." Focus needs to be inside a query editor window.
btw I usually get that message when I've accidentally hit Ctrl + K.
Which is close to M :D
 
2:38 PM
Ok, so what does the execution plan tell me?
 
@JohnP How SQL Server executed the query
 
@JohnP If you follow my instructions above to upload to PasteThePlan.com and then paste us the resulting link we might be able to help
 
upload it to pastetheplan
you'll see which tables were accessed if you look at it
 
@TomV oh yeah, it helps to remember the instructions.
 
@JohnP Be aware the plan includes the actual table and column names.
There is a free tool called Plan Explorer that you can use to anonymize the plan if you want.
 
2:42 PM
@JoshDarnell Yeah, that's ok. I can redact chat later if needed.
 
@JoshDarnell Good shout didn't think of that
 
@JohnP That plan shows one row being read from a table in a database, and then inserted into a table of the same name in a different database. AKA that looks like the "working" plan, is that right?
 
correct.
 
@JohnP Could you do the same thing again with the "bad" query please so we can see the difference?
 
Although now it appears that both failed. :|
 
2:51 PM
@JohnP configdeletions looks like a view?
 
@TomV I don't see anything but the system views folder under the view folder for the configdel table.
@George.Palacios @JoshDarnell - Oddly, when I run the query to do the insert/select, I get a message of (1 row(s) affected) twice. So I'm assuming the system is telling me that it inserted it then immediately deleted/moved it.
 
@JohnP That's a side effect of getting the execution plan IIRC
 
@George.Palacios Correct.
 
@George.Palacios Ah, that makes sense.
 
@TomV Which part looks like a view?
 
2:56 PM
@JoshDarnell ah no nevermind
 
Ok, more info. I took out the insert of the "isNew" field, ran the query and immediately ran a select * from the destination table. It showed up, then disappeared on a subsequent select *.
So the query isn't failing, there is something else working
 
@JoshDarnell I glanced real quick and confused the database name with the table name
 
@JohnP ...is this some kind of queue? Is Service Broker being used (anything under the database level Service Broker folder, especially under "Queues" or "Services")?
@TomV Ah, okay.
 
@JoshDarnell Just system ones.
This is a system that I inherited, and trying to figure out the entire ecosystem has been...frustrating, to say the least.
 
@JohnP Sounds like it!
Maybe there is a SQL Server Agent Job scheduled to run very frequently that's moving these rows around. Do you have access to check that?
 
3:03 PM
@JoshDarnell But, the alternative is to pay the contractor that has been maintaining all of this to date $600k for a year :|
 
That's insane. I'd be glad to do it for $500k / year. Maybe even as low as $450k.
=P
 
@JoshDarnell How's your ASPX? :)
I'm a good programmer, although I'm on the systems side now, just never really dealt with the mechanisms of db maintenance/setup.
I appreciate the help, at least I know I'm not going totally crazy.
 
@JoshDarnell Smartass. I like that in a guy. You're hired. :p
 
Extended events to the rescue!
 
3:18 PM
@JohnP LOL great
@JohnP If you expand the SQL Server Agent node in SSMS, double-click "Job Activity Monitor", then sort by "Last Run", you should see jobs that completed recently. You can also look at "Next Run" to see if it's scheduled to run every, like, 2 seconds or whatever.
@TomV That would be good too.
 
@JoshDarnell there are two scheduled ones, both for late night. A policypurge and a maintenance plan.
 
Gotcha. Well your best bet then is to either use tracing / profiling / extended events to try and track this down yourself, or ask the developer / vendor what process deletes rows from that config table.
 
@JoshDarnell Yeah, the contractor won't communicate anything without $$ attached.
My job description right now is basically "Here. Figure this all out. We'll get you some support".
 
3:40 PM
@JoshDarnell You know, you're the only one to ever earn "Unsung Hero" on SO.
 
@JohnP Really? That can't be right.
It's definitely one of the more uncommon ones though.
 
@JoshDarnell Oh, wait. I do this all the time. Wrong view.
Wrong view seems to be my bane... :p
 
 
4 hours later…
7:27 PM
-1
Q: Normalization on a book

user177427Book{Title, Publisher, Edition, Pages, Cover, Edition, Genre, AuthorName, Price,Year, Subject, Discipline, PublisherLocation

Nice one
 
 
3 hours later…
10:05 PM
0
Q: What is the fastest database system to use?

DaveI have a VPS that I using solely to build a web api on. I've got a huge database with quite a few tables with anything between five hundred thousand and 500 million records in each one. What is the fastest database system to use to index these so that I can search through the records in a few se...

Anyone knows the answer?
 

« first day (3024 days earlier)      last day (1860 days later) »