Tuesday, March 27, 2012
Delete Data
keep the table's definition? DROP TABLE deletes everything and I need to
maintain the table's definition.
Thanks a lot.
TSYou can use "truncate table table_name" or "delete table_name". The first on
e
is not a logged operation.
AMB
"TS" wrote:
> Simple question, what is that I should use to delete data from one table a
nd
> keep the table's definition? DROP TABLE deletes everything and I need to
> maintain the table's definition.
> Thanks a lot.
> --
> TS|||In order to do a truncate table, there must be no foreign keys...
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"TS" <TS@.discussions.microsoft.com> wrote in message
news:A95E62C6-A8C1-4590-B71C-DE8726761C9F@.microsoft.com...
> Simple question, what is that I should use to delete data from one table
> and
> keep the table's definition? DROP TABLE deletes everything and I need to
> maintain the table's definition.
> Thanks a lot.
> --
> TS|||If there are foreign keys pointing to the table, you need to clean those up
first.
If there are foreign keys in the table pointing elsewhere, you need to say
DELETE tablename
Otherwise you can use
TRUNCATE TABLE tablename
(Which also resets the IDENTITY seed if such a column exists.)
"TS" <TS@.discussions.microsoft.com> wrote in message
news:A95E62C6-A8C1-4590-B71C-DE8726761C9F@.microsoft.com...
> Simple question, what is that I should use to delete data from one table
> and
> keep the table's definition? DROP TABLE deletes everything and I need to
> maintain the table's definition.
> Thanks a lot.
> --
> TSsql
Friday, March 9, 2012
Definition of specific "Security Roles"
Under SSMS I see the "securityadmin" Server role. Where in SSMS can I find the actual list of permsisions granted to this role? (not just a generic description of what this role can do.)
TIA,
Barkingdog
In summary they can add members to the securityadmin role, Grant or deny CREATE DATABASE and read the error logs. Additionally they are allowed to use the tasks:
sp_addlinkedsrvlogin,sp_addlogin,sp_defaultdb,sp_defaultlanguage,sp_denylogin,sp_droplinkedsrvlogin,sp_droplogin,sp_grantlogin,sp_helplogins,sp_remoteoption and sp_revokelogin.
The above mentioned list is from an old SQL 2000 scripts of mine. Additionally the description of the BOL and the appropiate command which are new for the above mentioned procedures apply.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
definition of physical vs logical database model
Entities & Business Rules in a database design. The process of developing a
logical model usually engages the process of "normalising" the model, to
identify & remove redundancies, identification key dependance entity
atomicity.
You might consider the Logical Model the "design" of the database, without a
physical implementation - eg you define the table names, column names,
primary & foreign keys etc but without necessarily creating Data Definition
Language statemets (eg CREATE TABLE.. etc) for any specific database
platform.
The Physical Model is where you take the Logical Model & design the actual
DDL for a specific platform (eg SQL Server). This means defining the
physical implementation of the logical design - such as choosing precise
data types, developing stored procedure implementations (eg to implement
Logical Model business rules), writing CREATE TABLE statements etc.
It is not uncommon for the tables in a Physical Model to differ from the
Entities in a Logical Model. Often this is due to scalability / performance
considerations. Eg - you might have an Entity in the Logical Model that has
many attributes, but instead of implementing this as one Table in the
Physical Model with many columns, you might create two tables - one with the
few columns that are expected to be used most often so that clustered
indexes are narrower, with the aim of achieving better overall performance.
You might also place a view over the top of those two tables so that the
Physical Model can "appear" to the application as identical to the Logical
Model, even though the Entity has been vertically partitioned into two
tables.
HTH
Regards,
Greg Linwood
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:eNg$rD$fDHA.3324@.TK2MSFTNGP11.phx.gbl...
> What is the difference between physical and logical database design model
?
>|||I might add that, in addition to what Greg mentioned, the following are
typical physical design issues (an incomplete and random list):
* index designs
* choice of database/log files and their physical placement
* choice of filegroups and the placement of tables
* setting the database options
* performance tuning (e.g. denormalizing a table)
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Greg Linwood" <g_linwood@.hotmail.com> wrote in message
news:%23HVYAp$fDHA.3528@.tk2msftngp13.phx.gbl...
> Logical Models define Entities, their Attributes, Relationships between
> Entities & Business Rules in a database design. The process of developing
a
> logical model usually engages the process of "normalising" the model, to
> identify & remove redundancies, identification key dependance entity
> atomicity.
> You might consider the Logical Model the "design" of the database, without
a
> physical implementation - eg you define the table names, column names,
> primary & foreign keys etc but without necessarily creating Data
Definition
> Language statemets (eg CREATE TABLE.. etc) for any specific database
> platform.
> The Physical Model is where you take the Logical Model & design the actual
> DDL for a specific platform (eg SQL Server). This means defining the
> physical implementation of the logical design - such as choosing precise
> data types, developing stored procedure implementations (eg to implement
> Logical Model business rules), writing CREATE TABLE statements etc.
> It is not uncommon for the tables in a Physical Model to differ from the
> Entities in a Logical Model. Often this is due to scalability /
performance
> considerations. Eg - you might have an Entity in the Logical Model that
has
> many attributes, but instead of implementing this as one Table in the
> Physical Model with many columns, you might create two tables - one with
the
> few columns that are expected to be used most often so that clustered
> indexes are narrower, with the aim of achieving better overall
performance.
> You might also place a view over the top of those two tables so that the
> Physical Model can "appear" to the application as identical to the Logical
> Model, even though the Entity has been vertically partitioned into two
> tables.
> HTH
> Regards,
> Greg Linwood
> SQL Server MVP
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:eNg$rD$fDHA.3324@.TK2MSFTNGP11.phx.gbl...
> > What is the difference between physical and logical database design
model
> ?
> >
> >
>|||Thanks a lot.. So informational...So happy...
"Linchi Shea" <linchi_shea@.NOSPAMml.com> wrote in message
news:Ol3aB4$fDHA.2072@.TK2MSFTNGP10.phx.gbl...
> I might add that, in addition to what Greg mentioned, the following are
> typical physical design issues (an incomplete and random list):
> * index designs
> * choice of database/log files and their physical placement
> * choice of filegroups and the placement of tables
> * setting the database options
> * performance tuning (e.g. denormalizing a table)
> --
> Linchi Shea
> linchi_shea@.NOSPAMml.com
>
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:%23HVYAp$fDHA.3528@.tk2msftngp13.phx.gbl...
> > Logical Models define Entities, their Attributes, Relationships between
> > Entities & Business Rules in a database design. The process of
developing
> a
> > logical model usually engages the process of "normalising" the model, to
> > identify & remove redundancies, identification key dependance entity
> > atomicity.
> >
> > You might consider the Logical Model the "design" of the database,
without
> a
> > physical implementation - eg you define the table names, column names,
> > primary & foreign keys etc but without necessarily creating Data
> Definition
> > Language statemets (eg CREATE TABLE.. etc) for any specific database
> > platform.
> >
> > The Physical Model is where you take the Logical Model & design the
actual
> > DDL for a specific platform (eg SQL Server). This means defining the
> > physical implementation of the logical design - such as choosing precise
> > data types, developing stored procedure implementations (eg to implement
> > Logical Model business rules), writing CREATE TABLE statements etc.
> >
> > It is not uncommon for the tables in a Physical Model to differ from the
> > Entities in a Logical Model. Often this is due to scalability /
> performance
> > considerations. Eg - you might have an Entity in the Logical Model that
> has
> > many attributes, but instead of implementing this as one Table in the
> > Physical Model with many columns, you might create two tables - one with
> the
> > few columns that are expected to be used most often so that clustered
> > indexes are narrower, with the aim of achieving better overall
> performance.
> > You might also place a view over the top of those two tables so that the
> > Physical Model can "appear" to the application as identical to the
Logical
> > Model, even though the Entity has been vertically partitioned into two
> > tables.
> >
> > HTH
> >
> > Regards,
> > Greg Linwood
> > SQL Server MVP
> >
> > "Hassan" <fatima_ja@.hotmail.com> wrote in message
> > news:eNg$rD$fDHA.3324@.TK2MSFTNGP11.phx.gbl...
> > > What is the difference between physical and logical database design
> model
> > ?
> > >
> > >
> >
> >
>
Definition of 'Persistent Data'
What is the definition of 'Persistent Data' as related to the definition of a RDBMS?
thx,
Kat
Persistent Data is data that stays around after the application has terminated. In the case of an RDBMS, it would refer to data which had been committed to tables. It would not refer to items stored in temporary tables or units of work that the server accumulated while processing a query -- work tables. It would also not refer to variables defined and used during processing.
|||In a simple form it means saved to disk (not only used for data, any file could be persisted-saved).|||hi kat,
i encounter the term "persistent data" in the .net terminology
which refers to data in the cache of an asp.net application
its in one of the three caching method of .net which are page, fragment and data caching.
you can also persist the data from the dataset to a XML file
oh well, terms are used in different ways and honestly
i dont have any idea about the subject matter.
well, just wanna say hi!
anyway, here are some usefull link
http://en.wikipedia.org/wiki/Persistent_data_structure
http://www.techweb.com/encyclopedia/defineterm.jhtml?term=persistent+data
joey
||| Hello,
Data is said to be persistent in RDBMS when the transaction that has written it is commited. One of cornerstones of RDBMS is the ACID contract between the system and the components that issue transactions. ACID stands for
Atomicity, Consistency, Isolation, Durability. The Durability property sais that once a transaction has been commited, its modifications are guaranteed to survive any failure of system, once the permanent storage is not damaged. Another term for Duarbility is Persistence(they just use Durability because ACID is the cutest abbreviature one can think of :) )
So, basically, persistent data is the data that has been issued by a transaction which has already been commited. It is guaranteed to survive any system failures.
Regards,
Andranik
Definition of Object Has Changed Since it was last compiles
All I'm having a weird problem.. I have 2 stored procedures that run 98% of the time without any issue but inconsistenly through the following error.
'The definition of object 'proc name goes here' has changed since it was compiled'
We have adding 'with recompile' to the proc but we still get this error - but not consistently. The stored proc is not changing nor is the table structure of any of the objects that are being used in the sp. Any idea to trace down the why this is happening or what objecte it thinks is changing? Let me know your thoughts.
Ken
We've started experiencing this, except:- It's occurring 100% of the time on SQL 2K5, for a particular data set, but not for another data set on the same schema.
- It never occurred in SQL 2K.
- It only occurs on SQL 2K5 (w/ DB in 2K compatibility mode)
My first reaction, for our case, is that it's a broken 2K5/2K compatibility issue. We're doing something pretty shady - disabling a trigger on table B from within a trigger firing on table A. IOW:
Trigger A, Table A:
- Disable trigger B on table B
- UPDATE table B
- Re-enable trigger B
So I'm guessing SQL 2K5 is finally calling us out on this. But I'd still prefer a quick fix to rewriting the triggers. Have you had any luck with your issue?
Definition of BCV
ThanksYou probably mean BCP, the Bulk Copy Program provided as a SQL Server utility with the SQL client tools.
You might actually mean BCV if you are using EMC storage, in that context it means Business Continuation Volume.
-PatP|||Thanks Pat for the response ... I did mean Business Continuation Volume because our client is using EMC storage. Can you explain to me what this actually is and how it is benefical as a tool to use?|||http://www.emc.com/products/product_pdfs/pdg/timefinder_pdg.pdf?emccomjsessionid=23057310987216 72334|||Actually, EMC does a better job explaining (http://www.emc.com/pdf/business_centers/windows/Microsoft_SQL.pdf) how to use BCVs with SQL Server than I can. We've never gotten them to work to my satisfaction.
The basic idea is that a BCV will allow you to mirror data in real time. In SQL 7.0 hooks were added, which were refined in SQL-2000 to allow an application to "freeze" a disk volume. This freeze would effectively flush the disk buffers to disk as of a specific point in time, almost as though the database had been stopped (to detach it). The theory is that you could mirror a BCV volume to a production volume, freeze the SQL files, break the mirror, then "thaw" the SQL files again, all without the end user knowing or caring that anything had ever happened.
Anywho, see the EMC document for a better description. While I love EMC in general, we (my firm working with EMC) were never able to make BCVs work in production.
-PatP
Definition a color on .RDL with .CSS :
Hello :
I want to use a style sheet, in a .RDL file, that is instead of having that:
<BackgroundColor>#336cad</BackgroundColor>
I want to put:
<BackgroundColor> class = ? my color </BackgroundColor>,
And if it is possible, how I make for connected the .RDL and the .CSS.
Thank's.
Not possible. I am curious though how useful this could be. Recall that a report can be exported to a format other than HTML.
Defining an event inside of an assembly => UNSAFE (no workarounds?)
public interface A {
event EventHandler Foo;
}
... can never be loaded under SAFE or EXTERNAL_ACCESS ?
It appears that the compiler-generated add_xxx and remove_xxx have the MethodImpl(MethodImplOptions.Synchronized) attribute defined by default, and "Explicit synchronization is not allowed". The same limitation also applies to classes by default, although technically one is able to define the implementation directly (clearly not ideal).
That's exactly correct. There is some possibility in the future that the CLR could change the way they implement EventHandler synchronization to allow it in non-unsafe assemblies, but for now that is the restricition.
Steven