First  |  Prev |  Next  |  Last
Pages: 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
nth line where column not null
Hello, I have the following rowset: i dt1 dt2 ----------- ----------------------- ----------------------- 1 2010-03-30 00:00:00.000 NULL 2 2010-03-31 00:00:00.000 NULL 3 2010-04-01 00:00:00.000 NULL 4 2010-04-02 00:00:00.000 2010-04-02 0... 9 Apr 2010 13:25
Audit trigger
Hello, I'm sure there's a simple solution here, but I can't seem to see the forest for the trees..... I have a field at the end of my table called DATE_MODIFIED - basically I would like to update this fied with the current dat and time when a record gets inserted or updated - the trigger works good, but it upd... 9 Apr 2010 21:13
CTE with IF statement
I have common table expression and inside I have complicated SELECT statement with many JOINS AND WHERE clauses. I don't want to execute this SELECT INSIDE CTE twice, once for count and once for actual SELECT, so I wonder if it is possible to write something similar like this: ;WITH CTE(SELECT * FROM table) IF ... 19 Apr 2010 21:56
LEFT JOIN and unnecessary reads
If table a LEFT JOINs to table b but the SQL only reads columns from a, doesn't the optimizer know that it doesn't need to read from b at all? SELECT a.* FROM a LEFT JOIN b ON a.col1 = b.col1 WHERE ... ... 7 Apr 2010 19:11
Dynamic SQL
I have a procedure that does the same set of 3 Update Queries 4 times. The only difference in the 3 queries is whether the status is 1, 2 or 3. So I can combine each of the 3 into 1 query (Where Status Between 1 and 3) and end up with 4 queries. These 4 are essentially the same except one of the JOINS is a d... 8 Apr 2010 21:57
INSERT statement conflicted with COLUMN CHECK constraint.
Dan, Thank you, the suggested method worked. I was able to see & update the constraints. regards, From http://www.developmentnow.com/g/113_2005_7_0_0_570828/INSERT-statement-conflicted-with-COLUMN-CHECK-constraint-.htm Posted via DevelopmentNow.com Groups http://www.developmentnow.com/g/ ... 7 Apr 2010 13:32
Data error. Cyclic redundancy check
I am getting the following error when trying to access a table in a database: An error occurred while executing batch. Error message is: Data error (cyclic redundancy check). Any ideas on how to resolve this issue? -- Sheldon ... 7 Apr 2010 11:15
Need help with this query
Hi, Here is the DDL : CREATE TABLE traffic ( unique_id int NOT NULL PRIMARY KEY , train_number int NOT NULL , carrier_id int NOT NULL ); -- some test data INSERT INTO traffic (unique_id, train_number, carrier_id) VALUES (1, 11, 1); INSERT INTO traffic (unique_id, train_number, carrier_id) VALUES (2, ... 8 Apr 2010 01:50
Depending on input parameters, modify select statement in SP
Following Stored Procedure has three input parameters i.e @type, @year and @level_id ################## CREATE PROCEDURE [sp_TEST] @type char(3),@year int, @level_id int = 0 AS select * from ABC where type = @type and year = @year ################# I want to write the select statement where if @level_id <> ... 11 Apr 2010 03:41
inner join on itself
Just trying to see why someone would inner join on itself vs just do one inner join. It looks like this is being done to accommodate paging but not sure if that is the complete reason. In the original one, there was also an ORDER BY Clause that went with the TOP 10000 clause. But they took that out. If yo... 6 Apr 2010 22:05
First  |  Prev |  Next  |  Last
Pages: 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68