I have trouble dropping a job that was a maintence plan.
I get the following error. Is there a way around this?
TITLE: Microsoft SQL Server Management Studio
------------------------------
Drop failed for Job 'Maintenne Plan'. (Microsoft.SqlServer.Smo)
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_job_id". The conflict occurred in database "msdb", table "dbo.sysmaintplan_subplans", column 'job_id'.
The statement has been terminated. (Microsoft SQL Server, Error: 547)
I get a new payroll data file every two weeks. I have a DTS package that drops the table, creates a new table and then adds an index. The SQL task that checks for the exsistence of an index and then drops and creates a new one is failing. Here is the the SQL for the Execute SQL task
Is there a way we can prevent a object owner from dropping his tables. Example:
There is a user called 'tom' who is given create table permissions, 'tom' creates the table completes his dev and then the table is moved into production where 'tom' is still the owner. However, in production, 'tom' does not have the create table privs. Because 'tom' is the owner of the table, he is still able to drop the table in production. This is what I am trying to avoid. I would like to retain 'tom' as the owner and want to take away his create/drop privs.
Does anyone have any generic scripts that Drop all the statistics that SQL auto generates?? I have hundreds of '_WA_....' indicies that are auto created by SS7 and I just want to get rid of ALL of them. Thanks!
I need to drop a database but cannot because there are 2 open connections that I cannot drop via EM. Is there a way to do this without starting and stopping??
After I drop the database, I backed up the master database, I recreate the database with new name. When I tried to do the import on the command level, It gives me the error: Attempt to locate entry in the sysdatabases for database 'db1' by name, failed -- no entry found in that name.
Hi I am using SQL server 7 database and ASP as front end. I run an application where a text file is loaded into database. After this is done procedures are run to create a set of tables that have snapshots of the data in the text file.. each time i load a new text file i want to create the snapshots.. i hve written a stored procedure to create tables and insert values into the tables.. however how do i delete the tables i created the previous time.. the number of snapshots and their names will depend on the size of the text file.. how do i refer to all the snapshots created and drop them all before creating new ones? plese guide regds
I have a database that is giving me a bad Index error. When I go to drop the necessary Index it is telling me that it either does not exist or cannot be dropped. However when I try to build that index, it tells me one already exists.
Is there any way to drop all of the indexes or at the very least see what the indexes are? This particular database is using 2005 Express.
How to remove the constraints on a table in sql server 2000? I need to drop the column, so i need to drop the constraint before that.
Alter Table Table_Name NO CHECK constraints ALL.
Once I execute the above one, it says, "Successfully Executed" but when I try to drop it doesnt allow me and gives me the following error:
Server: Msg 5074, Level 16, State 1, Line 1 The object 'DF_Users_Created_by' is dependent on column 'CREATED_BY'. Server: Msg 4922, Level 16, State 1, Line 1 ALTER TABLE DROP COLUMN CREATED_BY failed because one or more objects access this column.
I think the answer to this question will be something like 'you'll have to re-initialize the subscribers', but I need to ask anyway...
I created a publication where my foreign key constraint we NOT created with NOT FOR REPLICATION. My publication is configured to replicate DDL changes. Is there any way I can drop and re-create the constraint in the publisher and get replication to push the change to the subscribers?
I am trying to run a dymanic DROP DATABASE <dbname> command in a stored procedure called from ASP.NET. I typically connect from the .net using a SQL builtin account. I am getting this error:
System.Data.SqlClient.SqlException: Cannot drop the database 'db_testco', because it does not exist or you do not have permission.
The database is there for sure asI can browse it via the Studio manager. What permission do I need to set for my .net login to allow it to drop ? I tried adding the Delete permission to the database and still no go...
I have a table with multiple column and has millions of rows in it(say about 50 millions ) and its in production. What is the best way of dropping the a column from the table without impacting the systems performance. Remeber this table will be used some application to get some data out of it.
I think I am doing something wrong. I am trying to make the trigger fire when I want to drop the same trigger. For example I have the following trigger defined:
USE AdventureWorks2000
GO
CREATE TRIGGER Incheckstock
ON DATABASE
FOR DROP_TRIGGER
AS
PRINT 'You must disable Trigger "Incheckstock" to drop Trigger!'
ROLLBACK
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ENABLE TRIGGER Incheckstock ON DATABASE
DROP TRIGGER Incheckstock
ON DATABASE
I created the trigger Incheckstock and i want to see if the same trigger fires itself if when i am trying to drop the trigger with the same name (kind of recursive one). Is this possible in SQL 2005?. If I asked a dumb question, please correct me.
I'm having a problem updating my Client profile table. I intially put the data in with the "INSERT" SQL command that part works great. but when I retrive the data to edit the profile it returns the correct details and phone numbers. The problem is when I use the "UPDATE" SQL command it saves all the data correctly except for the mobile phone number which it drops off the last number all the time. Field sizes etc are okay. Any help appreaciated
I guess nobodys heard of this? I'm using DTS to transform data to Excel spreadsheet. I have a DROP TABLE `data$` then a CREATE TABLE `data$` the old data is cleared but the new data is appended to the blank rows of the old data. So if I had 5 rows before now I have 10. And the new data has 5 blank rows before it.
I've tried deleting the excel file & replacing it with a new one. I've used the wizard thinking it was me but no good, it still happens.
I am using Access 2000 to link tables from SQL Server. The tables are linked using ODBC DSN`s. I am running a query to return some rows to Access, but once I have returned the rows, I want to drop the linked table connection to SQL Server, because it is locking a table on the server. I think I need to write a bit of VBA code, but I don`t know where to start. Any ideas would be greatly appreciated. Thanks.
SQL 7 created by default a clustered index on my primary key field. I would like to drop this index and recreate it on another field, but it is not allowing me. Error message states: "An explicit DROP INDEX is not allowed... It is being used for PRIMARY KEY CONSTRAINT enforcement." Can anybody advise how I can solve this? TIA
Hi Has anyone heard of MS SQL Server 7 dropping indexes? I had created an index on a table. The next day the index had disappeared. Has anyone expirienced such a problem?
i would like to drop a distribution database after disabling both susbscriber and publisher .but i get a message saying distribution database is still in use .and as far as i can tell its there is no one using it .also stopped sql agent but no luck . and when i do select @@ servername i get servername is null how do i correct it .
Is there a way in SQL to drop any users from a database. I am trying to schedule some nightly DB maintenance and some users are still in there sometimes. I need to be able to kick the out to do dbcc checkdbs, etc. Is there a way for me to do this without stopping the SQL services?
I'm new to replication and would like to know how to drop an article published for replication. I believe I need to follow these steps, but I am unsure.
I'm changing the collation sequence of a field which is a primary, clustered key field via:
ALTER TABLE [dbo].[clusterAlgorithm] WITH NOCHECK ADD PRIMARY KEY CLUSTERED ( [ClusterAlgorithmClassName] ) ON [PRIMARY] GO
Is there a way to drop the primary key designation before doing an alter table/alter column statement and then recreating the key, or must I drop and recreate the table?
I'm implementing a web-based Employee Self Service product that uses SQL Server as its backend. The product uses a fairly extensive data model which was automatically generated via a custom written schema.
I received a message from the vendor today that states that I need to ADD an additional field to an existing COMPOUND PK in one of their tables.
I wanted to check on one item before I DROP the existing 4 field PK and rebuild it as a 5 field PK.
Since the PK from the table in question is used as a FK in three other tables, will I be allowed to DROP then RECREATE the PK ?
If I do so, will it effect the FKs in the other 3 tables ?