Viewing 15 posts - 151 through 165 (of 315 total)
I looked at your blog entry. However, your dynamic_pivot stored procedure will not work for this example. The OP needs to have one row per fruit type & date. Which...
November 7, 2008 at 5:36 am
Kishore.P (11/7/2008)
use COALESCE function instead of IsNull or NullIf.
Why?
November 7, 2008 at 3:42 am
ggraber (11/6/2008)
I think Ken's solution is the way to...
November 7, 2008 at 12:58 am
Kishore.P (11/6/2008)
try like:select*
fromINFORMATION_SCHEMA.COLUMNS
whereCOLUMN_NAME = 'your column name'
go
It would return View also
November 7, 2008 at 12:42 am
Is this reliable?
SELECT dates FROM
(
SELECT '$.00 AIIMIE 01 2002' as dates union all
SELECT '$1,764...
November 6, 2008 at 6:50 am
If you want to omit time part
select * from tablea where employeeid = '00880187'
and process_date>=dateadd(Day,datediff(day,0,'2008-10-31 00:00:29.000'),0)
and process_date<dateadd(Day,datediff(day,0,'2008-10-31 00:00:29.000'),1)
November 6, 2008 at 6:29 am
or
select object_name(object_id) as table_name from sys.columns
where name='column_name' and objectproperty(object_id,'istable')=1
November 6, 2008 at 6:22 am
pramod.chauhan (11/5/2008)
column process_date datatype is DateTimeselect * from tablea where employeeid = '00880187'
and process_date=convert(datetime,'2008-10-31 00:00:29.000',106)
Why above query gives following error
"Syntax error converting datetime from character string"
select * from...
November 5, 2008 at 7:37 am
It is not possible
Make use of the result
select 'delete from '+table_name from information_schema.tables
where table_type='base table'
November 5, 2008 at 6:30 am
EXEC dynamic_pivot
'select col3,col4 from table1 where col1=''apple''','col2','sum(col4)'
Get procedure from http://sqlblogcasts.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx
November 5, 2008 at 6:23 am
Viewing 15 posts - 151 through 165 (of 315 total)