sql-server-2005

Is there something like the FileSystemWatcher for Sql Server Tables?

i would like my windows service (to be written in .NET) to recognize when new rows are added to a specific table, but instead of pulling the data from the sql-server i would like to use a server push model. does somebody has a hint for me how to achieve this? i am using sql server 2005. tia ...

How to select one's name day from first name and birth date?

Hey there. I would really appreciate your help in creating a query that would accomplish the following. The problem is with dynamically getting upcoming what we call "namedays" in europe. Nameday is a tradition in many countries in Europe and Latin America of celebrating on a particular day of the year associated with the one's given nam...

SSRS ExecutionLog not updating

We just recently updated our prod instanct to sql sp2. since then the executionlog for ssrs hasn't updated except for NT AUTHORITY\SYSTEM. I need to get this running again because management is using a report based off of the log. ...

Is it safe to delete a clustered index in SQL server?

If I have a clustered index on a table is it safe to delete, and if I do, does it leave the table ordered the same way it was while indexed? ...

ACCESS Jet SQL INT() Function -> SQL Server Function

Hey guys, I am converting an Access Jet-SQL query into T-SQL and I came upon the Int() function. Now, I would like to convert it into T-SQL, and this is what I have so far: --Works for Positive Select CONVERT(INT, 1.2) --Answer = 1 --Not the same as Access SELECT CONVERT(INT, -1.2) --Answer = -1 Now, according to this, I need it to...

ASP.NET 2.0: Cannot Convert VarChar to Int

I have an ASP.Net form, where it grabs a value from a textbox: <asp:TextBox ID="txtID" runat="server" maxlength=9></asp:TextBox> The ID HAS to be 9 numbers. After it grabs it, I want to insert it into a database (SQL Server 2005), so I build a parameterized string, 'The Query cmd.CommandText = "insert into table (aid) values ('@aid'...

SQL Query fails to update

HI I am trying to update a row on an SQL SERVER 2005. When I run the SQL, i recieve a message indicating that the Execution was successful and 1 row was effected. However, when I do a select against this row I supposedly updated, the value remains unchaged. What's going on with this SQL server when a successful query does absolutely ...

SQL Server service broker reporting as off when I have written a query to turn it on

I have made a small ASP.NET website. It uses sqlcachedependency The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications. Description: An unhandled exception occurred during the exec...

What are some good, reasonably-priced SQL Server client tools offering Intellisense for SQL?

SSMS 2008 doesn't have SQL Intellisense when connected to SQL Server 2005! I know of 3 products which enable writing SQL with Intellisense. ApexSQL Edit, Red Gate's SQL Prompt Pro & SQL Assistant. However I am looking for a less expensive solution. Any ideas? ...

Using variable inplace of table in select statment in sql server 2005

declare @var sysname declare @sql varchar(5000) set @var = 'Table_name' set @sql = 'select * from ' + @var exec (@sql) I don't want to use the above script. It is not working using the below mentioned script. declare @var sysname set @var = 'Table_name' select * from @var Is there any way other than apart from using a dynamic que...

Help Delphi And Sql Server 2005

When I run these codes I get this error: parameter object is improperly defined... ADOStoredProc1.Parameters.ParamByName('@InDocNo').Value:=QuotedStr('784'); ADOStoredProc1.Parameters.ParamByName('@inStart').Value:=QuotedStr('1'); ADOStoredProc1.Parameters.ParamByName('@InEnd').Value:=QuotedStr('1'); ADOStoredProc1.Parameters.ParamByNam...

sql server 2005 query - random child rows of UNIQUE random parent rows

I got a parent table 'ProductCategory' and a child table 'Product'. I have this query that returns 3 random products: SELECT TOP (3) ProductId FROM Product ORDER BY NEWID(); I want to enhance that query to achieve that all the products are from different product categories. So the query to get unique categories would be: SELE...

Save and retrieve RichTextBox.Document from/to SQL?

Hello all. I want to use a Wpf RichTextBox to edit data and resave it to SQL field. I need of course the text to be saved as rich text, not just simple text of course. What data-type should be best for storing in SQL server (2005 - forget about file stream)? How do I save/retrieve it? ...

Manipulate SQL data in memory?

I have tables and a lot of sotred procedure that work with sql database. For demonstration purposes I want to load data into memory (maybe dataset that i can then store in session- the demnonstration is limited so server memory cap won't be a problem ?) from my sql tables and manipulate it with my stored procedures. Is it possible? Or...

Storing Date Only in sql server 2005

How to avoid the time portion of the datetime in sql server. I wants only the date portion to insert my database. Thanks in Advance ...

SQL2000 to SQL2005. Query now a lot slower

Hi This query used to take 3secs in SQL2000, now it takes about 70secs. Both databases give the same results. The 2005 database is not running in compatibility mode. Currently we're rebuilding the query to run in SQL2005.. by a process of elimination and understanding the logic. However - can anyone see anything obvious that we've m...

How to insert a Combobox value in to a database

How to insert a Combobox value in to a database. When i hit Save button in my application, it will stored stored into database like this way.. System.Windows.Controls.ComboBoxItem What i do for getting correct value of a combo box? ...

ASP.NET 2.0 cannot open SqlConnection

Using: IIS 6; Anonymous Authentication (with a user that belongs to the administrators group); SQL Server 2005; .NET 2.0 Web.config: <system.web> <securityPolicy> <trustLevel name="Full" policyFile="internal" /> </securityPolicy> </system.web> <identity impersonate="true"/> I have this exception when I try to Open a ...

SQL Server 2008 won't let me add foreign keys

I've been using SQL Server for years, so I'm not a noob. I've recently been having problems where I can't add a foreign key to certain tables in my database using SQL Management Studio and SQL Server 2008 Express. The table I'm trying to reference is there and it has a primary key (with the primary key constraint created), but it doesn...

Compare string data to table data

I have a table with string values that need to matched individually to a column. For example Table A Col1 col2 1234 0029QS, 0029QT, 0029QU, 0029QV 2222 0006AG_0042 2343 0032BP, 0032BQ, 0032BR 1232 5000_0708, 5000_0709, 5000_0710 Table B 0029QS 0032BQ 0006AG_0042 5000_0709 I need to be able to match and pull records...