Tag: sql-server-2005

Exec problem in SQL Server 2005

I have the situation where i have two databases with same structure. The first have some data in its data tables. I need to create a script that will transfer the data from the first database to the second. I have created this script. DECLARE @table_name nvarchar(MAX), @query nvarchar(MAX) DECLARE @table_cursor CURSOR SET @table_cursor = […]

How to fix “domain error” in SQL Server 2005 when using LOG() function to get product of set

I have a inline select statement to calculate the product of the set of values. Since SQL Server 2005 doesn’t have a built in Product aggregate function, I am using LOG/EXP to get it. My select statement is: (select exp(sum(log(value))) from table where value > 0) Unfortunately I keep getting the following error: Msg 3623, […]

How many Stored Procedures created everyday ( problem in converting Datetime )?

I make a query that return to me the count of Stored Procedure that created everyday as follow SELECT convert(varchar, crdate, 103) as Date,Count(*) as Counter FROM sysobjects WHERE (xtype = ‘p’) AND (name NOT LIKE ‘dt%’) Group by convert(varchar, crdate, 103) and its already work but dates appear in string format that i can’t […]

Repeating Chart in SSRS?

I’m working on some reports in SSRS 2005. I have a bit of experience of SSRS, but I can’t figure out for the life of me how to do this. The report pulls in a data set from a stored procedure. Then I basically want to generate a Pie Chart for each row in the […]

SqlClient.SqlException occurs during Database Fail Over

I have two Microsoft SQL 2005 databases setup in a fail over scenario. The application connection strings have the “Failover Partner” specified in the connection string. When the currently live database fails over to the slave database, there is a small time period that a user can obtain a SqlClient.SqlException with the message “An existing […]

SQL Server value help

Hey all, is there any SQL Server 2005 guru that can tell me a type of trick to get the values of what is being queried? Ex: UPDATE l SET Inactive = 1 FROM tbl1 e JOIN tbl2 l ON l.CID = e.CID JOIN tbl3 p ON p.PID = e.PID JOIN tbl4 c ON c.PID […]

How to change mm/dd/yyyy to desired format

I have date in format mm/dd/yy.For eg:4/1/2009 means April 1 2009.I want to get format as April 1,2009 in sql.Can anybody help?

Recognize application connected to SQL Server 2005

I’d like to know what application connected to DB and executing SPs. (I want to limit SP execution to only my App – all other – eg MS SSMS would be ignored) So is there a way to find out connected client name? If not maybe you have other suggestion how to ensure only dedicated […]

how to find SP Reference

I want to know whether one SP is referenced anywhere. Currently I am checking using SP_DEPENDS. Is there any other way to check this…?

Question Regarding Fetching Records based on Date Range

SELECT COUNT(td.timeSheetID) FROM TimeSheet t INNER JOIN TimeSheetDetail td ON t.timeSheetID = td.timeSheetID WHERE (CONVERT(DateTime, t.setDate, 23) BETWEEN ‘2012-08-10’ AND ‘2012-08-12′) AND t.employeeID = 300 The above code returns the value i’m looking for. However, when i do the following, i get nothing: SELECT COUNT(td.timeSheetID) FROM TimeSheet t INNER JOIN TimeSheetDetail td ON t.timeSheetID = […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.