Maintenance and Management

Technical Article

BCP OUT tables from any database

  • Script

This script will help DBA's who wants to BCP out required tables form any database. This script can be run through as a job. Before running you have to create a table in any given database and store the table names in it, which you want to Bulk copy. Query in this procedure will check […]

5 (1)

You rated this post out of 5. Change rating

2005-02-17 (first published: )

286 reads

Technical Article

Convert Unique Identifier to Varchar data type

  • Script

Script will drop the Default, Primary, Unique, Foreign Constraints, Index and ROWGUID on Unique Identifier data type column and finally it alters the unique identifier to varchar (38) data type. I have compile and execute the script in my database server. Script has executed successfully.

You rated this post out of 5. Change rating

2005-01-12 (first published: )

713 reads

Technical Article

Grant Read-only permission to user on jobs

  • Script

create this SQL as a stored procedure and give user execute permissions on it store procedure. that user will be able to see all the jobs and their associated schedules but won't be able to modify, create or execute job. This is particularly a request most often aske dby developer to view jobs/schedules on production […]

You rated this post out of 5. Change rating

2004-11-15 (first published: )

617 reads

Technical Article

Fix orphan users

  • Script

some times after restore database, you find your logins and users mapping is lossed and no user can now logon to database using application. I faced that many times. To map all your database users with master..syslogins. save this procedure in current database and execute it. All users will be mapped with logins.

You rated this post out of 5. Change rating

2004-11-12 (first published: )

383 reads

Technical Article

how to start a program like Notepad.exe in a job

  • Script

sometime I need to kill an program which does not continue to process data, and i sheduled a job to do that. After lots of times' try, I made it at last.This script add a shedule to the sheduled task list, one minutes later then the current system time. You can change it by edit […]

4 (1)

You rated this post out of 5. Change rating

2007-02-28 (first published: )

251 reads

Technical Article

To estimate the size or the future size of a DB

  • Script

The level of index fragmentation is not taken into consideration. Actual level of fragmentation is assume to be proportionnal over time.Only one object can be used as the witness to drive the database size.A normally distributed database is needed for this tool to report accurate estimates. ** Example : dbo.sp__EstimateSize @UpdateUsage = true ,@ObjGuidance = […]

You rated this post out of 5. Change rating

2004-09-16

265 reads

Technical Article

Checking SQLAgent service and starting it if not.

  • Script

Because many programs I wrote depends on the SQL Agent Service and to really make sure that no one has configured this service to run manually (you see many things in life) I rely on this litle piece of code

You rated this post out of 5. Change rating

2006-12-27 (first published: )

183 reads

Blogs

How to find free space in Azure PosgreSQL

By

I wanted to figure out how big (or approximately how big) my dump file...

T-SQL Tuesday #180: Good enough is perfect Roundup

By

This month, I prompted bloggers to discuss whether good enough is perfect. Thank you to all...

Using SQL Compare with Read-only Access

By

Recently a customer asked if SQL Compare and SQL Data Compare can be used...

Read the latest Blogs

Forums

Announcing SQL Server 2025

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Announcing SQL Server 2025

Running Steve's Code

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Running Steve's Code

New SQL Server 2022 Functions

By Steve Jones - SSC Editor

Comments posted to this topic are about the item New SQL Server 2022 Functions

Visit the forum

Question of the Day

Running Steve's Code

Can you run this code in any of your SQL Server 2019 databases without error?

CREATE OR ALTER PROCEDURE [dbo].[StevesAmazingProc]
AS
    
        SELECT Consumer_ID ,
               Trend_Category ,
               Bit_Trace
        FROM    NewWorldDB.dbo.MarketTrend;
    
GO

See possible answers