sql-server

Running SQL Server on the Web Server

Is it good, bad, or indifferent to run SQL Server on your webserver? I'm using Server 2008 and SQL Server 2005, but I don't think that matters to this question. ...

how to find rowsize in table

One of my DBs have grown closer to permitted size. Inorder to find out the table containing the max data, i used the following query: exec sp_MSforeachtable @command1="print '?' exec sp_spaceused '?'" It returned the culprit table comprising the max data. As a next step, i want to cleanup the rows based on the size. For this, i would...

Update SQL Sever Database Schema with software update

How do you update your SQL sever database when installing your product's update? Are there any tools that will integrate with windows installer? My typical schema changes are: Adding/removing columns Adding/removing tables. Adding views. Adding/alter indexs. ...

SQL Server, Remote Stored Procedure, and DTC Transactions

Our organization has a lot of its essential data in a mainframe Adabas database. We have ODBC access to this data and from C# have queried/updated it successfully using ODBC/Natural "stored procedures". What we'd like to be able to do now is to query a mainframe table from within SQL Server 2005 stored procs, dump the results into a ta...

SQL Server 2000 Function for record created datetime

I was given a task to display when a record in the database was added, however, the previous developers never made a field for this, and I can't go back and make up dates for all the existing records. Is there an easy way to extract out a record Creation date from a SQL server 2000 query. SELECT RECORD_CREATED_DATE FROM tblSomething W...

Like in CASE statement not evaluating as expected

Given this data: CREATE TABLE tmpTable( fldField varchar(10) null); INSERT INTO tmpTable SELECT 'XXX' UNION ALL SELECT 'XXX' UNION ALL SELECT 'ZZZ' UNION ALL SELECT 'ZZZ' UNION ALL SELECT 'YYY' SELECT CASE WHEN fldField like 'YYY' THEN 'OTH' ELSE 'XXX' END AS newField FROM tmpTable The expected resultset is: XXX XXX XXX XXX OTH ...

Performance implications of computed columns in SQL Server 2005 database?

The situation: we have a large database with a number of denormalized tables. We frequently have to resummarize the data to keep the summary tables in synch. We've talked on and off about using computed columns to keep the data fresh. We've also talked about triggers, but that's a separate discussion. In our summary tables, we denormali...

In SQL Server 2005, can I do a cascade delete without setting the property on my tables?

I have a database full of customer data. It's so big that it's really cumbersome to operate on, and I'd rather just slim it down to 10% of the customers, which is plenty for development. I have an awful lot of tables and I don't want to alter them all with "ON DELETE CASCADE", especially because this is a one-time deal. Can I do a del...

How to improve performance writing to the database?

We log values and we only log them once in a table. When we add values to the table we have to do a look up everytime to see if it needs to insert the value or just grab the id. We have an index on the table (not on the primary key) but there are about 350,000 rows (so it is taking 10 seconds to do 10 of these values). So either W...

How does including a SQL index hint affect query performance?

Say I have a table in a SQL 2005 database with 2,000,000+ records and a few indexes. What advantage is there to using index hints in my queries? Are there ever disadvantages to using index hints in queries? ...

What's the difference between SQL Server Management Studio and the Express version?

I'm using Express currently. What extra features do I get with the full version? ...

Tips on helping to move to MS SQL from MySQL

I have been interested in database developing for some time now and decided that MS SQL has a lot to offer in terms of T-SQL and generally much more functionality (not saying that Oracle or Postgres don't have that). I would like to know: What are the big paradigm changes I should expect to see? How much effort do "regular" compani...

What would a Database Diagram (ER Diagram/Table Layout) look like for measuring distribution of something?

If I was, for example, going to count "activities" across many computers and show a rollup of that activity, what would the database look like to store the data? Simply this? Seems too simple. I'm overthinking this. ACTIVITYID COUNT ---------- ----- ...

Multiple database corruption on SQL Server 2000 MSDE

We use SQL Server 2000 MSDE for an Point Of Sale system running on about 800 cash registers. Each box has its own copy, and only the local software accesses it. This is a newly updated platform for the cash register vendor--who shall remain nameless. Routinely we are seeing corruption of Master, MSDB, Model and the database used by th...

How to set sql profiler to profile SQL 2005 reporting services

I'm trying to profile SQL reporting services, used from ASP.NET application. In SQL profiler all the SQL run by ASP.NET shows up. It looks like the reporting SQL (from the RDL) doesn't show. Is there some setting or filter I'm missing? ...

Connection to report server could not be made from BI VS 2005 but the report server is browseable

I have IIS6 configured such that browsing to http://localhost:8082/Reports gets me the reporting services default home page, which is all as expected. However, when I try to publish a report via Microsoft Business Intelligence Visual Studio 2005 I get the following error: A connection could not be made to the report server http://localh...

How can I generically detect if a database is 'empty' from Java

Can anyone suggest a good way of detecting if a database is empty from Java (needs to support at least Microsoft SQL Server, Derby and Oracle)? By empty I mean in the state it would be if the database were freshly created with a new create database statement, though the check need not be 100% perfect if covers 99% of cases. My first th...

Pass-through authentication for MS SQL 2005 DB from SharePoint?

Within our Active Directory domain, we have a MS SQL 2005 server, and a SharePoint (MOSS 3.0 I believe) server. Both authenticate against our LDAP server. Would like to allow these authenticated SharePoint visitors to see some of the data from the MS SQL database. Primary challenge is authentication. Any tips on getting the pass-thro...

List of Stored Procedure from Table

I have a huge database with 100's of tables and stored procedures. Using SQL serve 2005 How can i get the list of Stored procedures that are doing a insert or update operation on a table. ...

NHibernate transaction and race condition

I've got an ASP.NET app using NHibernate to transactionally update a few tables upon a user action. There is a date range involved whereby only one entry to a table 'Booking' can be made such that exclusive dates are specified. My problem is how to prevent a race condition whereby two user actions occur almost simultaneously and cause m...