Viewing 15 posts - 796 through 810 (of 1,124 total)
You can do something like this....
SELECTID, MAX( [1] ) AS [1],......., MAX( [31] ) AS [31]
FROM(
SELECTID, shift_id, DAY( [DATE] ) AS [Day]
FROMdbo.Employee
WHERE[DATE] BETWEEN '01-Apr-2007' AND '30-Apr-2007'
) S
PIVOT
(
MAX( shift_id)
FOR [Day] IN(...
December 5, 2007 at 3:08 am
You can't insert rows into table variables in an INSERT..EXEC statement.
Create a temporary table to hold the data instead of table variable.
December 5, 2007 at 2:41 am
Using xp_cmdshell to issue SQLCMD, BCP or OSQL is the right way to go but I guess you wouldn't get the required privileges to do that.
Other alternatives could be....
1. OPENROWSET...
December 5, 2007 at 2:28 am
If the SQL Server user is logged in using Windows Authentication, the user can read only the files accessible to the user account, independent of the security profile of the...
December 5, 2007 at 12:29 am
I'm not sure whether Oracle supports explicit value insertion into a timestamp column, but SQL Server doesn't allow this.
Try inserting a record into the Oracle table with explicit timestamp value.
December 5, 2007 at 12:21 am
Though, such constructions are not supported in SQL 7, 2000, but here is what you can do in 2005
SELECTROW_NUMBER()
OVER
( ORDER BY
( CASE WHEN @sort = 'relevance' THEN hits...
December 5, 2007 at 12:04 am
UPDATE postaladdress SET streetaddresstxt = SUBSTRING( streetaddresstxt, 1, CHARINDEX( '\', streetaddresstxt ) )
FROM postaladdress
WHERECHARINDEX( '\', streetaddresstxt ) > 0
[/code]
December 4, 2007 at 8:04 am
Use PIVOT with either dynamic values or fixed values....
December 4, 2007 at 7:35 am
Haven't you looked at partitioning data in tables and indexes?
December 4, 2007 at 7:29 am
Its there in Chapter 1 > Page 6
For those who didn't get their hands on the book...
Brief Description of Logical Query Processing Phases
1. FROM: A Cartesian product (cross join)...
December 4, 2007 at 5:29 am
GilaMonster (12/4/2007)
Ramesh (12/4/2007)
December 4, 2007 at 5:15 am
No, you can't...but you can SQL Query analyzer only to view the objects and data from tables or views.
December 4, 2007 at 4:52 am
Viewing 15 posts - 796 through 810 (of 1,124 total)