Viewing 15 posts - 1,666 through 1,680 (of 3,543 total)
Agree with Vladan
However the answer to your question is
Set @Qry='DECLARE mycurs CURSOR FOR SELECT ' + @col1 + ',' + @col2 +...
January 9, 2007 at 4:04 am
Providing you do not exceed 4000 chars try
DECLARE @sql nvarchar(4000)
SET @strSQL = ''
SELECT @sql = @sql + 'SELECT s.ShowID,sd.ContactName,sd.ContactEmail,' + [dataSource] + ' FROM show s INNER JOIN...
January 8, 2007 at 7:07 am
SELECT MIN([ID]) AS [ID], Value
FROM
GROUP BY Value
ORDER BY Value DESC
January 8, 2007 at 6:30 am
Notwithstanding the above try
SELECT dbo.fnFindPositionSupervisor((SELECT PositionID FROM Employee WHERE ID = 5))
January 3, 2007 at 6:50 am
Sorting is affected by collation, e.g.
Latin1_General_CI_AI is will give the results you posted
whereas SQL_Latin1_General_CP1_CI_AI will give (I assume) the desired results as in
select * from @tabla order by field collate SQL_Latin1_General_CP1_CI_AI
January 2, 2007 at 7:36 am
![]() | ...because LIKE doesn't work with text data types... |
That is not correct, it will
December 22, 2006 at 5:05 am
![]() | If you care about performance you must fix database design. |
Always
![]() | It can, you just have to set up the table styles, and set each column style's visible property... |
December 18, 2006 at 8:47 am
You could try adding
AND COALESCE(column,column,column) IS NOT NULL
to the end of your query.
Just list the columns you want to check between the brackets.
December 18, 2006 at 7:24 am
Or
SELECT a., a.field1, COALESCE(b.field1, c.field1)
FROM [table1] a
LEFT JOIN [table2] b ON b. = a.
LEFT JOIN [table2] c ON c. LIKE LEFT(a.,2)+'%' AND c. != a.
December 18, 2006 at 7:18 am
Will not work if there are duplicate tef_bas_tar values
You will need to include a GROUP BY
or you could extract the value to a variable
DECLARE @maxdate datetime
SELECT @maxdate = x.tef_bas_tar...
December 13, 2006 at 6:46 am
You must size the varchar for PolicyNumber
varchar is the same as varchar(1) one character/byte
December 12, 2006 at 10:18 am
Change the datatype of PolicyNumber in the CREATE TABLE
CREATE TABLE #temp (Period char(6),PolicyNumber int)
to the datatype of your data
December 12, 2006 at 10:06 am
![]() | What is the "Numbers" table? |
It is a generic table of numbers like
CREATE TABLE dbo.Numbers (Number int PRIMARY KEY...
December 12, 2006 at 9:04 am
Damn I did say untested
Replace
SELECT DISTINCT CONVERT(char(6),DATEADD(year,10,Period),112),PolicyNumber
with
SELECT DISTINCT CONVERT(char(6),DATEADD(year,10,EffectiveDate),112),PolicyNumber
December 12, 2006 at 8:45 am
Viewing 15 posts - 1,666 through 1,680 (of 3,543 total)