Monday, November 12, 2018

SQL Server: getting the lay of the land

If you inherited a SQL Server instance, the following queries are helpful, especially because the SSMS UI doesn't show you creation dates or who created them.


select * from sys.credentials
select * from msdb.dbo.sysproxies
select * from sys.sql_logins
select * from sys.server_role_members
select * from sys.databases order by create_date
select * from msdb.dbo.sysjobs order by date_created

Sunday, February 11, 2018

for NodeJS use Atom as your Text Editor

Just look at that syntax coloring!


And the shortcut to run Atom, if the install failed to create one, is:

C:\Users\yourname\AppData\Local\atom.exe


Node.js: how to exit from the Node console

Node.js: how to exit from the Node console


How to exit from Node command line
So you loaded the Node console by typing node at the command line, played around with it and want to get back to your OS command line. Press CTRL+C (even on a Mac, especially on a Mac!), or just call the process.exit() method to exit from the Node console.
$ node
> 9+23
32
> process.exit()
$ 

Same thing if you started up a basic Node http listener routine from the command line.

C:\Users\yourname\Documents\nodeStuff>node myfirstt.js
^C
C:\Users\yourname\Documents\nodeStuff>


There you go!

Saturday, January 27, 2018

National Lampoon - Every Issue from 1970 - 1998

Just saw that Netflix movie and was surprised that it was so difficult to find these online.  They were on the Internet Archive for a time, but perhaps due to legal issues, have been pulled.

There was a DVD-ROM or CD-ROM of the archive published, but not only no longer for sale, but not even available on eBay.

But I finally dug up the archive.

Here it is.

So here you go, enjoy:

http://www.microrican-gaming.com/NL/

https://web.archive.org/web/20170420082453/http://www.microrican-gaming.com/NL/



Saturday, January 6, 2018

To View Constraints in SQL Server database

quick and dirty:
SELECT * FROM sys.objects
WHERE type_desc LIKE '%CONSTRAINT'



Clearer:

SELECT OBJECT_NAME(object_id) AS ConstraintName,

SCHEMA_NAME(schema_id) AS SchemaName,

OBJECT_NAME(parent_object_id) AS TableName,

type_desc AS ConstraintType

FROM sys.objects

WHERE type_desc LIKE '%CONSTRAINT'

For specific  table:

add the following to very end:
AND OBJECT_NAME(parent_object_id)= 'theNameOfYourTable'


thanks to: https://bhaveshgpatel.wordpress.com/2009/11/04/sql-server-list-all-constraints-of-database-or-table/