Tuesday, August 9, 2011

Creating Linked-server in MSSQL

I come across a situation where I need to import the data from one instance to another, in MSSQL. So, I add the steps here to see it might help.

1) At source DB where we want to retrieve the data, create a new login account, eg. "test" with password "123".

2) Use the neccesary authetication, choose to untick "Enforce password policy" for our testing purpose.

3) If the db name in source DB is called "testing", maps the test account "test" to this db, with appropriate schema. In this case, it's "dbo". Add the role as "db_datareader" as well.

4) At destination DB where we want to store the data, create a same new login account created in step (1), eg. "test" with password "123", using SA account.

5) Use the neccesary authetication, choose to untick "Enforce password policy" for our testing purpose.

6) If the db name in destination DB is called "testDB", maps the test account "test" to this db, with appropriate schema. In this case, it's "dbo".

7) Add a linked-server in destination DB, you can either use SQL script or GUI.

8) You can verify the available linked-server in the destination DB, thru' Catalog Views: sys.servers

9) Now, log-in as "test" user.

10) So, you should be able to query the source DB data by using a fully-qualified name.

Wednesday, May 12, 2010

You can get my projects at Softpedia now, hehe

Softpedia Editorial Team informed me that they have included my projects in their sites. 
1) Analog Clock - A small desktop gadget that will display the current time (Downloads: 44)



2) SQL Management Console 0.1.1.29977 -Query pane and result pane (Downloads: 50)


Again, really thanks to them.

Wednesday, February 24, 2010

Print Zebra barcode label thru' ASP .NET

Recently, one of the projects I am maintaining required me to enhance the existing feature, which is printing the Zebra barcode label through ASP .NET. The old staff who developed it left the company long time ago, and there's no other colleagues know how it was developed and worked.

Printing it as WinForm application is not uncommon with the SerialPort Class, as there's a lot of resources out there, but not so true for ASP .NET.

So I needed to google around and posted question to the forums. With some lucks and googling skills, i managed to let it works and add enhancement on that. But i found not full steps on web, so just to post this to help someone who might need it in the future.

1.a) Set the "Generic/Text Only" as default printer driver. Yes, you see it correctly, it's not zebra printer driver that match your zebra printer, since it's printed through web.


1.b.i) If you do not have it, you can go to any existing printer property page (right-click on any other printer driver) and add this driver.


1.b.ii) Browse to driver list start with "G", then you will find it. Finish this installation process.


2) Once you have the driver, setup the ASP designer with Zebra programming language (ZPL) like this (The buttons are for user to trigger the ZPL to send).

3) By calling the undocumented print() function (not window.print(), and I think it works on IE only) in javascript, you can print the zebra bar-code label through ASP.NET.

4) Keep the web form as clean code as possible, you will send it as ZPL and ZPL only to printer.

5) Print it! You should get it ;)

Friday, July 10, 2009

Google lauches Chrome OS

Few days ago, Google launches Chrome OS at its official blog, and it quotes:

"Google Chrome OS is an open source, lightweight operating system that will initially be targeted at netbooks."

There's more from John O'Conner's Blog:

"Google Chrome OS will be a slightly more beefy Android OS ..."

And from the FAQ session of the main site, there's a screenshot of this OS (this image does not belong to me):

It's not weird Google target on netbooks, since netbooks has stronger sales recently.
Personally I think it's still too early to judge the impact of it towards Windows OS on desktop.

Saturday, February 7, 2009

MSSQL 2008 System View release!

Are you a DBA? Want to know how the overall architecture of MSSQL? Ever wonder how you can manage the databases easily? How you can create a version of simple MSSQL Management Console better than mine? Yes, now you can see how it works through the entity-relationship model (ERM) at here.

Start from sys.objects, sys.columns, ..., you can easily manipulate your T-SQL scripts within the following categories of component:
  • Objects, Types and Indexes
  • Trace and Eventing
  • Linked Servers
  • Common Language Runtime
  • Partitioning
  • Database Mirroring
  • EndPoints
  • Database and Storage
  • Execution Environment
  • Service Broker
  • Security
  • Transaction Information
  • Resource Governor
  • Server-Wide Information
  • Full Text Search
  • Extended Events

p/s: During last year PDC 2008, .NET FX team has released a selection of new types and namespaces introduce in FX4 at Brad Abrams's blog. From there, you can download 2 versions:

  1. PDF version
  2. DeepZoom version