Nik's Technology Blog

Travels through programming, networks, and computers

SQL Server Login Change

If you happen to install Microsoft SQL Server under a Windows account you later want to change to another Windows account you will have to login to Windows using the account it was installed under (Go to Control Panel>Administrative Tools>Services to find this out). You should then stop all SQL server services (MSSQLServer, SQLServerAgent, Microsoft Search, Full-Text Search, Distributed Transaction Coordinator etc). In Control Panel, click on Administrative Tools and then Services. For every SQL service you have installed you will need to view and edit the logon properties, changing the account for each one. A reboot should then complete the process.

SQL DTS Designer -

Currently working on trying to automate the bulk input of web log files into a MS SQL database with DTS Designer and Active-X script.

Managed to concatenate fields and perform VB commands on the data prior to input. However running through a directory of files to input is somewhat more difficult.

Ideal DTS import solution

Adding Contraints to SQL tables

Constraints are important within a database structure as they insure database integrity.

This useful SQL command shows how to add constraints to existing SQL tables.

In this command a constraint between 2 tables (tblCountries and tblCompanies) is being created called FK_tblCompanies_tblCountries.

alter table dbo.tblCompanies add constraint FK_tblCompanies_tblCountries foreign key (ISOCountryCode) references dbo.tblCountries(ISOCountryCode)