sql-server-2005

Would my environment require a paid SQL Server license?

I've written a plugin for a game that connects to a PHP page and sends it information from the game. The PHP page takes this information, connects to a SQL Server 2005 instance, then inserts the information given into a variety of tables. I am using Apache (WampServer) to host the PHP page and SQL Server 2005 Express for hosting the da...

SQL Server - Transactional Replication (partial data only)

I have 6 months of data, how do I replicate only the most current 3 months of data to the subscribers? ...

Can we write a sub function or procedure inside another stored procedure - SQL Server

Hi, I want to check if SQL Server(2000/05/08) has the ability to write a nested stored procedure, what I meant is - WRITING a Sub Function/procedure inside another stored procedure. NOT calling another SP. Why I was thinking about it is- One of my SP is having a repeated lines of code and that is specific to only this SP.So if we have...

How can I setup MSSQL2005 to respond to "localhost" and another name at the same time?

I am working on a code base that has a number of connection strings that access a database server by a specified name. <add name="myConnection" connectionString="Data Source=DevServer;Initial Catalog='devData';Persist Security Info=True;User ID=devUser;Password=devPass;" providerName="System.Data.SqlClient" /> I am in a lo...

Does sqlserver collation mean column names must be correct case? And how to deal with that...

In SQL Server (2000 or 2005) is it possible to set the database or server collation so that identifier names (tables, columns, etc) need to be in the correct case? If so, is that true of all case-sensitive collations or is it a separate setting? (I've always thought of case-sensitivity applying to data, not to names of objects). Presuma...

Replacing SQL Server 2005 Express Management Studio with the full version

I have been running SQL Server 2005 Express Management Studio ("SSMSE"), and I now have a need to install the full version of Management Studio ("SSMS"). This is a known hassle, but I've not found a comprehensive way to carry it out. At first, I uninstalled SSMSE, and then ran SqlRun_Tools.msi to install the toolset. I got this error me...

Error when creating assembly in SQL: MSG 33009

I'm attempting to load a dll into MSSQL with: USE dbname GO CREATE ASSEMBLY foo FROM 'C:\foo\foo.dll' WITH PERMISSION_SET = UNSAFE GO And I'm getting an error that states: Msg 33009, Level 16, State 2, Line 2 The database owner SID recorded in the master database differs from the database owner SID recorded in database 'dbname'. ...

How can I view all grants for an SQL Database?

I am using SQL Server 2005, I want to find out what all the grants are on a specific database for all tables. It would also help to find out all tables where the delete grant has been given for a specific user. Note: this may be similar to this question, but I could not get the selected answer's solution working (if someone could provid...

What is the best way to refresh a rollup table under load?

I created a table in my SQL Server 2005 database and populated it with summary and calculated values. The purpose is to avoid extensive joins and groupings on every call to the database. I would like this table to refresh every hour, but I am not sure the best way to do this while the website is under load. If I delete every record an...

SQL: What do you use to store a ratio (percentage) in a database?

Should I use decimal or float to store a ratio in a database? Particularly in SQL2005. ...

Which one should I choose to install on my server: Windows 2003 Standard or Windows 2008 Web Edition?

I'm in the process of looking for a dedicated server to host my soon to be released web apps. THey are build with ASP.NEt and uses Sql Server 2005. I've got a great deal with a company for a Intel Core2Quad Q9300 with 8Gb or ram and 750Gb sata. They offer me Windows 2003 64 Standard or Windows 2008 64 Web for free, which one should I ch...

Timezone considerations in sql server

Hi, I'm using an sql server 2005 hosted in the states. Soon we will move the db to Europe. I'd like to update the dates in the db to take into account the timezone difference. Is there a good way to do this? Or is it just a case of looping through the dates and adding the timezone offset? ...

Can somebody explain how the following SQL query to get the 'n' highest salary works

SELECT * FROM employee A WHERE 3=(select count(*) +1 from employee B where B.salary > A.salary) This gets the 3rd highest salary; can somebody explain the logic behind this query and how it works. ...

SQL Data Normalisation / Performance

I am working on a web API for the insurance industry and trying to work out a suitable data structure for the quoting of insurance. The database already contains a "ratings" table which is basically: sysID (PK, INT IDENTITY) goods_type (VARCHAR(16)) suminsured_min (DECIMAL(9,2)) suminsured_max (DECIMAL(9,2)) percent_premium (DECIMAL(9,...

Is it possible to call a user-defined function without the schema name?

I'm using MS SQL 2005 and when I create a function I need to put the schema name to call it: select dbo.MyFunc All my tables are also in "dbo" schema and I don't need the schema name to reference it, so I'd like to know if I'm missing some configuration that could do the same to functions. ...

How to create a stored procedure which pulls data from multiple tables that are not linked What do i do

I need to create a stored procedure which pulls data from multiple tables that are not linked what do i do .Basically i got a few tables that are not linked and all i need to do is pull all the data from all those tables. PLEASE HELP MY LIFE DEPENDS ON THIS ...

MS SQL 2005 compare field containing square parenthesis

I am using MS SQL Server 2005 (9.0.4035) and trying to find rows that contain the same data in a nvarchar(4000) field. The field contains xml that has both opening and closing square parentheses. Here is sample data: DataID Data 1 1 2 1 3 2] 4 2] 5 3[ 6 3[ Using th...

Sql 2005 Locking for OLTP - Committed or Uncommitted?

A DBA that my company hired to troubleshoot deadlock issues just told me that our OLTP databases locking problems will improve if we set the transaction level to READ COMMITTED from READ UNCOMMITTED. Isn't that just 100% false? READ COMMITTED will cause more locks, correct? More Details: Our data is very "siloed" and user specific....

Linked Server and Constraints SQL 2005

Does anyone know if you can drop a constraint on a table via a linked server in SQL 2005 ...

Database Deployment Strategies (SQL Server)

I am looking for a way to do daily deployments and keep the database scripts in line with releases. Currently, we have a fairly decent way of deploying our source, we have unit code coverage, Continuous integration and rollback procedures. The problem is keeping the DB scripts in line with a release. Everyone seems to try the script ou...