Jump to content

Ms Sql Server Technology Discussions


9Pardhu

Recommended Posts

Actual ga nakoka chitra vichitramaina req. vachindi ba. Drill through feature ni cube lo implement cheyali stored procedure raasi for reporting. Makoka reporting tool separate ga vundi. Repu office ki vellinappudu clear ga post vestale ba. Hope andariki kottaga anipinchochu and help avvochu.Stored procedures kuda vunnayi

 

 

cubes aaa!! vaammoo naaku adoka vintha prapancham...

 

ok baa.. post tht...

Link to comment
Share on other sites

why can't we use case statement in dynamic sql statement? Evarikaina teliste pls cheppandi :3D_Smiles_38:

Who said we can't use man.. you can use it no worries.. but remember two things .
1. If you using case to convert to varchar, make sure you provide the right syntax with single quotes.
2. You cannot use table variables / local temp tables in dynamic sql. Only global temp tables and physical tables are good.. you can use local but there are limitations so I said global..

I hope I answered it.
Good luck man.
Link to comment
Share on other sites

Delete and truncate lo Rollback vaadachu kadaa... only Delete antaaru entii, I can do truncate rollback asloo in the SSMS.
some one explain... Loveindia

Yes you can use rollback for both truncate and delete starting sql server 2008 r2. Earlier that was not how it was with limitations.

Delete is a memory logged operation. When you delete a row it physically gets deleted but logged by the log database. In case of recovery we will use the log to retain the data.

Truncate simply like Drop statement deal locates the data pages and makes them empty even though dat is logged which you virtually have data somewhere else but this space / table you mentioned will be empty. You can never rollback a DDL statement. Same way, when the log is too big or you are truncating a table of heavy size you cannot rollback. Only smaller chunks of data can be rolled back.

So , you can rollback both delete and truncate , but truncate has limitation on how much you can rollback.

Typed all this from phone, if there are any spelling mistakes please ignore.

Good Luck man.
Link to comment
Share on other sites

you can do any DML statements between

Begin Tran

---
---
---

Rollback

it will rollback watever u do


Truncate is not a DML statement na man...
Link to comment
Share on other sites

Thats the power of ROLLBACK :)

na sagam testing ah syntax lone chestha :D

Why does it have the power man? By the power of grey skull laaga na.. :-)
Link to comment
Share on other sites

oka interview looo.. ee Qn ki answer chesinaa We cant rollbacl Truncate , but delete can be done ani.. Vaduu vadinchaaduu Y cant we do can you explain it aniii.. appudu cehsaa ee test and it was working as he said.

He is right man, unfortunately..
Link to comment
Share on other sites

Yes you can use rollback for both truncate and delete starting sql server 2008 r2. Earlier that was not how it was with limitations.

Delete is a memory logged operation. When you delete a row it physically gets deleted but logged by the log database. In case of recovery we will use the log to retain the data.

Truncate simply like Drop statement deal locates the data pages and makes them empty even though dat is logged which you virtually have data somewhere else but this space / table you mentioned will be empty. You can never rollback a DDL statement. Same way, when the log is too big or you are truncating a table of heavy size you cannot rollback. Only smaller chunks of data can be rolled back.

So , you can rollback both delete and truncate , but truncate has limitation on how much you can rollback.

Typed all this from phone, if there are any spelling mistakes please ignore.

Good Luck man.

good one. Tanks rey

Link to comment
Share on other sites

Love india is my name... sql is my game.. hehe welcome man.. :)

Face to Face interviews kiv ellinappudu... adiginaa SQl ki asn raakapotey best way to face it?

Link to comment
Share on other sites

last weekend i had to help a friend in a sql timebound online interview.. dantlo

 

itemid   salescount   salesdate

1           10               2015-03-20

1           20              2015-02-27

2           5               2015-03-19

............

 

ila data untadhi,  for a given month print the top 5 items and salescount for that month   which are also in the top 5 of the previous month..

 

 

Link to comment
Share on other sites

×
×
  • Create New...