sql-server

SQL statement - update on two tables

Hello - I am a newbie to SQL. please help with this. I have the below SQL which updates a table for company ticker = SUN from another table that has many records for ticker 'SUN' and I need to use only one record matching 'Float' the below works if I state 'SUN', however, I want to do this for 4000+ ticker symbols. How do I do it? UPD...

SQL Server 2005 DBA Learning Resource

So I have some experience with Microsoft Access, building database apps for people, vba, etc for different folks at work....different divisions. And I have actually learned a lot in that realm...however, now the need for SQL Server has arrived, and I have never really ventured into that realm...so let the questions begin: how vastly di...

Error in Declaration of cursor

set @SQL=N' select @minTableId = MIN(id) from ' + @AcDB + '.dbo.vTblOfRollNo ' Declare Cursor For EXEC SP_EXECUTESQL @SQL if i have declared all the variables in above query but Declaration of cursor in above query shows ERROR. What is Solution? ...

php using wamp server start up error

i try to install moodle web software...i m using wamp server and sqlserver 2005 version. i install php driver for php5.3.0 thread safe version..i just paste that php_sqlsrv_ts.dll driver file into my php ext directory...i include this line extension=php_sqlsrv_ts.dll in my php.ini file... now i restart my wampserver...i m getting this er...

SQL Server - something available to practice dev for beginner

So this might be a ridiculous question, but I don't know so that is why I am asking: I would like to practice some C#, and get some basic familiarity with the IDE for SQL Server. Is there some fake version of SQL server that I can download to practive with?? thanks! ...

SQL Query Help needed

Hi What I want is selecting the univirsities where student satisfy major high school type ,min gpa, min general tests scores (Qiyas and Tahsiely) and some other subjects (courses) scores. here is the database(SQLSERVER) http://sites.google.com/site/famu79/db.zip I tried this SQL Code SELECT DISTINCT univirsities.uni_id ...

generation of sql queries on tables

(for sql server - in sql server management studio) I am having a few tables in my db with some data in those tables. I want to to transfer that data to my server; on that server I can run SQL queries. How can i generate the SQL to this? ...

How do I find a ASP.NET hosting company that supports SQL Server with CLR enabled?

So I developed a web application in ASP.NET and SQL Server 2008. Part of the SQL code I implemented as a .NET assembly (instead of t-sql) because it is performing intense calculations that are better written in C#. Now I am ready to deploy my application, but I am stuck looking for a hosting company that allows this. Scratch out Discoun...

NHibernate mapping - how to achieve this

Hello! I have been trying for quite a while to work out how to accomplish my mission, and in fact I am not even sure that the direction I am heading in, is indeed a diserable one in terms of my SQL tables - but it is the most concise I have been able to think up on. My problem is fairly simple to describe. I have a table containing com...

performance problem sql server 2005 update sentence

I have a table "OFICIAL3" with 500k rows. and 30 columns. and table INSIS with 150k rows and 20 columns. OFICIAL3.NUMERO_TITULO has an index. INSIS.NumeroDocumento has an index too. update sentence take long time. this process will take 9 hours in my machine my machine is a core 2 duo 2.GHZ and 2GB RAM ALTER PROCEDURE [dbo].[CompletarD...

The max value of several columns (date and cost relationship)

How do you return the max value of several columns (date and cost relationship)? TableName [ID, Date1, Cost1, Date2, Cost2, Date3, Cost3] I need to return something like this: [ID, Most Recent Date, Cost] I need to return something like this: ID Most Recent Date the Cost related to the Date (if the most recent date is Date1 so th...

SQL Server Analysis Services - Do I have it?

Hi I have access to SQL Server at work and I've heard some interesting things that can be done with SQL Server Analysis Services. How do I know whether analysis services is running? Is it installed by default on the server? Would it be installed locally on my machine? Forgive what probably seems like a pretty dumb question, but I couldn'...

incremental backups on SQL Server and mysql

One user has said to me Applying incremental db backups is tedious, and a royal pain if you miss a step. I wouldn't bother with the approach on SQL Server or MySQL - that's what transaction logs are for, so you don't need to incorporate it into your data model So if i have transactions on mysql or sql server i can have ...

Uploading A SQL Server Script??

My over all goal is to upload a very simple ASP.NET web site created in C# and using a SQLEXPRESS DB to a hosting provider via FTP. I understand that I can get all of my ASPX, .CS, master pages and image files with no problem. Problem I am having and reason I am here is because I cant simply pop my MDF file into my hosting provider's (...

Sending messages to two services simultaneously usind Service Brokers

Hi there, could I send messages from one service to multiple service using service brokers? Something like BEGIN DIALOG CONVERSATION @dialog_handle FROM SERVICE [SERVICE1] TO SERVICE 'SERVICE2',**'SERVICE3'** ON CONTRACT [MainContract] Looking at the syntax, I do not think we could do this. What's the alternative? Thanks...

Help modify / optimize database schema / indexes for faster query result when using LIKE and EXISTS clauses

Hello, While implementing a hierarchy / tree structure on a SQL server 2005 database, I'm getting very slow query response ( below queries talking more than 5 sec ) when using LIKE clause combined with the EXISTS clause. The slow queries involve two tables - [SitePath_T] and [UserSiteRight_T] : CREATE TABLE [dbo].[UserSiteRight_T]( ...

SQL backup using SMO .net c# DeviceType.Pipe

I wrote a Program that backup SQL Databases using SMO Library on .net , and everything is just going smoothly, I just have one last point, I'm changing my way to save the .bak file on the hard disk, from DeviceType.File to DeviceType.Pipe, I have used pipes before, I just didn't know how to implement it here . ...

when to use a format file for bulk copy program (bcp)

When would we use a format file for bcp? ...

Updating front-end WPF app from a SQL Server database

Please, help me clear my mind on the following question. Recently I asked a question on SO, about possibility of immediate updating WPF classes from SQL Server DB through LINQ to SQL: http://stackoverflow.com/questions/1991455/how-to-use-propertychangedeventhandler-of-linq-to-sql-class-for-immediate-updatin from the answers I got know...

Setting version column in append only table

We have a table that will store versions of records. The columns are: Id (Guid) VersionNumber (int) Title (nvarchar) Description (nvarchar) etc... Saving an item will insert a new row into the table with the same Id and an incremented VersionNumber. I am not sure how is best to generate the sequential VersionNumber values. My initia...