Viewing 15 posts - 196 through 210 (of 358 total)
SQL does have the SQL Server Health & History (SQLH2) tool that is opensource now.
October 23, 2008 at 2:19 pm
Try this. If a coulumn is not in the group by, it must use an aggregate function like sum.
Select ref, design, sum(qtt) sumqtt, armazem
FROM SL
GROUP BY ref, design, armazem
October 23, 2008 at 12:48 pm
Here are a couple of different ways.
--You can force the lenght to be 9 by concatenating and then compare.
SELECT MAX(CustNo) as MaxCustNum
FROM Account
WHERE LEFT( RIGHT('000000000' + CustNo,9),...
October 23, 2008 at 12:42 pm
You can always create a batch file and call the batch file from xp_cmdshell.
October 22, 2008 at 12:51 pm
This should work. You have to replace any tick marks with double tick marks. One thing I usually do is use the print statement to help debug string...
October 22, 2008 at 12:15 pm
Try this. You can use the isnumeric function to test the value.
Select Count(*) NumericCount
From Table1
Where isnumeric(ordernumber) = 1
Select Count(*) NonNumericCount
From Table1
Where isnumeric(ordernumber) = 0
October 22, 2008 at 11:50 am
This should get you close. You are going to have to add something in the column that has the query to identify a person like...
And A.CustomerID = B.CustomerID
Right Now...
October 21, 2008 at 2:26 pm
This is what I came up with.
Declare @ssn varchar(20)
--Test1
Set @ssn = '1-111-1--111-1'
Select stuff(stuff(replace(@ssn,'-',''),4,0,'-'), 7,0,'-')
--Test2
Set @ssn = '111111111'
Select stuff(stuff(replace(@ssn,'-',''),4,0,'-'), 7,0,'-')
October 21, 2008 at 11:21 am
As long as it is the only column in the query meaning no other columns will cause the cities to duplicate you should be able to use the Distinct...
October 11, 2008 at 3:00 pm
Here is what I use to create a data dictionary using T-SQL.
October 6, 2008 at 6:57 pm
If you add an Identity column with a name like RowID it will resolve the issue. You can also use this column as the Primary Key.
October 6, 2008 at 6:53 pm
Try this. You have to use a having clause in order to check the count.
Select AccountDescription,
Count(1) AS LineItemCount,
SUM(InvoiceLineItemAmount) AS Line_Item_Sum
From InvoiceLineItems
JOIN...
October 5, 2008 at 2:22 pm
Here is a great example.
September 11, 2008 at 12:42 pm
For a user database it would be something like this.
USE [master]
GO
ALTER DATABASE [DatabaseName] COLLATE SQL_Latin1_General_CP1_CI_AS
GO
September 2, 2008 at 7:52 am
You can change it on the user databases, but in order to change it on the system databases you have to reinstall SQL.
September 2, 2008 at 7:28 am
Viewing 15 posts - 196 through 210 (of 358 total)