sql-server

Need help with a query (using joins)

I have a three tables: Checkbook table holds what I need to get Receipts table holds a link to a owner table Owner table knows what checkbook it is linked to I need to get the checkbooks only when there are rows in the receipts that are linked to it (through the Owner table). I don't know exactly how to do this, and it kinda seems ci...

How do I manage identities with ETL?

I need help figuring out a workflow and I'm not sure how to go about it... Let's say I'm transforming (ETL?) data from Table A to Table B. Table A has a composite primary key A.a+A.b+A.c, while Table B has just an automatically populated identity column. How can I map the composite keys from A back to the identities created when insertin...

SQL Server 2005 Memory Pressure and tempdb writes problem

We are having some issues with our production SQL Server. Server: Dual Quad Core Xeon 8 GB RAM Single RAID 10 Array Windows 2003 Server 64-bit SQL Server 2005 Standard 64-Bit There is about 250MB of free RAM on the machine right now. SQL Server has around 6GB of RAM, and our monitoring software says that only half of the SQL Server al...

Cannot access property spatialindextype

I'm using SQL Server 2008, and I go to try and script one of my tables, I get the error "Cannot access property SpatialIndexType This is not available in Sql Server 2005". Trouble is, I'm using 2008. I have no idea what this means. I just want to script the table so I can create it in a dev database without having to add all the column...

How to create a unique constraint just on the date part of a datetime?

I'm writing a very simple blog engine for own use (since every blog engine I encountered is too complex). I want to be able to uniquely identify each post by its URL which is something like /2009/03/05/my-blog-post-slug. To accomplish it in the data tier, I want to create a compound unique constraint on (Date, Slug) where Date is only th...

What is PAGEIOLATCH_SH wait type in SQL Server?

I have a query that is taking a long time in the middle of a transaction. When I get the wait_type of the process it is PAGEIOLATCH_SH. What does this wait type mean and how can this be resolved? ...

Visual Basic Login Form Query

Private Sub cmdOK_Click() Adodc1.Recordset.MoveFirst Do While Not Adodc1.Recordset.EOF If Adodc1.Recordset.Fields(0) <> txtuser.Text Or Adodc1.Recordset.Fields(1) <> txtPassword.Text Then MsgBox "Please verify login details", vbInformation + vbOKOnly, "Login Denied" txtuser.SetFocus txtuse...

Cannot add server to Visual Studio Server Explorer

I am unable to add a remote server to the Visual Studio Server Explorer for my ASP.Net website which has been running for about 9 months. I have added a connection to the database that is working well. The error message leads me to think I may not have the path entered correctly. I have tried a number of combinations, including usin...

Best cross-platform/SQL GUI?

I use SQL Server 2005, MySql, and Posgresql regularly. I'm tired of using Microsoft's SQL tool for SQL Server, phpMyAdmin for MySql, and pgAdmin for Postgres. Is there a decent cross-platform GUI that I can use for all of these database servers? I don't care about the actual database administration part, I realize that each vendor's to...

How to enable Full Text Search in sql 2008

Hi, When I downloaded Sql 2008 express I did not think I would need to use Full Text Search. Now I would like to use the NorthWorks sample database but cannot install it without Full Text Search. Is there a way to install this without reinstalling Sql 2008 express? ...

User-Defined Aggregate in SQL Server 2008 - How to deploy with MaxByteSize = -1?

I read here (and elsewhere) that it's possible, in SQL Server 2008, to build a user-defined aggregate which can return a string longer than 8000 characters. This is exactly what I need. Supposedly, the method is to set maxByteSize to -1 instead of a number btw 1 and 8000; this should allow any size up to 2GB. For some reason, apparent...

SQL scripts act on master database instead of practice database

I wrote some sql scripts to create a database and store data. I just noticed that the new tables and data are going to the master database. I found that I can address the correct database if I scope out the database as so: CREATE TABLE Practice1.dbo.Experiments ( ID int IDENTITY (100,1) PRIMARY KEY, CompanyName nvarchar ...

'None' or 'Not Used' foreign key when using GUIDs as primary key

We are building an application that may need to be replicated to many servers (I'm hoping not, but there's no way to know if clients will need their own client/server copy until after we release the online product). Since the number of servers is unknown, I've decided to use GUIDs for any transactional table IDs. Since each client ha...

Can SQL Express Reporting Services generate Word documents from RDL

I know I can generate PDF reports with SQL Reporting Service (even SQL Express can do this) and I can do Word documents with SQL Developer edition. Since my dev box is SQL Developer and my website uses SQL Express (I know, it's far from ideal) I would like to know if the reporting service that is included with SQL Express can generate Wo...

Remove SSN (Social Security Number) from a String in SQL.

I have a string in a MS 2000 SQL db and need to remove just the SSN using the select satement. I don't have the option of using an external app. The other fun part is that the locaton of the SSN is not always the same. [B-Day][First Name][SSN][POB] 12121970John123-45-6789Las Vages Or [B-Day][First Name][Last Name][SSN][POB] 12121970J...

SQL Server recovery and bulk recovery mode confusions

Hello everyone, I have 2 confusions about SQL Server recovery and bulk recovery mode. whether recovery process itself will generate transaction log (here what I mean the logs are the logs generated by recovery process -- if any, and not generated by normal database DML/DDL operations)? Why? in the bulk recovery mode, whether the under...

How to integrate SQL Server Express with VS C# Express

I have just installed VS C# Express 2008 which includes SQL Server Express 2008. It all went ok and I can see VS C# and SQL Server in the list of installed products. When I start VS C# it looks fine but in the DB Explorer / Data Connection context menu the option 'Create new SQL Server Database' is disabled. I have uninstalled all VS p...

search HTML stored as binary image in SQl2000/2005 (without fulltext)

I am building a simple search tool to search through 'n' articles of html content. I have tried the fulltext search option and all was well until we went live and I have had a load of trouble with the webhost getting stuff sorted properly. So I might have to move to a host that does not have SQL fulltext support. All of the articles ar...

sql server 2008 express/enterprise

i'm logged with windows authentification and create an entry/user in the login table... the new testuser has a sql-server authentification, but if a try to login local or remote, only fault 18456... is there any trick... this should be so simple as explained... but should work?! ideas?! ...

Practical limit to number of SQL Server logins?

Working with an application that needs to provide row and column level security for user reports. The logic for the row filtering an column masking is in place, but there are still decisions to be made about identifying users at report execution time. The application uses a single SQL Server login to authenticate, as all rights are data...