sql-server-2005

Last modification date for a live SQL Server 2005 database

Is there a way to know when the last write operation has occurred in a live SQL Server 2005 database? I currently have 30 (and growing) databases on my server. Only some of these see daily activity (but which ones get daily activity varies over time.) My backup space is limited and I'd like to do a daily backup of all "modified since la...

sql server driver name

Hi, How do I find what string is to be put in my ASP.NET application config file in the 'driver' attribute for the dataAccess node? So here is the node to be clear: <add name="somenamehere" driver="I want to know what goes in here???" connectionStringName="somenamehere"/> Its a MS SQL Server 2008. I am sorry if this has been answered...

How can InstallShield check if SQL Server 2005 (3.1) Compact Edition (CE) is installed

I am developing a Windows desktop application which requires the SQL Server 2005 Compact Edition (SQLServerCE31-EN.msi) to be installed. I am using InstallShield 2011 to install this as a pre-requisite during the installation process. In order to come up with the pre-requisite definition I used Process Monitor to see that these registry...

Why does the parameterized version of this query run slower than a non-parameterized version?

Sample Query: CREATE PROCEDURE dbo.Test (@p varchar(10)) AS DECLARE @param varchar(10) SET @param = @p + '%' SELECT * FROM table1 t1 INNER JOIN table2 t2 on t1.id = tr.id WHERE t2.desc LIKE @param I've a query which is similar to one above and when i use this in stored procedure it runs indefinitely without giving any output. But if ...

How do I split a sentence in SQL Server 2005

I have a column named Address in a table. I have values such as 12-15 Hardley Street 2A-C Hardley Street A-2c Hardley Street A-B Hardley Street I am required to keep the hyphen(-) intact in the first three rows. i.e. If there is a number in the word that contains the hyphen(-), I should keep it, else I should replace with...

Copying a 1-to-many relationship between two tables to another two tables (SQL 2005)

Hi everyone, I have two tables with a parent-child relationship. I would like to copy some of their records to two other tables, also with a parent-child relationship, but with a slightly different table structure. There is a foreign key involved with both sets of tables, an integer column. All tables have the identity increment on...

How to read SQL Server 2008 date into Java using JPA

I need to use java.util.Calendar in order for Axis2 webservice client to send/receive Date objects. So in my JPA model object I changed all java.sql.Date into java.util.Calendar. By using java.util.Calendar the Axis2 webservice part work ok. I'm able to save a java.util.Calendar object into database. Problem is that I can not read th...

Best way to move data between tables and generate mapping of old to new identity values

I need to merge data from 2 tables into a third (all having the same schema) and generate a mapping of old identity values to new ones. The obvious approach is to loop through the source tables using a cursor, inserting the old and new identity values along the way. Is there a better (possibly set-oriented) way to do this? UPDATE: One a...

SQL Server 2005 backups for previous 5 days on disk?

My goal is simple. I want to have SQL Server keep a nightly backup of a DB for a rolling 5 days. So each night at some time I want a new DB backup made and one deleted such that I have a rolling 5 days on disk. I am trying to get a maintenance plan set up to handle this work and have the saving of the file done (I think). I have the ba...

Replace NOT working!!!

I have column with values that have wrong character ?. Now I want to change it to character b. For this I am using this statement: SELECT REPLACE(name,'?','b') from contacts; But when I do this nothing's happening, it return value with ?. What I am doing wrong? How I can replace this? ...

Has date type changed in SQL Server 2008?

I am confused reading statements in "Why is 1899-12-30 the zero date in Access / SQL Server instead of 12/31?" Was there date type in SQL Server before 2008 version? I cannot find. In SQL Server 2008 zero date is 0001-01-01. Were there any date type before (in previous SQL Server versions) how is it backward compatible? ...

please any one provide sql server 2005 BIDS software to install in my pc

please any one provide sql server 2005 BIDS software to install in my pc. is there any free download for this software . really its urgent for me please any one help me ...

Using .Include() when joining a view using Entity Framework

Im using an Indexed View which is an entity without any relations (relations to my table entities would be preferable but this seemed to be nearly impossible to achieve). This view consists of 4 FK's which together form the PK: PortalID CategoryID BranchID CompanyID Now im joining this view to select a set of companies like this: var...

Grid view - Column

Hi all.. I am creating an application in asp.net..I used a grid view to show the datas .. By using the autogenerate columns I bind the datas to the gridview.. Now i want to make a edit button at the end ..By clicking that the user can edit their details ... But i need to count the number of columns in a row to make a pop up...

Any tips for T-SQL/Powershell code to automate failover for log shipping?

Given that I have to use log shipping and have a lot of databases that need to be failed over does anyone have any T-SQL/Powershell code for MS SQL Server 2005 that can automate that failover process as much as possible? These are the steps it would need to cover (or as many as possible): Attempt to backup the transaction log one last...

Why "Subquery returned more than 1 value. This is not permitted.." for same query in trigger and not as execute normal query

Hi, I am still trying to get of triggers right, but when is working it seems the other starts (failing) again. Annoying.. but also educational :-) When i executed the following SQL in MS SQL server is completes successfully, but when it is executed in a AFTER UPDATE trigger it fails with the error Msg 512, Level 16, State 1, Proc...

Internal query Processor Error

I try to execute sp_updatestats on MYdb and I get the following error: "Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services." I have SQL server 2005 SP3. Please help. ...

variable decimal places in sql

How do you make it so that all calculations in the DB compute to a pre-specified # of decimal places? Say I have three tables with the following fields Table1 A int B decimal(18, 3) Table2 A int B decimal (18, 2) C decimal (18, 3) Table3 A int Precision int Now I need to change it so that all my calculations are based on w...

How can I find all columns that are filled with 100% nulls in my SQL Server database schema?

Is there a SQL way to find out which columns in my schema are completely full of null values? There are some fields in a couple of tables that I know are not used by the application and will be dropped, but I wanted to see if there was an automated way/script to find this out across the whole database to find candidates for code review/...

return records in sql server which has data in a particular format

Hi Guys, I have a SQL database table column which has data in this format "0000-00-0000" for ex: "1234-98-2010" For it has data in other formats as well. I need to pick out all the records where the format is "0000-00-0000" irrespective of the data. Its the format which i am after Please, can some one advise me on how i can pick th...