Viewing 5 posts - 1 through 5 (of 5 total)
ALTER TABLE is the same as CREATE VIEW in that it must be the first statement in a query batch. With this type of script you would probably be better...
August 13, 2008 at 9:02 am
Unlike DROP VIEW a CREATE VIEW must be the first statement in a query batch so your second check won't work. Just try:
IF EXISTS (SELECT * FROM sys.views WHERE...
August 13, 2008 at 7:58 am
Loner
If you are using 2005 there is a built in function to do this:
SELECT ClassScheduleid
, ClassScheduleTime
, Courseid
...
August 13, 2008 at 7:22 am
David
CAST and CONVERT provide similar functionality (i.e. converts an expression of one data type to another) but CONVERT also provides a datetime formatter mask. CAST is unnecessary for your requirements.
Try:
SELECT...
August 13, 2008 at 6:28 am
Abhijit
The following should do what you want.
SELECT customer.value('(@id)[1]', 'int') AS CustomerID
, customer.value('(name)[1]', 'varchar(50)') AS [Name]
, customer.value('(city)[1]', 'varchar(50)')...
August 13, 2008 at 5:49 am
Viewing 5 posts - 1 through 5 (of 5 total)