You could use sp_helpdb [ [ @dbname= ] ‘name’ ]
Category: SQL Server
exec msdb..sp_enum_dtspackages
‘ Rename File from Connection Option Explicit Function Main() Dim oFSO Dim sFileName sFilename = DTSGlobalVariables.Parent.Connections(“Text File (Source)”).DataSource Set oFSO = CreateObject(“Scripting.FileSystemObject”) ‘ Check for file and return appropriate result If oFSO.FileExists(sFilename) Then ‘Main = DTSTaskExecResult_Success Main = DTSStepScriptResult_ExecuteTask Else ‘Main = DTSTaskExecResult_Failure Main = DTSStepScriptResult_DontExecuteTask End If Set oFSO = Nothing End Function
‘ Rename File from Connection Option Explicit Function Main() Dim oPkg Dim oConn Dim oFSO Dim oFile Dim sFilename Dim sFileDestination Dim sMonth Dim sDay Dim sYear Dim sHour Dim sMinute Dim sSecond ‘ Get reference to the current Package object Set oPkg = DTSGlobalVariables.Parent ‘ Get reference to the named connection Set oConn = […]
sp_help_job returns information about jobs that are used by SQLServerAgent service to perform automated activities in SQL Server. EXEC MSDB.DBO.SP_HELP_JOB
List all the database on SQL Servers. SQL SERVER 2005 System Procedures EXEC sp_databases EXEC sp_helpdb SQL 2000 Method still works in SQL Server 2005 SELECT name FROM sys.databases SELECT name FROM sys.sysdatabases
The db_datareader role The db_datareader role has the ability to run a SELECT statement against any table or view in the database. This role is often used in reporting databases where users would be coming in via a third-party reporting tool and building their own ad-hoc queries. If you need to restrict a user to […]
Convert Julian Dates in SQL SERVER
SQL SERVER JULIAN TO DATE (WHEN DOWNLOADING JULIAN DATE) date field has to be nvarchar or varchar or character. declare @DateP char(10) select @datep=107277 — ALSO OK FOR 99 YEARS select dateadd(dd,@datep-(@datep/1000)*1000-1, convert(datetime,’01/01/’+ right(convert(varchar,@datep/1000),2))) as Date_ENT
SQL: YYYYMMDD
SELECT CONVERT(VARCHAR(8), GETDATE()-365, 112) This is a way to query and get the date in the following format: YYYYMMDD I came across some dates saved in the database in this format as a varchar and had to use this to initially get the date and then convert it from and integer to varchar.
Standard Date Formats
View Standard Date Formats