sql-server-2008

Not getting Multiple DataSets when we call stored proc that returns multiple DataSets in SSRS Report

Hi, I have SP called "GetDUPRecords" and this SP will perform some operations and returns 3 result sets. First Result Set: will get More records, basically need to display in SSRS Report. Second Result Set: will give one row on doing some operations on Result set 1. Third Result Set: will give one row on doing some operations on Result...

SQL MDF file size not changing

Hi All, In my Db initially i have one table with three columns and no data at that time the MDf file size was 5122 KB. Then i have inserted 500000 records in this table, MDF file size increased to 19456 KB Then i have updated my table and made all the values of one column as Null but the file size is still same i.e 19456 KB. Then i h...

using datagridview for update and delete data

I have some question about DataGridView. I can show table in DataGridView, but I don't know that after update data in DataGridView how can I update that fields in table? how can I delete selected rows in DataGridView and table in SQL Server? I don't want to let user insert data with using DataGridView. If I want to let to user to inser...

sql server 2008 full text search newbie question

If I have a variable that is of the type text or ntext and I want to find out what keywords from a column in a table exist in this document, what is the most efficient way to do this. Also, if a C# program is going to pass me this information, is using a text or next variable more efficient than a table variable where each row represents...

how to make foreign key relationship on physically distributed data?

three servers server 1 is central point which links the other two servers. the other two servers have a table which has a field which should act like a foreign key problem well i do not know how to do this, using vs08 or sql server 08 diagram view table on server 1 sv1pg1 id -- primary key details tables same schema on srvr...

How can I Insert data into SQL Server 2008 of any file in bits format?

Please reply as soon as possible. Because I am working on a project right now and I need the solution of this problem. Thank you! ...

Delete data from dependent tables

Is there a query in SQL Server 2008 which will delete data from all dependent tables as well, along with the selected table? My apologies for not having elaborated on the question. I know that Cascade Delete would work fine, but my application connects to a 3rd party SQL Server db. I have a few Unit Tests which insert into the target ta...

A few Stored Procedures on sql server values are interchanged

Hi My service is deployed on a few IIS and they execute a considerable number of instances (100-200) of 3-4 different Stored procedures simultaneously. The SPs are executed Via "executescalar". All SPs are returning different value types. I realized that the values have been replaced for SP calls that are made at same time. I am sure a...

T-SQL average function - count 52 rows of data

I need help writing select statement that will do an average of the most recent 52 rows of data. If there is less then 52 rows it will only do the avg of how many rows there are. I know the avg function in SQL will skip the null...but i got this far. SELECT AVG(E.Interest) from InterestRates E Where Interest in (select COUNT(Interest)...

SQL Server 2008 - Update Query Timeout.

I'm using SQL2008 and .NET 4. The following UPDATE query causes timeout errors. Table Pages has 600,000 records. Error: System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Query: UPDATE Pages SET Checked = 1...

SQL Server 2008 Update Query with Join and Where clause in joined table

Hi All, not sure why this is not working.. UPDATE ust SET ust.isUnsubscribedFromSystemEmails = 1 FROM UserSetting AS ust INNER JOIN [User] ON ust.userID = [User].userID AND [User].emailAddress IN (SELECT emailAddress FROM BadEmailAddresses) In plain English, I am trying to set the isUnsubscribed fiel...

A WAIT lock without a corresponding GRANT

I'm trying to investigate a performance problem at a client site. I've looked through the blocking data for the site and come up with a couple of SPIDs to investigate over a time period. I've then looked at the data from sys.syslockinfo and found that one of the problem SPIDs has a WAIT on an Intent Exclusive Table lock. I tried to find ...

how to write query to check status is present in list or not?

Declare Status varchar(15) set status = 'Returned','Cancelled','Rejected' I pass parameter 'processing' and 'Completed' I want to find out 'processing' and 'Completed' is presented in Status group or not. if it is presented true true else false. plz help me .... ...

SQL Server 2008 FullText Search Query

Hello, I have added Full Text Search to my sql server 2008 express database and created an index catalog for two columns in a single table. So now, I have to rewrite one of my stored procedures but I have no idea where to begin. The following is my current SP that I need to convert to take advantage of the full text search capability: A...

How to Bulk Insert csv with double quotes around all values?

I am trying to insert a .csv file into SQL Server 2008 R2. The .csv is 300+MB from http://ipinfodb.com/ip_database.php Complete (City), 4.0M records. Here're the top 5 lines, with 1st line = column headers: "ip_start";"country_code";"country_name";"region_code";"region_name";"city";"zipcode";"latitude";"longitude";"metrocode" "0";"RD"...

SQL query for identity key on table

I have the table in SQL Server 2008. It has empId, which is the int of type. It is not identity for now. I want to write the query (so that I can maintain the record of changes in DB) to make this columns as identity column. This table have no data currently. ...

Escaping command parameters passed to xp_cmdshell to dtexec

I am calling an SSIS package remotely using a stored procedure and a call to xp_cmdshell: declare @cmd varchar(5000) set @cmd = '"C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe" /Rep E /Sql Package /SET \Package.Variables[User::ImportFileName].Value;c:\foo.xlsx' print @cmd exec xp_cmdshell @cmd This works fine, ho...

Report Builder 3.0 Limitations

Hi, I am building an application and the client is asking for reports. Normally we would create the reports for them using reporting services. We are wanting to give the client report builder and let them build there own reports. Some of these reports can be complex and I am not 100% sure how far report builder will take us. Before we ...

Associating Dimensions in SQL Server Analysis Services 2008

I have a SSAS project (simplified) with 3 dimensions: Employer, Location, Time, Department. I have applied security on the Employer dimension, so that users can only see the employers that they are associated with. But the requirement mandates that when the users browse Location dimension, they only see Locations associated with the empl...

Sql query for specific date range and date time.

Hi, I need to query all values between specified date range and time range. For example, I want to query all the values from 5:00Pm on 16-Sep-2010 to 9:00AM 21-Sep-2010. Any ideas how the query should be. Thanx in advance. ...