sql-server

How to get last modification datetime on Sql Server 2005?

Is there any way to get a table's last modification datetime on Sql Server 2005? Preferably without creating triggers.. And for databases? EDIT The solution of this question contemplated only CREATE and ALTER modifications. For INSERT, UPDATE and DELETE please look my next question ...

How to get last insert/update/delete datetime on Sql Server 2005?

not a duplicate of my previous question Is there any way to get the latest datetime when a table/database had an insert/update/delete on Sql Server 2005? Preferably without creating triggers.. I know that when you need the last update per row, you need triggers. But I am not sure if they are needed when you just want to get the last up...

Glassfish/Toplink and sqljdbc.jar retrying forever on broken db-connection

I'm using Glassfish and Toplink together with an MS-SQL-Server, thus sqljdbc4.jar is used for connecting to the database. When the database is not available (DB server is down), the CPU usage rises to 100% and Glassfish keeps on trying to connect forever. My log fills up rapidly with the following messages: FINE: TDSChannel (ConnectionI...

How does a SQL Server Snapshot retrieve deleted record from original database?

I have created a snapshot, AdventureWorksSS. Deleted a record after creating a snapshot. When I query from AdventureWorksSS, deleted record shows up. Where is that deleted record stored and how does Snapshot still retrieve the deleted record? As far as I understand, snapshot is a pointer to the original database and fetches data onl...

SQL Server: Check references when altering function/procedure signatures

One of my coworkers is working on a set of stored procedures, and changing the input parameters for one of them. This will break any procedure that calls that one, so we need to find all those procedures. Right now, we manually call a dependency finder script that looks in system tables for procedures that reference the one we changed. ...

Displaying totals within a specified date range in Microsoft Access

Although I have experience with SQL and generating HTML reports with PHP, I'm a relative beginner with Microsoft Access. I'm currently using Microsoft Access 2007 to connect to MSSQL Server 2005. I have a table of Reports that looks something like this: ReportID DateCreated Author ... I'd like to create a form that allows the user t...

Encrypted Fields & Full Text Search, Best Approach?

I've got some fields that store notes and sensitive information that I'd like to encrypt before it makes its way into the database. Right now, I use a SQL Full-Text Search to search these fields. Obviously encrypting this data is going to throw off my search results. What's the best way to encrypt these fields, but still allow searchi...

SQL Server & asp.net web app not displaying all the data

Hello, Kinda a vague title I know but i will try to explain what's going on here. Locally i have a asp.net web app hitting a table(local DB) with 2715 records. Everything looks good so I moved it to production. I run the app in production and the table shows 2715 in sql server but the web app only returns part of the results. Thinking...

Change SQL Server Analysis Services permissions set during install

While installing SQL Server 2008 (which included SSAS), I set these permissions, giving a domain group that held our SQL Service Account: . Now I need to change that group to a different one that includes a second service account, but I'm not able to conclusively find the permissions it set. There was overlap with our last domain group,...

Pre-Deployment in Database project

Visual Studio 2008 Database project for SQL Server 2008 The project has placeholders for Pre-Deployment and Post-Deployment SQL scripts. They work - well, most of the time anyways. The project has an option to Always-Recreate-Database: drop the existing database and create a fresh hot-from-the-oven database every time. When I deploy m...

SQL server administrators group

Hi to all, I have a service that runs under as specific windows user. That user is part of the adminstrators group. In the SQL server database, I can see in the security pane : Builtin\Adminstrators. The connections string contains Integrated Security = SSPI (no username or password). Is the fact that I can connect to the database a...

SQL server with german regional settings.

Hi, We have a database application that has been running for months, then suddenly it started to give errors. I noticed a datetime float calculation exception that which was being compared with the value 0,05. I also noticed that dates being written to our xml log file were in the format d.mm.yy. Clearly, the decimal operator being us...

How many tables/sprocs/functions in a database is too many?

I'm interested in database refactoring. I deal with several databases that don't have a large amount of data, just a few GB with at most a few hundred thousand rows. However, they have hundreds -- sometimes many hundreds -- of tables, views, sprocs and functions. In some places a divide-and-rule strategy using schemas has been implemente...

How to build a script to backup all databases in SQL Server?

We need to backup 40 databases inside a SQL Server instance. We backup each database with the following script: BACKUP DATABASE [dbname1] TO DISK = N'J:\SQLBACKUPS\dbname1.bak' WITH NOFORMAT, INIT, NAME = N'dbname1-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO declare @backupSetId as int select @backupSetId = positi...

nhibernate deadlocks

I'm using the following code in an ASP.NET page to create a record, then count the records to make sure I haven't exceeded a set limit and rollback the transaction if I have. using (var session = NhibernateHelper.OpenSession()) using (var transaction = session.BeginTransaction()) { session.Lock(mall, LockMode.None); var voucher...

Difference between Integrated Security = True and Integrated Security = SSPI

Hi, I have two apps, both use integrated security. One works with the values set to true in the connection string and another with the value set to SSPI. Why is the difference, as I knew about SSPI but not using True? JD. ...

Exception management in stored procedures?

I inherited an application with a lot of stored procedures, and many of them have exception handling code that inserts a row in an error table and sends a DBMail. We have ELMAH on the ASP.NET side, so I'm wondering if exception management in the stored procs is necessary. But before I rip it out, I want to ensure that I'm not making a gr...

Is it possible to list all foreign keys in a database?

How do I list all FK's in a sqlserver database? ...

UDF Performance in MySQL

I'm noticing exponential performance degradation in MySQL query execution times when queries include calls to UDF's in the SELECT or WHERE clauses. The UDF's in question query local tables to return scalar values - so they're not just performing arithmetic expressions, but serving as correlated subqueries. I've fixed the performance pr...

Which free database (other than SQL Express) has SQL syntax most similar to T-SQL?

I think there is an upgrade/downgrade path between MySQL and DB2 because they are both pretty ANSI standards compliant. Other than SQL Express, is there a similar pairing of free-"ish"/paid databases for SQL Server? Another way to state the question-- of the free db engines that exist, which is the least painful to migrate T-SQL to? ...