Viewing 15 posts - 1,276 through 1,290 (of 1,491 total)
What is the datatype of EmailAddress? varchar(100) or nvarchar(100)?
February 27, 2007 at 8:13 am
You could try something like:
DECLARE @Query varchar(255)
SET @Query = 'SELECT * FROM [' + LEFT(DATENAME(month, GETDATE()), 3) + '$]'
SELECT * FROM OPENQUERY(Charlie_file, @Query)
February 26, 2007 at 9:19 am
Try:
SELECT [name]
FROM master.dbo.sysdatabases
WHERE DATABASEPROPERTYEX([name],'recovery') = 'FULL'
February 26, 2007 at 7:54 am
SELECT coursegroup
,COUNT(*) AS NoOfIPTS
FROM (
SELECT DISTINCT coursegroup, nnp
FROM course
) D
GROUP BY coursegroup
February 26, 2007 at 4:08 am
Concatenating nunerics to varchars will not work. I suspect all your code like:
CAST(CRLMTAMT AS numeric(19,2))
should be like:
STR(CRLMTAMT, 19, 2)
It may be better to use the BCP utility.
February 23, 2007 at 10:47 am
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-- *** Test Data ***
CREATE TABLE dbo.Students
(
StudentID int NOT NULL
CONSTRAINT PK_Students PRIMARY KEY
,StudentName varchar(20) NOT NULL
)
GO
CREATE TABLE dbo.StudentGrades
(
StudentID int NOT NULL
CONSTRAINT FK_StudentGrades_Students REFERENCES dbo.Students(StudentID)
,ExamID...
February 23, 2007 at 10:18 am
DECLARE @Name varchar(20)
SET @Name = 'O''Shea'
SELECT @Name
SET @Name = REPLACE(@Name, '''', ' ')
SELECT @Name
-- may want to replace with 146
SET @Name = 'O''Shea'
SELECT @Name
SET @Name = REPLACE(@Name, '''', CHAR(146))
SELECT @Name
February 23, 2007 at 9:07 am
I do not think the DISTINCT or the IN will help the speed if there are a lot of rows in FTR. The following may work better especially if there...
February 23, 2007 at 8:55 am
Something like the following gets rid of the NOT IN but introduces the overhead of an OUTER JOIN.
After checking the same results are produced, you will need to look at the execution...
February 22, 2007 at 9:24 am
You need to use an aggregate function. SUM will be the most efficient although AVG would also work.
-- *** Test Data ***
DECLARE @t TABLE
(
sampleno int NOT NULL
,workcode decimal(18,2) NOT NULL
,result...
February 20, 2007 at 2:57 am
You will need to post sample data and expected results to get any useful help.
http://www.aspfaq.com/etiquette.asp?id=5006
February 20, 2007 at 2:02 am
Your question and query are extremely confused.
It looks as though you need to extract FillerOrderID from ReasonText in order to count the number of people associated with each one. This...
February 19, 2007 at 10:26 am
If you are not worried about which secondary email to get, then the following will be better:
SELECT T1.ID_Candidate, T1.MailAddress
FROM @t T1
WHERE T1.PrimaryAddress = 1
UNION ALL
SELECT T2.ID_Candidate, MIN(T2.MailAddress)
FROM @t T2
WHERE NOT...
February 19, 2007 at 8:28 am
I am not quite sure what you want but the following may help you:
-- *** Test Data ***
DECLARE @t TABLE
(
ID_MailAddress int NOT NULL PRIMARY KEY
,ID_Candidate int NOT NULL
,MailAddress varchar(255) NOT NULL
,PrimaryAddress...
February 19, 2007 at 7:32 am
Viewing 15 posts - 1,276 through 1,290 (of 1,491 total)