Viewing 15 posts - 16 through 30 (of 74 total)
Hi,
Sure.
You have a Common Table Expression with one base query and two recursive queries, joined together by union all. The CTE is named CTE and have one column named x.
I...
April 27, 2011 at 4:45 am
Hi,
You don't need to reinstall anything!
If you set the database in Single User Mode, you can change the password.
To set the database in Single User Mode, when not knowing the...
April 27, 2011 at 3:58 am
Hi,
you should be able to change source for your report. So instead of using the Stored Procedure as is, you write a query using the Stored Procedure and join the...
April 26, 2011 at 9:34 am
Hi,
create a month-table and (left or right) join with that.
I see that my query is not a perfect example, but since I have nothing else to go on I use...
April 26, 2011 at 5:40 am
Hi Usharani,
it's hard to show a complete solution, since you haven't posted any information about table layout, data etc. But usually you can do something like this:
DECLARE @data...
April 26, 2011 at 4:09 am
Hi Pawan,
There is no way to have SQL Server to return sets with varying number of columns for the different rows.
Normaly you would write a query like:
SELECT T1.Requestid, T1.RequestorName, T2.ApproverName,...
April 20, 2011 at 7:49 am
Hi Robert,
What type does [Max_Value] have?
Is it possibly a float?
Since you are comparing the (non-float) calculated value with [Max_Value] (possibly float), one of the values must change data-type for...
April 19, 2011 at 3:22 am
I guess you're asking which index the Query Optimizer will choose to use when you are querying the table?
That depends on the query. The Optimizer will choose to use the...
April 13, 2011 at 4:56 am
Hi kpao,
I'm not sure how to get (if it is possible at all) numbered tag names (<Range1>, <Range2>, etc). If you are satisfied by getting the numbers as attributes instead...
April 13, 2011 at 3:59 am
Hi,
acording to the plan there is an index missing to solve the query efficient. You could try to add this index:
CREATE INDEX IX_HTK_IK_LUK ON tblHolding
...
August 13, 2010 at 3:28 am
Hi,
you can join a local table with a table. Either you can:
SELECT *
FROM LocalTable Local
INNER JOIN MyLinkedServer.MyDatabase.MySchema.LinkedTable Linked
ON Local.JoinField =...
August 13, 2010 at 12:46 am
Hi,
one way would be to parse the character string as a number by taking the ASCII value of the first character plus the ASCII value of the second character times...
August 12, 2010 at 7:35 am
Hi,
To convert a datetime value to the format YYYY-MM-DD hh:mm:ss you write:
declare @myDate datetime
set @myDate = getdate()
-- Convert date to string with format YYYY-MM-DD hh:mm:ss
select CONVERT(char(19), @myDate, 120)
Since you had...
March 31, 2010 at 7:06 am
Hi,
you need something like this:
CREATE TRIGGER td_EmployeesAudit ON dbo.Employees
FOR INSERT, UPDATE, DELETE
AS
INSERT INTO EmployeesHistory (ChangedTable, ChangedBy, ChangedOn, Deleted, Changes)
SELECT 'Employees', USER, getdate(), 1, <XML_Column_Name_In_Table_Employees>
FROM DELETED
INSERT INTO EmployeesHistory (ChangedTable, ChangedBy, ChangedOn,...
March 17, 2010 at 9:32 am
Hi,
just use GROUP BY in combination with MIN or MAX:
declare @myTable table (ID int, Test varchar(200))
insert into @myTable
select 1, 'Tax Exempt' union all
select 1, 'Tax Composition'
SELECT ID, MAX(Test) -- or...
March 17, 2010 at 9:24 am
Viewing 15 posts - 16 through 30 (of 74 total)