| Author |
Topic |
|
pazzy11
Posting Yak Master
145 Posts |
Posted - 2008-08-12 : 04:11:59
|
| Hi is there a preview mode in SQL server? I think there is a way of previewing a command before executing |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-12 : 04:17:41
|
| Nope. what do you want to preview? |
 |
|
|
pazzy11
Posting Yak Master
145 Posts |
Posted - 2008-08-12 : 04:24:39
|
| I think there is , I remember seeing someone doing it .. for example i want to UPDATE a table , so i need to preview it 1st to see how many rows are updated, what i do now is :[CODE]SELECT * from A where conds...[/CODE]Before executing [CODE]UPDATE A set field1 = 2, field2 = 3....etc WHERE conds[/CODE]to make sure it returns only the rows i wanna update, but there is some preview mode .. like in Oracle.. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-08-12 : 04:54:03
|
| no. there's no such thing._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-08-12 : 04:57:03
|
[code]BEGIN TRANUPDATE A set field1 = 2, field2 = 3....etc WHERE condsROLLBACK[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-08-12 : 04:58:12
|
ok... that'd work. you just have to remember to put it there. _______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-08-12 : 05:01:46
|
and remember to take it out later  KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
pazzy11
Posting Yak Master
145 Posts |
Posted - 2008-08-12 : 05:12:23
|
| thats it .. or I just COMMIT after ROLLBACK ? |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-08-12 : 05:13:47
|
| either commit or rollback._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-12 : 05:20:24
|
quote: Originally posted by pazzy11 thats it .. or I just COMMIT after ROLLBACK ?
once you ROLLBACK you wont have any active transaction to COMMIT. so you need to start transaction again and do commit. |
 |
|
|
|