Skip to content

WITH(NOLOCK) : where & when to use

I have 15 tables which are normalized to contain records and many user may be inserting/updating data in these tables( No two user can update the same record(s) simultaneously, this is restricted by client implementation). these 15 tables are updated 1 by 1 in a stored procedure. WITH(NOLOCK) is used where se…

Average value for Money Datatype

The following is the “pc” table which contains details about pc. user=> SELECT * FROM pc; code | model | speed | ram | hd | cd | price ——+———-+——-+——+——+—–+—–…

SQL create table column AS SELECT FROM OTHER TABLE

My problem is I cannot create proper DDL statement ‘create table’ with column based on 2 columns from other table. The final table should looks like after: CREATE TABLE PRACOWNICY_ZESPOLY AS …

SQL select where column begins with Letters

I have a table tbl1 with row of data: I want to query the the Legal_Doc_No of each ID. The value of each ID is either the TIN or the SSS column. How can I query the TIN and SSS column starting with letters (none) so that only values starting with numbers will be assigned to Legal_Doc_No Answer Most databases

Cannot catch SQL Server alter table error

It is a really simple code, but it cannot catch the error. Or how to catch the error? Thanks. Answer Errors that occur as a result of batch recompilation after deferred name resolution cannot be caught at the same level the error occurs. One work-around is to wrap the DDL in dynamic SQL:

SQL N items per Group in SQL || SQL Sub Query Limit

I want to Select join with cats table with data. Join with cats.id = data.cat_id. with limit 3 data table row for each unique category id cat.id Table: cats id | parent_id | name —+———–+——…