I have a table with structure like this:it didn't have an index by datetime, but i know that dt non-decreasing sequence. I need to query data from this table with specific condition by date field like this:
I'm trying to pass a variable value from SQL Server Agent job to SSIS package but the variable contains an apostrophe in it causing the SQL Server Agent job to fail
I have a stored procedure with the following two transactions under Begin and Commit tran.On running that Store Procedure with multiple executions I get dead lock. Here is deadlock Graph:
I have a field which is a varchar(20)When this query is executed, it is fast (Uses index seek):But this one is slow (uses index scan).
I am using MS SQL Server 2014 and have a table with 3 columns and the field data type is Decimal(38,0).
I have input table as shown below -I want ranking of columns(q1, q2, q3 and q4) data for each row. For example, if I consider last row of above input, then q4 column contains 400 value which is higher than other columns, so rank to q4 column will be 1,...
I have table with 3 column and field Data Type is Decimal(38,0). so I want to update each row of my table . Actually the length of number is not same as each other I mean some of them is 5 digit and some of them 7 digit but I...
BOL states:When two operators in an expression have the same operator precedence level, they are evaluated left to right based on their position in the expression.
I'm trying to dynamically create triggers, but ran into a confusing issue around using sp_executesql and passing parameters into the dynamic SQL. The following simple test case works:
Sample of table: I want to get the id’s that only have code ‘1’ and not also code ‘2’ so the result would be