Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Sql statement in multiple rows

Author  Topic 

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2006-10-06 : 00:09:22
Gurus
In sql task in DTS i can write a sql statement in one line,but if i want to take write that sql statement in multiple rows how will i do that?
Like i can write
select * from table where id=2
now how wil i write this
select * from table
where id=2

Please help
regards
Nitin

Kristen
Test

22859 Posts

Posted - 2006-10-06 : 00:33:47
It doesn't make any difference to SQL Server if the statement is on one, or many, lines. Why does it make a difference to you - readability perhaps?

Kristen
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2006-10-06 : 02:37:28
Hi kristen
Thanks for reply.
Kristen i am talking baout writing sql statement in SQL Task in DTS.because if you write in multiple rows it wnt exec .

Regards
Nitin
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-10-06 : 03:33:42
Why not write it on one line then? Sorry, I must be missing something!

Kristen
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2006-10-06 : 04:46:16
Hi Kristen
yes i know it can be written in one line but what if i want it to write it into multiple lines?
Regards
Nitin
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-10-06 : 04:55:29
quote:
Originally posted by nitin1353

Hi Kristen
yes i know it can be written in one line but what if i want it to write it into multiple lines?
Regards
Nitin



Which task in DTS you are talking about? Execute SQL task?

It works with multi-line sql task fine. If you talking about ActiveX script task, you need to use _ (underscore) to connect multiple lines as follows:

sFilename = DTSGlobalVariables("Folder").Value _
& sFilename & ".xls"



Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2006-10-06 : 05:04:07
oops..thanks harsh..i was under the impression that it does not run in multiple lines.
Thanks a ton
Regards
Nitin
Go to Top of Page
   

- Advertisement -