« first day (3377 days earlier)      last day (1478 days later) » 

1:01 AM
Hello folks. Would you mind if I through a question here?
Does adding or removing FK constrain potentially locks a table?
```
SET CONSTRAINTS "aaaaaaaaa" IMMEDIATE;
ALTER TABLE "table_c" DROP CONSTRAINT "aaaaaaaaa";
ALTER TABLE "table_c" ADD CONSTRAINT "aaaaaaaaa" FOREIGN KEY ("some_id") REFERENCES "table_d" ("id") DEFERRABLE INITIALLY DEFERRED;
```
 
If you through the question when people are awake they might mind, but now -- through away. When you through it again, include the DBMS you have in mind too, as it does matter, regardless of what you think
 
 
5 hours later…
5:58 AM
threw != through (just saying)
Morning
 
 
2 hours later…
8:17 AM
@miso potentially yes. Any statement can require locks.
If you are asking about table locks specifically, since it is DDL, yes it may ask for table locks or system table locks.
If it involves 2 tables (add a FK), even more likely.
If it is a deferred statement even more so.
But as others said above, all these can vary from DBMS to DBMS.
I decided to break my "strike" and answer a question:
2
Q: New Character in Chess game

CreviousI having problem to solve the below question: Given $2020\times 2020$ chessboard, what is the maximum number of warriors you can put on its cells such that no two warriors attack each other. Warrior is a special chess piece which can move either: $3$ steps forward and one step sidew...

 
 
2 hours later…
10:29 AM
@PaulWhite9 Ha, you found the "discussion" I was looking for. For some reason it didn't occur to me that it might have been a meta discussion and my suggestion was actually an answer rather than a comment. Anyway, thanks.
 
 
2 hours later…
12:04 PM
this reminds me of my old 32 bit sql cluster that needs a monthly reboot :)
 
 
2 hours later…
1:58 PM
@Marian nice
It was 248, now every 51 days.
Next they will be restarting every few hours, just like Windows ;)
 
 
1 hour later…
3:17 PM
I think I'm just going to go back to bed. Seemingly everything just doesn't want to work. Yesterday I saved some SSMS results on a client system in CSV. Today I see that SSMS didn't handle embedded commas. So connect back up to client system and save as tab-delimited.
Even though column headings weren't saved (even though I checked off that box in settings, I was like whatever, I can just make the table and import without names. Now I have to wade through silly random errors in the Import Wizard. I don't understand how simple tasks like this are still so painful.
It would literally be faster for me to write the query in the form of SELECT q = 'INSERT INTO table (col1, col2, col3) VALUES (val1, val2, val3);' FROM table; and copy and paste the rows into SSMS and run an insert set.
Error 0xc02020c5: Data Flow Task 1: Data conversion failed while converting column "Column 7" (38) to column "Column 7" (114). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
(SQL Server Import and Export Wizard)
So sad.
 
 
2 hours later…
5:36 PM
@CadeRoux i find the same. i just do it in pyton now - download anaconda, fire up jupyter notebook and slap this in:
import pandas as pd
from sqlalchemy import create_engine
import urllib

conn_str = (
r'Driver=ODBC Driver 13 for SQL Server;'
r'Server=SYKPVSIGNSDB1V;'
r'Database=HCA_STG;'
r'Trusted_Connection=Yes;')

quoted_conn_str = urllib.parse.quote_plus(conn_str)
engine = create_engine('mssql+pyodbc:///?odbc_connect={}'.format(quoted_conn_str))

mydataframe = pd.read_sql("""select *
from information_schema.columns
""", engine)

mydataframe.to_csv("C:\\Users\\MJames21\\Documents\\easier.csv")
 
 
2 hours later…
7:08 PM
@James Pyton Place ;)
 
 
3 hours later…
10:08 PM
oof, i think i remember coronation street. It was nearly as bad as the cricket...
 

« first day (3377 days earlier)      last day (1478 days later) »