Dont Drop And Delete

Dec 10, 2007

Hi!

I've one table named mytable. I dont want to drop and delete
this table? How can i achieve this ?
Please help me out!

Thanks!

View 9 Replies


ADVERTISEMENT

DELETE FROM Vs. DROP TABLE

Jan 30, 2008

I want to get rid of a huge table. DELETE FROM would take for-freaking-ever, so I was thinking of doing DROP TABLE. Would this be any faster?

If not, would doing a TRUNCATE TABLE and then DROP TABLE be fast? What's the best way to nuke a big table?

Thanks.

View 4 Replies View Related

Drop Or Delete View

Jul 12, 2007

hello,



im creating a sp that creates a view from a query then bcp to csv file.



my problem is that when i start the sp, it complains the sp already exists....yes it does, however, i don't if im going about this the wrong way...but i tried the following to no avail



DROP IF EXISTS v_participantTrades



now, does that syntax not work for views?



View 4 Replies View Related

Delete / Drop Extended Stored Procedure In 2005

Oct 5, 2007

We have a secuiry review and they have recommended dropping several xp_ stored procedures. I have tried the drop procedure with no luck, Error 3701, or right click delete in Man Studio, same error. I have granted the user alter permission to the master database and when I try to delete get Error 4606. I try to grant CONTROL permission of the stored proc to the user and get another 4606 error.

Do I just have to control the permissions of these procedures tightly?

Thanks In Advance
MPM

View 1 Replies View Related

SQL Server 2008 :: How To Delete Or Drop Index To Free Up Space

May 31, 2015

I am new to mssql server. There is a table on one of my databases that occupies a lot of space. And the space usage is as follows: (all values in KB)

reserved: 42329064
data: 16272288
index: 26050032
unused: 6744

This table takes up almost 80% of my database size, and the information is this table just captures the time spent by a user on the website(not very critical data)

I would like to know how to delete the entire index (which is what is occupying most space) to free up disk space. the index is a clustered index.

View 3 Replies View Related

How To Delete/drop All The Tables From SQL Server Database Without Using Enterprise Manager?

Sep 13, 2006

How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?
I tried using DROP Tables, Truncate Database, Delete and many more but it is not working. I want to delete all tables using Query Analyzer, i.e. through SQL Query.Please help me out in this concern.Nishith Shah

View 34 Replies View Related

SQL Server Express 2005 - How To Delete/drop A User Instance

May 23, 2008

Hi,

I have been working around with SQL Server Express 2005 on VISTA. I created a small C++2008 application which interface with SSE 2005. When running my application, it automatically created a user instance which I would like to get rid of. I just forgot from start to set "User Instance = False" in my connectionstring. (oups...)

I'm aware, from readings I did, that a couple of tables as well as log files, etc. are created under directory "utilisateurs...AppDataLocalMicrosoftMicrosoft SQL Server DataSQLEXPRESS". SQLEXPRESS is the instance name chosen during install of SSE2005.

Also using following SQL Statement:

select owning_principal_name, instance_pipe_name, heart_beat
from sys.dm_os_child_instances
I got following result:
owning_principal_name: PC-DE-STEPHANEStéphane
instance_pipe_name: \.pipe6172F4E8-622E-4A sqlquery
heart_beat: dead (at this moment...)

==> How can I make a good cleanup of all this as well as get rid of the user instance itself?


Thanks in advance for any help.

Stéphane

View 7 Replies View Related

Delete Or Drop Table Then Create Table

Mar 14, 2007

which one is smarter, where there is no indexing on the table which is really simple table delete everything or recreate table. I got an argument with one of my coworker. He says it doesnt matter i say do delete. Any opinions.

View 7 Replies View Related

Drop All Indexes In A Table, How To Drop All For User Tables In Database

Oct 9, 2006

Hi,I found this SQL in the news group to drop indexs in a table. I need ascript that will drop all indexes in all user tables of a givendatabase:DECLARE @indexName NVARCHAR(128)DECLARE @dropIndexSql NVARCHAR(4000)DECLARE tableIndexes CURSOR FORSELECT name FROM sysindexesWHERE id = OBJECT_ID(N'F_BI_Registration_Tracking_Summary')AND indid 0AND indid < 255AND INDEXPROPERTY(id, name, 'IsStatistics') = 0OPEN tableIndexesFETCH NEXT FROM tableIndexes INTO @indexNameWHILE @@fetch_status = 0BEGINSET @dropIndexSql = N' DROP INDEXF_BI_Registration_Tracking_Summary.' + @indexNameEXEC sp_executesql @dropIndexSqlFETCH NEXT FROM tableIndexes INTO @indexNameENDCLOSE tableIndexesDEALLOCATE tableIndexesTIARob

View 2 Replies View Related

Dont Getting Error

Oct 2, 2007

update [order]

set Status = 'Open'
from (select [order].OrderId from CRM_Order [order]

inner join crm_orderproduct Oproduct on Oproduct.OrderId=[order].OrderId

group By [order].OrderId

having count(Oproduct.OrderProductId)=0 )



I m trying to update the Order <Table> Field Status, where order products count is zero. The Select statement lonely working fine but in update statement getting error.


Msg 102, Level 15, State 1, Line 6

Incorrect syntax near ')'.

View 4 Replies View Related

Conversation That Dont End.

Oct 16, 2006

Hi There

Message ordering is of utmost importance in our application.

As i found in testing the only way to ensure message ordering is if they are in the same conversation.If you send multiple messages in different conversations there is no garantee which will be processed first.

Therefore i will be creating conversations that last "forever", that is using a single conversation.

I plan on doing a BEGIN DIALOG CONVERSATION when an inititator site is setup and writing the conversation handle guid to a table.

I will them simply SEND ON SONVERSATION using the guid, i will never issue a end conversation from target or initiator.

Is this theory solid, ie: is there a better way or best practice to do this?

I know that conversatons persist with sql server restarts, however what happens if an initiator site db is restored ?

I was thinking of adding logic to first check if a conversation endpoint exists with the specified guid if not , then start another conversation. But is this the best way?

Thanx

View 2 Replies View Related

Dont Display Address If Its Not There!

Jul 28, 2007

hi there, i have a invoice template that when printed has a box for the users address (which there always will be) and a box for their delivery address if they are having the items delivered. However sometimes they dont have things delivered and so the record in the delivery table does not exist. In this case it will throw an error, how can i avoid this. the code im using i have posted below string sql = "SELECT [del_address], [del_post_code], [del_date], [del_time] From tbl_del WHERE order_ID = " + intOrderID;
 
 
//This creates a sql command which executes the sql statement.SqlCommand sqlCmd = new SqlCommand(sql, myConn);
myConn.Open();SqlDataReader dr = sqlCmd.ExecuteReader();
//This reads the first result from the sqlReader
dr.Read();
try
{
 
 
//string strDel_Address = dr["del_address"].ToString();
 if (Convert.ToString(dr["del_charge"].ToString()) != null)
{
//delivery items lblDelAddy.Text = dr["del_address"].ToString();
lblDelPCode.Text = dr["del_post_code"].ToString();
 

View 3 Replies View Related

Dont Know Which Database To Use For The Following Site

Jul 18, 2007

Hi All,Just wondered if i could ask you for some advice and help.I'm looking to write a site, and one of the functions of the site is to remind the user of a certain event at a certain time. I was wondering how i would do this? or if anyone has a working example i could use?Also I dont quite know what database to use...... would MySQL do the function i am after???? If so then no more problem lol If not what database would you recommend i use?ThanksDanny

View 4 Replies View Related

Dont Undertsand This Error

Aug 10, 2006

Hi all, can anyone explain to me why i am getting this error:

Cannot insert the value NULL into column 'WORKPATTERN_END', table 'MockDownload_V52.dbo.EMPLOYEE_WORKPATTERN'; column does not allow nulls. INSERT fails.

The code i am using is:



DELETE EMPLOYEE_WORKPATTERN
INSERT INTO EMPLOYEE_WORKPATTERN(
EMPLOY_REF)
SELECT CAST(EMPLOY_REF AS VARCHAR(10))
FROM EMPLOYEE

View 10 Replies View Related

Find A Table When We Dont Know In Which DB It Is

Nov 14, 2006

Hi Friends,
is it possible to find a table in which database it is?
ex: i have one table name rider. i've created it in one database, but i dont know in which database it is.but i know the server name.

is it possible to find like this?


thank you very much.

Vinod

View 9 Replies View Related

If The Value Is 'null 'dont Update Anything

Nov 7, 2007

Hi.I have a update query:

UPDATE test1
SET testprice= ((unitprice*8)/100) + unitprice

it's good.but I dont want to change the testprice if the unitprice is NULL.what should I do?

View 2 Replies View Related

Why Dont My Question Pic Up 2 Rows?

Jul 5, 2007

Hi


I have a very smal question that im doing with the query builder in visual studio .net 2005.

there i have this sql question



SELECT tblObjekt.ObjektArkivID, tblObjekt.KundID, tblObjekt.KundensArkivNummer, tblObjekt.HuvudTitel, tbl_Spar.SparID
FROM tblObjekt INNER JOIN
tbl_Spar ON tblObjekt.ObjektArkivID = tbl_Spar.ObjektArkivID.



The problem i have is that it only finds 9 of 11 rows in the database. I thought that maybe some field were "null" but every field has some text in it.

The query must work since it finds 9 items, but 2 are missing.
Someone that knows what can be wrong?

Best regards / Mitmit

View 2 Replies View Related

Dont Sum Duplicate Entries

Jan 2, 2008



Hi.
I have a table with Login and Logoff Time of users, but there could be duplicate Logtimes in the dataset, but for
different products. Because of this I cant do a distinct in the dataset. I need the Product and some other details in my Report.

I tried to make two datasets. One for the Select distinct and one for the other.

But the Problem is:
in my report, I need a table, where I make the Sum of the Logintime a day and in another column I calculate with data from the other dataset.(Logtime + data from dataset2). But this doesnt work, so I think, that is it not possible to join 2 dataset in one table.

datetime Login | datetime Logout | Product
11.12.2007 10:15 | 11.12.2007 12:15 | p1
11.12.2007 10:15 | 11.12.2007 12:15 | p2
11.12.2007 12:19 | 11.12.2007 15:15 | p2

Is there another option I can do this?



View 4 Replies View Related

Stored Prosedure Dont Working

Apr 25, 2008

i have 2 server, Database Server and Application Server.
i create a stored prosedure in Database SERVER (sql 2005)
i call this stored prosedure from my application but , my application dont see my stored prosedure..
what is a problem ? this is working my local computer and database.
my stored prosedure : sp_MyStoredProsedure
application :
...........Using myConnection As New SqlConnection(Config.ConnectionString)Dim myCommand As SqlCommand = New SqlCommand("sp_MyStoredProsedure", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
......
i think Ado.net permission problem but i dont know what is problem
thx.

View 6 Replies View Related

Item And Partern From T1 That Dont Exist In T2

May 12, 2006

t1
item
partner


t2
item
partner
fname
store

i like select item and partern from t1 that dont exist in t2

View 1 Replies View Related

Manual SQl Dont Work Correctly

Nov 10, 2007

Hello All Prg's
I need your help,
I use Database SQL server Express with C#
when I entred some data into DB by clciking on the table in server Explorer in Visual Studio 2005 IDE,
and then I make SQL in the code
as:
if (e.KeyCode == Keys.Return)
{
bool res;
int OldPlayerId = 0;
string ConnectionStr = Program.Member_Connect;
string sqlQuery = "select Player_ID from Player where Player_Code = '" + textBox1.Text + "'";
SqlConnection Sql_connection = new SqlConnection(ConnectionStr);
Sql_connection.Open();
SqlCommand command = new SqlCommand(sqlQuery, Sql_connection);
SqlDataReader dataReader = command.ExecuteReader();
if (dataReader.HasRows)
{
if (dataReader.Read())
OldPlayerId = dataReader.GetInt32(0);
else
MessageBox.Show("rtet");
}
else
{
res = false;
}
comboBox2.SelectedValue = textBox1.Text;
command.Dispose();
Sql_connection.Close();
Sql_connection.Dispose();
comboBox1.SelectedValue = OldPlayerId;
}
it work correctly on the old data that I entred them manualy, but when I enter new data from my project, this query don't give correct value, it still work correctly on old data,

I tried to take same data by combobox connected to view that contain same sql ,it work always.
but I need manualy Sql.
Please help me , I am very lating to delever my project...
please help me
thank you very mush

View 13 Replies View Related

I Dont Have Any Backup Of My Database, But I Have The Mdf's And Ldf's Files

Jul 23, 2005

Im trying to recover my database using the mdf and ldf files.I dont have any backup and i have recovered two of the mdf files usinga tool which "discovers" deleted files after hard drive formatting...It sounds cool, isnt it...:? :(Obviously, i get a "suspect" message when the server starts and the logfile says this kind of things:·"Full PathName.MDF is not a primary database file." (This is one ofthe files repaired using the magic tool.·Error: 823, Severity: 24, State: 6·"I/O error (torn page) detected during read at offset0000000000000000 in file 'Full PathiName2.mdf'... Name2.mdf is thesecond file·Device activation error. The physical file name 'Full PathName2.mdf'may be incorrect.When i try to execute the command "DBCC CHECKDB ('Database_Name') WITHPHYSICAL_ONLY" i get the following message :·Could not open FCB for invalid file ID 0 in database 'Logs'.Do you have any ideas? Thank you very much...:D

View 2 Replies View Related

Dont Know About Database Level Locking Scheme

Apr 20, 2007

I m using sql server 2005
i have got one request ,to apply page level locking on database
can nyone how it is done
i can do that for a single script and for session(transaction isolation level)
but dont know about database level locking scheme

thanks in advance

View 2 Replies View Related

Dont Backup If Database Hasnt Changed

Sep 15, 2005

I do weekly full backups of my SQL databases via a scheduled T-SQL job.I noticed that I have some static databases that dont normally change,so I dont want to back it up if it has not changed, but when it does,then I want a backup.Is there something in the master table, as example, that I can checkprior to running the backup that will indicate any changes?An example is the Northwind database. I could exclude it from thebackup, but then I would not back it up if it where to change. Againthis is an example, I would not need to modify Northwind.Thanks in advance for any ideas; they usually give me ideas to problemsyet to come....Rob Camarda

View 3 Replies View Related

Displaying The Values That Dont Match And Replacing By NULL

Feb 6, 2003

Hi,

Im having a couple of problems with SQL.

I have this query...

SELECT Band.Name, Member.Name
FROM Member
JOIN MemberOf ON Member.Mid = MemberOf.Mid
JOIN Band On MemberOf.Bid = Band.Bid
WHERE MemberOf.Instrument = 'keyboards';

which basically shows me the name of the bands who had keyboard players. I would like it to also display the names of the band who didnt have keyboard players, replacing the keyboard players name with "NULL".

so... my questions are :)

how do u get it to display the records that do not match the condition, and how do u get it to replace the keyboard players name with "NULL" when they do not match the condition.

PS. The three tables are

Band. Which has Bid as a primary key.
Member. Which has Mid as a primary key.
MemberOf. Which links these through its two foreign keys Mid and Bid.

Thanks for your help! (assuming someone does)

View 2 Replies View Related

Grant Execute To Role But Permissions Dont Show Up

Apr 5, 2008

I have a stored procedure in which at the bottom of the code, im granting execute permissions to a role I have defined. However, when I view the permissions on the procedure, the role isnt there, what could I be missing ? The procedures were all created under the default or dbo schema. I could manually give the permissions to the role, but id rather have it scripted.

help ?

View 5 Replies View Related

Logins Dont Work After Restoring On Backup Server

Jul 20, 2005

I am doing a complete backup on a sql 7 db and then doing a completerestore (with overwrite existing db) on a sql 2000 server. This is nowour hot standby server. I have the process automated and it worksgreat. The only problem I have now is the logins dont work.I have tried running EXEC sp_change_users_login 'Report', and thelogins appear.However, when I run EXEC sp_helplogins 'joe', the results are empty.So, I am guessing all I need is a sp that will re-associate my loginswith the correct db and grant the appropriate permissions.If anyone has any ideas that would be great.I have also considered doing a log ship instead of a full backup andrestore. Does anyone have any suggections or good examples of how tomake that happen?Thanx

View 1 Replies View Related

Collation Inconsistancies - MASTER And TEMPDB Dont Match

May 7, 2008

hi folks

I€™ve had a SQL 2000 server restored (using Veritas 9.1) to another server also running SQL 2000. I now have a collation problem.

When trying to add users to a database, I receive a "Error 446: Cannot resolve collation conflict for equal to operation" message.

I noted that tempdb and user tables collation don€™t match - so I was going to change the user tables. However, the master collation doesnt match tempdb, model or msdb.

Server is set to SQL_Latin1_General_CP1_CI_AS
Master - SQL_Latin1_General_CP1_CI_AS
tempdb, model, msdb - Latin1_General_CI_AS

I was under the impression that when tempdb was recreated it inherited the master database's collation? This doesn€™t seem to be happening.

any ideas?

much appreciated

N.

View 7 Replies View Related

SSIS Excel Into Table Or Text File (dont Ask)

Jan 30, 2008

I have an excel file source, that has a column that is a date column, although the group puts in more that just a date sometimes: example (11/1/2007) or (Sold), the problem is I cant get SSIS to ever see anything but the date, for the cells that have Sold shows me null, or blank when doing a view. Any thoughts??? I am starting to hate excel more and more.

View 4 Replies View Related

I Dont See Server Management Studio On The XP With The Standard Version

Jul 29, 2007






I have installed SQL 2005 Standard Edition on my Window XP many times and I dont see Server Management Studio.

Did I do something wrong?


Thanks.

View 8 Replies View Related

To Configure Database Mirroring-Dont Get Mirror Option In TASK

Jul 7, 2006

To configure database mirroring






After connecting to the principal server instance, in Object Explorer, click the server name to expand the server tree.


Expand Databases, and select the database to be mirrored.


Right-click the database, select Tasks, and then click Mirror. This opens the Mirroring page of the Database Properties dialog box.


To begin configuring mirroring, click the Configure Security button to launch the Configure Database Mirroring Security Wizard.



but i do not see any "Mirror" Option in the "Tasks" menu.

Why ?

View 1 Replies View Related

I Dont Find Sql Management Express In The Program Folders Of Sql Server2005

Jan 8, 2008



I dont find sql management express in the program folder of sql server 2005. i find configuration manager but dont find the sql server management express. If the program is deleted also then the shortcut is deleted but not the whole program.
i can find the files in the respective folders of program files -> microsoft sql server 2005. but dont know which files start
the sql managment express

View 1 Replies View Related

Create Snapshot -&&> FAILED! You Dont Have Sufficient Permission To Run This Command

Sep 12, 2007

Hi all,

i'm trying to create a publication and its snapshot in the default snapshot folder of MS SQL Server 2005.
It's all done by RMO.

Following Scenario:
1. PublicationDB was created by User1(sysadmin) ... successful
2. Enable PublicationDB for Publishing ... successful

2. Creating the publication: executed as User2(db_owner)
2.1 publication.Create(); ... successful

2.2 publication.CreateSnapshotAgent(); ... successful
2.3 Add Articles to publication ... successful
2.4 Generate Snapshot with

agent = new SnapshotGenerationAgent(); and setting all parameters for it, then execute by

agent.GenerateSnapshot();

And at this point,i got an error message, because the snapshot agent cant be executed ...

2007-09-12 12:05:46.58 User-specified agent parameter values:2007-09-12 12:05:46.58 --------------------------------------2007-09-12 12:05:46.60 -Publisher EDOM04SQLstandard2007-09-12 12:05:46.60 -PublisherDB TMS4X_PublicationDB2007-09-12 12:05:46.60 -Publication TMS4X_PublicationTest2007-09-12 12:05:46.60 -ReplicationType 22007-09-12 12:05:46.60 -Distributor EDOM04SQLstandard2007-09-12 12:05:46.60 -DistributorSecurityMode 12007-09-12 12:05:46.60 -PublisherSecurityMode 12007-09-12 12:05:46.60 --------------------------------------2007-09-12 12:05:46.63 Connecting to Distributor 'EDOM04SQLstandard'2007-09-12 12:05:46.96 The replication agent had encountered an exception.2007-09-12 12:05:46.96 Source: Replication2007-09-12 12:05:46.96 Exception Type: Microsoft.SqlServer.Replication.ReplicationAgentSqlException2007-09-12 12:05:46.96 Exception Message: You do not have sufficient permission to run this command. Contact your system administrator.2007-09-12 12:05:46.96 Message Code: 142602007-09-12 12:05:46.96

Configurations:
-All Users have rights for read and write on the snapshotfolder including the Agent
-All users are defined in the same windows domain
-the snapshotagent account has sysadmin rights on the server and is assigned to the predefined MS SQL User Role

This scenario is workin completely fine when i exceute everything as a "sysadmin"!
But when executing it all as "db_owner" of the database, its not workin!!!

Does anybody has any resolutions for this problem?
I appreciate any support.
MariJo

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved