sql-server

What is wrong with my stored procedure?

I need to insert the selected data from tblA to tblB only if data selected does not exist in tblB. I created a button that will execute this stored procedure. I cannot figure out what I am doing wrong in my stored procedure, it is not inserting/showing non existing data into tblB. I am using SQL Server 2008 and ASP.NET. CREATE PROCEDU...

How to configure website guest access?

I finished creating my C#/SQL web application in VS 2008 on an XP Pro OS. It builds and executes successfully. Using the same code, I developed a website in VS 2008. Although this website builds and executes successfully, when I deploy it from my computer, it does not display the data grid. I think this is because the internet user d...

Converting a docx and uploading to sql table.

I have a word document in docx format with data in repeating format pattern. I would like to take each data from the repeating set and upload to a row in the SQL table. Sample of data here: Question No : 1 How is LINQ to SQL different from Entities? A. Answer 1 B. Answer 1 C. Answer 1 D. Answer 1 Answer : D Explanations : Some expl...

Linq to Entities / Entity Framework delete exception

Hey everyone, I'm working on a WPF system which hooks onto an old legacy database using the Entity Framework. We hook onto a backup of the live data when debugging and an empty database to run tests against. I'm receiving the following error only when trying to delete from a backup of the live data. This code: License license = ReadLi...

Faster way to find duplicate SQL query

I have a query to get duplicate data with some extra condition but I feel that it is not fast enough. Any solution to make this query faster? v_listing contains big information SELECT DISTINCT code, name, comm, address, area FROM v_listing t1 WHERE EXISTS (SELECT NULL FROM v_listing t2 WHERE t1.comm = t2...

Deploy SSIS 2008 on top of SQL Server 2005

Hi, I want to deploy SSIS 2008 on top of SQL Server 2005 in production environment. Please advise if any known issues or any special configuration is required for this scenario. ...

Uniqueidentifier PK: Is a SQL Server heap the right choice?

OK. I've read things here and there about SQL Server heaps, but nothing too definitive to really guide me. I am going to try to measure performance, but was hoping for some guidance on what I should be looking into. This is SQL Server 2008 Enterprise. Here are the tables: Jobs JobID (PK, GUID, externally generated) StartDate (datetime...

Mixed mode on but still getting not trusted connection error

I'm trying to make a connection a sql 2000 db. Mixed mode is switched on and i can connect via query analyser to all users needed, however when i try and make a connection use ado it gives me this error: Login failed for user 'username'. Reason: Not associated with a trusted SQL Server connection. I have no idea why this is hap...

Latency between SQL Server 2005 and .NET

This question is an follow-up of an previous asked question. I've written an simple program who looks like this. string s; do { using (SqlConnection conn = new SqlConnection("POOLEDCONN")) { using (SqlCommand cmd = new SqlCommand("", conn)) { s = (string) cmd.ExecuteScalar(); Code2IncrementPerfomanceCounter ...

Would it ever be wise to have a SQL server per web server?

I'm wondering if, under the circumstances that You get lots more reads than writes Your SQL server of choice is cheap/free and offers a fast mirroring/replication service Your database isn't insanely large rather than having separate SQL servers it would be better to have an instance of SQL on each machine getting instant updates fr...

Optimising this query. Relevant for DBA's working on a social network/community type website

I suppose this is quite a common SP present in socialnetworks and community type websites. I have this SP that returns all of a user's friends on their 'friends' page order by those currently online, then alphabetically. It's taking quite a while to load and I am looking to speed it up. I remember reading somewhere on SO that breaking...

What for is IsSchemaBound view's setting in SQL Server?

What is the difference for a view if it is schema bounded or not? ...

Reporting services 2008 on Sql Server 2005

Can I use Reporting Services 2008 with SQL Server 2005 database? Do I need both licenses (for SQL server 2008 and SQL server 2005) Do I need two instances (SQL Server 2008 and Sql server 2005) or can Reporting Services 2008 be "installed" as add on to Sql server 2005? Thanks for answers, Matra ...

weird error using SQL-Server2005 SPROCs from MS Access 2000: ";1" in name --> not found

I have a weird problem here. In short to the environment we have: There is a (newly set up) Win2003 Server with a SQL Server 2005 Express database. I connect to it via a MS Access application. Since I switched to the new server (restored a backup from the former server on it) all SPROCs (only in Access) have a ;1 after their name, he...

T-SQL Output Message During execution in SSMS

I have a simple query which loops and I want to see the PRINT messages during the execution. The query is something like this: WHILE 1 = 1 BEGIN WAITFOR DELAY '000:00:10' PRINT 'here' END The PRINT 'here' does not output until I stop the process, however, I want to see it while its running. Is this possible? ...

Case Sensitive SSIS

In our environments, sometimes the case changes. Id becomes ID and then morphs into id. When this happens, my SSIS packages (sql server 2008) fail because the column name is not the same case as expected. Here is a way to reproduce the problem. In your Dev SQL Server, create the following tables: DROP Table dbo.CartoonCharacters Go Cr...

I just shifted my databases to a sql server 2008 cluster connected to a SAN and its started giving me the following errors.

SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [T:\MSSQL\DATA\%file_name%] in database [%DB_name%] (2). The OS file handle is 0×00000838. The offset of the latest long I/O is: 0×000000ebdc0000 Has anyone encountered and solved this? ...

Optimize help for sql query

We've got some SQL code I'm trying to optimize. In the code is a view that is rather expensive to run. For the sake of this question, let's call it ExpensiveView. On top of the view there is a query that joins the view to itself via a two sub-queries. For example: select v1.varCharCol1, v1.intCol, v2.intCol from ( select someId, va...

SQL Server Varbinary(max): select a subset of bytes from the varbinary field

What is the most efficient way of reading just part of the binary data from a varbinary(MAX) field (not using FileStreams) in SQL Server 2008? When writing data to the column the VarBinary.Write() function is available in T-SQL, allowing bytes to be written to the field incrementally, but there doesn't appear to be a similar function a...

Is it possible to make an Expression Column in a view to show row number?

I have an Id column in this view, but it jumps from 40,000 to 7,000,000. I don't want my crazy stored procedure to loop untill it reaches 7,000,000 so i was wondering if i could create a column that was the row number. It would be an expression of some sort, but I don't know how to make it. Please assist! Thank you in advance. ...