return 0 when value is greater than mentioned
i wrote this query to find difference between TOTALREQUIREDHOURS and TOTALWORKDEDHOURS, it works e.g. 192-186:05= 5:55 but problem is if TotalWorkedHours are greater than totalRequiredHours then it...
View ArticleMultiple updates and Identity fields
I have a table used by multiple applications. One column is an Identify field and is also used as a Primary key. What is\are the best practices to use get the identity value returned after an INSERT...
View Articleconverting Datatypes:
Hi All,how do you convert from a date to an int ? as well as converting from Varchar to and Int in SQL server 2000 ? I am retrieving the GetDate() which i store in column as Varchar, i then want to use...
View ArticleMapping table problem
HI guysI need to put multiple coniditions on my table based on some combinations.Here is my main table-PractitionerDHBNamePHONamePracticenamePractitionerNameLocumYCountNCount4Canterbury DHBPartnership...
View ArticleMicrosoft text driver or access CSV file directly
Hi, Every search hit that I found told me that I need the "Microsoft text driver" to access CSV file directly. And here is the sample code within SSMS:select*fromopenrowset('MSDASQL'...
View Articleinsert exec procedure into param
hi i have a procedure called AddTask that insert line into table and SELECT @@IDENTITYis it possible to insert the exec select into field @Idand not only into a tablei tried :DECLARE @Id int EXEC...
View ArticleAutomatically deny access to users after expiry date
Hi All,Is there any feature in SQL Server that automatically revert back all permissions of a user after certain days(Expiry date).My company has a policy that all users permissions should be reverted...
View ArticleSQL Server vs MongoDB?
I have been happily using SQL Server for over 5 years and am convinced of the power of the relational model.However, next week I will be meeting with some folks who are hooked on MongoDB and not in...
View ArticleUsing the SQL Server Agent for the first time
I have set up several jobs to run automatically throughout the day. Each job just does one thing: executes an SSIS package.The packages themselves run perfect when I test them in Visual Studio 2005,...
View ArticleHow do I move a project between machines?
Hi,I'm an SQL Server novice.After developing some websites (VS 2005 VWD), my machine started to crumble. (e.g, SQL Server won't uninstall and lots of other software problems)So I bought a new machine...
View ArticleNeed A Crash Course
My In-Laws run a Fire Safety company that stores data from tests (e.g. Fire Extinguisher Checks, Elevator Reviews, Suppression Systems, etc.) on a database using Microsoft SQL Server 2005. To make a...
View ArticleMigration from MS Access 2003
Hello,I'm very new to MS SQL Server; I just downloaded Express 2005 yesterday. I have it up and running; it seems to be working fine.Now onto business - I need to migrate data from existing MS Access...
View Articlehow to Check data after Insert Trigger
Hi friends,I need to insert data from one database table to another database table by after Insert trigger. NowI need to check whether that another database table already have the data or not. If there...
View ArticleSelect Query statement
Hi to All, Below is a sample mssql query given to me, now I am wondering if can I add a where statement to it? because right now I am trying to add a where clause in it and I'm getting an error. The...
View ArticleDoes SQL Server have a feature simiar to RMAN Duplicate
I have a production server and a test server (SQL Server) I am familiar with backup database and restore database and know that this can be automated. However, I was wondering if SQL Server had any...
View ArticleMicrosoft SQL Server Standard Core 2012
Hi, I want to know whether this (Microsoft SQL Server Standard Core 2012) product can be used on virtual machine. The exact version is "SQLSvrStdCore 2012 SNGL OLP 2Lic NL CoreLic Qlfd "
View ArticleDeploy To Azure Fail
My first attempt at using SQL Management Studio 2012 Deploy to Azure failed with... One or more unsupported elements were found in the schema used as part of a data package. Error SQL71564: The element...
View ArticleBuild datbase from xsd/xml ??
Hello all. I have an .xsd file and a .xml file that goes with it. Are there any tools available that will build a database structure in SQL Server from either of these two files? I can't see the...
View ArticleLicensing question - Mgmt Studio on other server installation?
Hello guysI have a SQL Server 2008 R2 licensed with 4 Core Licenses (4 cpu cores on the virtaul server)When i want to install SQL Server Manamgent Studio 2008 R2 on another server (to connect to the...
View ArticleProblem with Attaching database because of its version
Hello everyone,I have created a database in sql server 2008 yesterday and stored some data into it.And then i have detached that database.Today when i tried to attach the same database into sql server...
View Article