Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)

  • RE: IF NOT EXISTS problem

    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...

  • RE: IF NOT EXISTS problem

    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...

  • RE: reset sequence when value of one column changes

    Loner

    If you are using 2005 there is a built in function to do this:

    SELECT ClassScheduleid

    , ClassScheduleTime

    , Courseid

    ...

  • RE: Format Date to UK Format

    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...

  • RE: Need help in xml

    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)')...

Viewing 5 posts - 1 through 5 (of 5 total)