This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//live strings | |
string MSTRServer = "SERVERNAME"; | |
string MSTRLogin = "LoginWithAdminRights"; | |
string MSTRPwd = "Password"; | |
int ProjNum = 4; //you would need to get the project number from MSTR | |
string projectSource = "Project Source Name"; | |
string projectName = "Project Name"; | |
DSSDataSource oServerDS = new DSSDataSource(); | |
oServerDS.Type = EnumDSSDataSourceType.DssDataSourceTypeServer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateCubes | |
{ | |
public class MSSession : IDisposable | |
{ | |
private DSSCOMMasterLib.IDSSDataSource _ds; | |
private DSSCOMMasterLib.IDSSSession _session; | |
public DSSCOMMasterLib.IDSSDataSource DataSource | |
{ | |
get | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [DATABASE NAME] | |
GO | |
/****** Object: StoredProcedure [etl].[spp_EmailETLComplete] Script Date: 06/12/2000 16:15:33 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE PROC [etl].[spp_EmailETLComplete] | |
AS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT 'set objShell = CreateObject("Shell.Application") set objFolder = objShell.NameSpace(ParentFolder) objFolder.NewFolder "' + | |
a1.EMPLOYEE_NAME + '"' | |
from LU_HR_EMPLOYEES a1 | |
join LU_HR_EMPLOYEE_STATUS a2 | |
on (a1.EMPLOYEEID = a2.EMPLOYEEID and a1.NATIONALID = a12.NATIONALID) | |
join LU_HR_EMPLOYEE_STUDIO a3 | |
on (a1.EMPLOYEEID = a3.EMPLOYEEID and a1.NATIONALID = a13.NATIONALID) | |
join LU_HR_STUDIO a4 | |
on (a3.STUDIO_ID = a4.STUDIO_ID) | |
where a2.STATUS_ID in (3, 1) --active or on leave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @SourceDB varchar(128) | |
set @sourceDB = 'jivesbs' | |
declare @sql varchar(128) | |
create table #tables(name varchar(128)) | |
select @sql = 'insert #tables select TABLE_NAME from ' + @SourceDB + '.INFORMATION_SCHEMA.TABLES where TABLE_TYPE = ''BASE TABLE''' | |
exec (@sql) | |
create table #SpaceUsed (name varchar(128), rows varchar(11), reserved varchar(18), data varchar(18), index_size varchar(18), unused varchar(18)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--updated 6/27/2014 to include schema for each object | |
SELECT table_name AS [Table], column_name AS [Column], table_schema as [schema] | |
FROM information_schema.columns | |
WHERE column_name like '%' + @var + '%' | |
ORDER BY table_name, column_name | |
SELECT table_name as viewname, TABLE_SCHEMA as [schema] | |
FROM information_schema.views | |
WHERE view_definition like '%' + @var + '%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script><script type="text/javascript"> | |
$(function(){ | |
$("table").css("width", "100%"); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT o.name AS "Table Name", i.rowcnt AS "Row Count" | |
FROM sysobjects o, sysindexes i | |
WHERE i.id = o.id | |
AND indid IN(0,1) | |
AND xtype = 'u' | |
AND o.name <> 'sysdiagrams' | |
ORDER BY i.rowcnt DESC | |
COMPUTE SUM(i.rowcnt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS(SELECT * FROM tempdb..sysobjects WHERE id = object_id('tempdb..#t_users')) | |
drop table #t_users | |
CREATE TABLE #t_users ( [name] SYSNAME) | |
INSERT #t_users ( [name] ) | |
SELECT [name] | |
FROM sysusers | |
WHERE | |
islogin = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--statement 1 | |
DECLARE @a int, @b bit, @c varchar(50); | |
SET @a = 1989834; | |
SET @b = 0; | |
SET @c = 'Testing'; | |
SELECT @a, @b, @c; |
OlderNewer