sql-server-2005

ASP Classic Webapp - Connect to different SQL DB via login

Need a way to connect to a unique SQL db via login in ASP classic. THE SETUP Webapp: ASP classic/SQL 2005. Webapp stores information for multiple companies. All data stored in one master SQL 2005. All db's will be on same server. Each user has a unique login (Company, User ID, Password) Connection is with master db include file us...

How to scan/search for active SQL Server instances with Java?

Is there an easy way, using Java, to scan/search the local network for SQL Server database instances? ...

To Fully Enforce Your Data Model or To Not Fully Enforce Your Data Model

http://weblogs.sqlteam.com/jeffs/archive/2008/08/13.aspx: Consider the following logical data model: * There are multiple Companies * Each Company has many Projects * Each Project has many Tasks * Each Task has a Status, selected from a global list of pre-defined Statuses. Let us say that we decide that the pr...

NHibernate + default getdate() column

How do I configure NHibernate to create the db schema with a column like this: create_dt datetime not null default getdate() I have this in the mapping file: <property name="create_dt" update="false" insert="false" generated="insert" not-null="true" /> Is there anyway I can inject the sql server specific default getdate(). The docu...

how to use market basket analysis (apriori) sql server 2005

I want to finish my final project, my project is about market basket analysis with apriori algorthm. I use C# and SQL server 2005. Can you help me please. I have a saving mart datasets. I am newbie and I don't know step-step how to use market basket analysis on sql server 2005. Please help me. ...

how can effectively debug stored procedures in visual studio

hi ive been debugging sql 2005 stored procedures in visual studio 2005 and find it really frustrating that i can't run a sql query while stepping through the code. specifically my main issues are... if my SP inserts/updates to temp tables then i cant query those tables while debugging. would be cool if i could use the immediate wind...

Dynamic order direction

I writing a SP that accepts as parameters column to sort and direction. I don't want to use dynamic SQL. The problem is with setting the direction parameter. This is the partial code: SET @OrderByColumn = 'AddedDate' SET @OrderDirection=1; . . . ORDER BY CASE WHEN @OrderByColumn='AddedDate' THEN CONVERT(varchar(50),AddedDate)...

SQL Server 2005 cd Key

I need to get the cd key of my installed instance of SQL Server 2005. I've used the following code and it doesn't work, most likely because I think it was for SQL Server 2000. Please help. USE master USE master EXEC xp_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\Microsoft SQL Server\80\registration', 'CD_KEY' ...

Modifying SQL Database on Shared Hosting

I have a live database on a shared hosting server. I am making some major changes to my site's code and I would like to fix some stupid mistakes I made in initially designing the database. These changes involve altering the size of a large number of fields, and enforcing referential integrity between tables properly. I would like to make...

T-SQL equivalent of PL/SQL %TYPE?

Is there any equivalent to %TYPE in MSSQL2005? CREATE TABLE TEST (ID NUMBER(5)); DECLARE myVar TEST.ID%TYPE; BEGIN ................ END; ...

Add column2 before column1

Hi, i have table structure with 3 colums (column1, column2, column3) and i want to put another column with sql statement like: alter table tbl_name add column4 but i need to put it between column1 and column2 may i do something like in MYSQL: alter table tbl_name add column4 after column1 ...

Install : SQL Server Business Intelligence Development Studio

I have installed Microsoft SQL SERVER 2005. This consists of the Configuration tools(SQL server configuration manager,SQL Error and usage Reporting, Sql Sever Surface area configuration, Reporting Services configuration) and SQL Server Management Studio. However I dont find SQL Server Business Intelligence Development Studio. Can anyb...

INT vs Unique-Identifier for ID field in database

I am creating a new database for a web site using SQL Server 2005 (possibly SQL Server 2008 in the near future). As an application developer, I've seen many databases that use an integer (or bigint, etc.) for an ID field of a table that will be used for relationships. But lately I've also seen databases that use the unique identifier (...

Rearrage column order in sql server

How to rearrange column order in sql server ? right now my column is showing like below when i physically right click and take properties: in sql server 2005 colA1 colA2 colA3 colA4 colB1 colB2 colB3 colA5 colA6 Since i know these columns (colA5,colA6) are created new ! How to make it like this ? colA1 colA2 colA3 colA4 colA5 colA...

There is already an object named 'tbltable1' in the database

I am trying to insert data from one table to another with same structure, select * into tbltable1 from tbltable1_Link i am getting the following error message : There is already an object named 'tbltable1' in the database. ...

design query in editor (left outer join)

Hi how do i build left outer join or right outer join using sql server design query in editor feature (i'm using sql server2005) Thank you, Nagu ...

Column name or number of supplied values does not match table definition.

In SQL server, I am trying to insert values from one table to another by using the below query : delete from tblTable1 insert into tblTable1 select * from tblTable1_Link I am getting the following error : Column name or number of supplied values does not match table definition. I am sure that both table having same structure,colum...

Column name or number of supplied values does not match table definition wthout droping table

In SQL server, I am trying to insert values from one table to another by using the below query : insert into tblTable1 ( [Week], 20001, 20002, 20003, 20004, 20006, 20005, W/c ) select * from tblTable1_link ( [Week], 20001, 20002, 20003, 20004, 20006, 20005, W/c ) I am getting the following error : Serv...

SQL Server BETWEEN problem

I have a table mapping postal code ranges to contacts. Postal codes are saved in multiple formats for different countries. Table postcode-range: FROM-CODE TO-CODE CONTACT-ID COUNTRY-CODE 12000 12999 18 fr BT000000 BT9ZZZZZ 34 uk ... To find a contact in a specific range , e.g. range star...

SQL Server Full-text Search Discarding Single Digit Numbers

I have a SQL Server 2005 Full-text index with the language set to Neutral. I've edited the stop word list to remove single-digit numbers and rebuilt the index. If you search for any single digit (using contains), it ignores the number. 2 or more digit numbers work fine. Any ideas? ...