I am looking for some SQL to read the SQL Server Catalog and auto-gen DDL for Indexes? (joing sysindexes to sysobjects, etc)
I don't just need the index name - I need the entire set of DDL for a given index. To be used to reCREATE indexes after I drop them and load a db w/ data.
thanks for...
problem resided in that I was attempting an INSERT into a row into a table w/ an identity column. My global variable was set to 1 - causing a failure. I reseeded the identity column table def to zero and the INSERT worked.
Does anyone have SQL which will auto-generate CREATE INDEX DDL using SQL's Catalog as it's data source?
(I do NOT want to manually create the DDL using Enterprise Manager generate sql script)
I have the need to DROP Indexes prior to loading large volumes of data. Then, dynamically recreating...
Anyone know of a product / utility which will allow a user to selectively create SQL Scripts to build SQL objects?
Our development team architect wants the capability to dynamically select any object (table, view, sp, etc) and generate script to be dynamically imbedded in his nitely deployment...
Experiencing a single table / single row Transactional Replication burp (processes & source/target DB's are in sync and operational)
Details
- under our Rep Monitor Agents / Distribution Agent I see:
{CALL sp_MSins_tblMbrAssignments (2668927, 546264, 1, N'546264', 2004-12-21 00:00:00.000...
From source server/db query analyzer:
>> BACKUP DATABASE your_dbname TO DISK='c:\your_dbname.bak'
From target server/master db query analyzer:
>> RESTORE DATABASE your_dbname FROM DISK='c:\your_dbname.bak' WITH RECOVERY, REPLACE
Within SQL 2000 Enterprise Manager, under Management I see the started (green arrow) SQL Server Agent icon w/ a small red circle (looks like a clock) over it.
What does this indicate?
--Declare/Open/Fetch/Close/Deallocate CURSOR sample
declare @UserTableName nvarchar(40)
declare UserTableSize cursor for
select rtrim(name) from dbo.sysobjects where OBJECTPROPERTY(id, N'IsUserTable') = 1 order by name
open UserTableSize
fetch next from UserTableSize into @UserTableName
while...
...all table names and their corresponding space allocations and usage for tables in a given Database.
This renders all user table info:
select * from dbo.sysobjects where OBJECTPROPERTY(id, N'IsUserTable') = 1 order by name
Does anyone have anything in their vast bag of tricks??
Much...
- Have a UserID "FRED".
- FRED registered SQL Server XYZ using SQL Server Authentication (specifying his UserID and PWD)
- FRED is DBO on WIDGETS DB.
- Whenever FRED creates a stored proc, the OWNER is showing up as FRED
- FRED can create procs w/ DBO. prefix but the OWNER remains as FRED and...
/* SQL Profiler setup
- Start SQL Profiler and from FILE menu select NEW and then select TRACE.
You will be prompted to provide the information about the SQL Server you want to monitor.
Select server name, fill out login and password fields and then click OK.
- On the new screen...
Need a recommendation on SQL Profiler. I have a user stating he has a poor performing BIZTALK query.
Generically asking, how can I capture the query?
What SQL Profiler EVENT(s) (eg. TSQL, Transactions, etc) should I specify?
What SQL Profiler DATA COLUMN(s) (eg. DatabaseID, etc)should I...
In SQL Server 2000 (sp3), does DBCC REINDEX physically LOCK the table?
One DBA tells me it does, the other DBA tells me you can still execute queries against a table being REINDEXed.
For Snapshot Replication of source (PUBLISHED) tables containing IDENTITY columns, do I need to proactively do "anything" to ensure the propagation of these columns contents as is?
In this table of 3 rows (ID values = 1,2,3)
CREATE TABLE [dbo].[Application] (
[ID] [int] IDENTITY (1, 1) NOT...
My SQL 2000 DTS "Copy SQL Server Objects task" is loading tables I've deselected on the SELECT OBJECTS screen
(NOTE: there are no dependencies between the objects I've UNchecked and the remainning objects)
Characteristics of the Task "Copy" tab:
SELECTED: Create destination objects, Drop...
BACKUP DATABASE PlantData TO DISK='e:\PlantData.bak'
--then
RESTORE DATABASE PlantData2001 FROM DISK='e:\PlantData.bak'
WITH RECOVERY
--or Try using the DTS 'COPY SQL OBJECTS TASK'
Thoughts on the following:
My SHRINKFILE on a Reporting DB consisting of 187 GB allocated, 100 GB used -- is taking several hours. I recently learned that after I restore the Reporting DB (from a prod DB backup) I can DROP 2 very large tables in the Reporting DB (occupying upwards of 80% of...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.