Showing posts with label button. Show all posts
Showing posts with label button. Show all posts

Monday, March 12, 2012

Qns on SQL Express Database

Hi

Is it possible to blank/null out all the data in a specific table in the database, executed in a button click event?

What do you mean? Truncate? Delete? Update?

Probably truncate, as a table with all rows filled with blnaks/nulls make no sense to me.

|||

My situation:

I am writing a program to collect real live data like temperature. At the start of my program the tables in the database are blank. The collected real live data will go into the database tables. The user has the option of deleting all the data in the tables/table at one shot (not manually delete row by row) and start the collection of data afresh.

-

So, I think deleting all the data would be suitable. How to go about doing it? Will the number of rows of data affect the deleting process?

BTW, could help me out in my thread here?

Thanks.

|||

Transactions are logged in SQL Server, so the number of rows will defintely affect the performance. If you don′t want to log the deletions of the data you might use the TRUNCATE Statement for that. This is only possible if you don′t use any (or drop them first) Foreign key constraints. If you don′t want to drop the deletions you will have to delete the data in the relational order (first the child records then the parent records) if you did not specify any Cascading DMl operations.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

Hi, am I looking at the correct syntax for the truncate statement?

http://msdn2.microsoft.com/en-us/library/ms177570.aspx

if yes, how do I use it? Don't understand what its trying to tell me. =(

|||Thats quite easy: TRUNCATE TABLE ownerorschema.TableName
and you should be done.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||May I know what is owner or schema?|||

Hi,

beginning with Sql Server 2005 the objects are stored in a schema. Schema can be owned by multiple owners. This is a switch in design between the "old" SQL Server 2k version. You might have a look in the BOL (Books Online - the help files of SQL Server) to see which actually changed. There is much information about it.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Friday, March 9, 2012

QA green button grayed out

I'm running QA on my local PC and going through an ODBC
connection, I've been able to connect to SQL servers on
our network and execute TSQL statements.
Suddenly, last week, the green button is grayed out. No
matter what server. Everything else looks ok. All
features in EM seem to work. In QA, I can connect to the
correct DB and that seems ok. I can type in a command.
But, no green execute button!
I'm running SQL 2000 on my PC. I'm attaching to SQL 2000
and SQL 7.0 servers. The local OS is XP.
Any ideas?
Thanks,
DonHi
And does Ctrl+E work?
John
"Don" <ddachner@.hotmail.com> wrote in message
news:00ad01c3cfd7$463e4470$a501280a@.phx.gbl...
> I'm running QA on my local PC and going through an ODBC
> connection, I've been able to connect to SQL servers on
> our network and execute TSQL statements.
> Suddenly, last week, the green button is grayed out. No
> matter what server. Everything else looks ok. All
> features in EM seem to work. In QA, I can connect to the
> correct DB and that seems ok. I can type in a command.
> But, no green execute button!
> I'm running SQL 2000 on my PC. I'm attaching to SQL 2000
> and SQL 7.0 servers. The local OS is XP.
> Any ideas?
> Thanks,
> Don
>