Tag Info

New answers tagged

2

Besides using explicit transactions, I typically write a SELECT statement first to see how many rows would be affected, and then copy the WHERE clause to my UPDATE statement. SELECT * FROM [SomeTable] WHERE [SomeDateColumn] > '3/1/2014' From this I see 100 rows would be updated. So I either copy the WHERE clause, or convert the SELECT into an UPDATE ...


3

Study the following: BEGIN TRANSACTION, ROLLBACK TRANSACTION, COMMIT TRANSACTION Also read Paul Randall's A SQL Server DBA myth a day: (26/30) nested transactions are real Also read XACT_ABORT @@ROWCOUNT IF ...ELSE GOTO @@TRANCOUNT More advanced topics, optional until they're not: SET TRANSACTION ISOLATION LEVEL Gail Shaw's intro to deadlocks Then ...


1

I think this may be answered here: http://stackoverflow.com/questions/19677883/how-to-shrink-azure-sql-server-db-18mb-of-data-charged-for-5gb-of-server-space To summarize You need to reindex, then wait after you have done the deletes. I don't think azure counts the size of logs in the space used. Also see here to check what is using the space (I have ...


2

Categories and Buckets. create table categories ( category_id int primary key ); create table buckets ( bucket_id int primary key ); Depending on how to interpret "an item may belong to at most 1 bucket" you need to do some different things with Items. An item has to belong to one bucket. create table items ( item_id int primary key, ...



Top 50 recent answers are included