Wednesday, March 21, 2012
multiple view create
How can I create multiple views in a single SQL script ?
(I get an error: 'CREATE VIEW' must be the first statement in a query
batch.)
thanksYou can use the batch terminator, GO, to seperate the batches:
CREATE VIEW xyz
AS
SELECT
..
GO
CREATE VIEW abc
AS
SELECT
..
GO
... etc
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"romy" <romy1000@.hotpop.com> wrote in message
news:e6ml7BM5FHA.636@.TK2MSFTNGP10.phx.gbl...
> Hi
> How can I create multiple views in a single SQL script ?
> (I get an error: 'CREATE VIEW' must be the first statement in a query
> batch.)
>
> thanks
>sql
Multiple variables on a Script transformation
I have a script transformation that I want to pass two variables to through ReadOnlyVariables but for some reason the editor will only accept one. If I try to add a second I get the message "The variable cannot be found".
The help text against ReadOnlyVariables says to enter a comma separated list which I thought would be simply "variable1, variable2" but this doesn't seem to work. I can enter each variable name individually so it is not that I have the names wrong.
Can anyone advise?
Thanks,
AndrewYep, don't put a space between the variables.
i.e. "variable1,variable2"|||Thanks, it hadn't occurred to me that the editor would be quite so fussy. Is this documented anywhere?|||BOL states "Type a comma-separated list of read-only variables that are available to the script." I've submitted feedback saying that perhaps it should mention there mustn't be any spaces in there.
-Jamie|||I'll make the BOL text clearer today. I'm surprised that I didn't hit the same problem when testing. That is rather fussy on the editor's part.
-Doug