sql-server

MS Access 97 application working directly with MS SQL Server 2005

Please, give me the most serious arguments against this. Application directly opens a connection to ms sql server, directly executes queries. So what I'd like to ask: 1) Why it is wrong when the number of users can be up to 1000 executing huge queries? 2) What serious problems can that cause? 3) What should I do?:) Arguments, the mos...

Calculate hours difference in datetime

I have a series of datetime values. I want to select records with a difference of 2 or more hours between them. 2010-02-11 08:55:00.000 2010-02-11 10:45:00.000 2010-02-11 10:55:00.000 2010-02-11 12:55:00.000 2010-02-11 14:52:00.000 2010-02-11 16:55:00.000 2010-02-11 17:55:00.000 2010-02-11 23:55:00.000 2010-02-12 00:55:00.000 2010-02-1...

How to format TSQL SELECT output in SQL Sever

How to loop through a select statement results to have a formatted text? for example the select is like: select name from table and we want a variable @names like this: "name1,name2,name3" Database is SQL Server 2005 ...

How to increase my Web Application's Performance??

I have a ASP.NET web application (.NET 2008) using MS SQL server 2005, I want to increase the performance of the web site, If anyone have an article contains steps to do that, step by step , In SQL(Indexes, ..... etc.) and in the code. Thanks in advance Best Regards ...

SaaS Multi-tenancy Applications: How is data import/export/backup being implemented?

How are applications providing import / export (or backups) of data in SaaS based multi-tenancy applications, particularly single database designs? Imports: Keeping things simple I think basic imports are useful, ie CSV to a spec (or a way of providing a mapping between CSV columns and fields in the database. Exports: In single datab...

SQL Server Database query help

Hi, I have a Database (SQL Server) with table named 'ProcessData' and columns named 'Process_Name' (Data Type: nvarchar(50)), 'Start_At' (DataType: DateTime) and 'End_At' (Data Type: DateTime). I need to know for each 'Time-Interval' (let's say 1 second) how many processes (Process_Name = PN) was open (after or equal to the 'Start_...

Monitoring Log Shipped Databases

I need a consistent way to monitor databases that are read-only log shipped copies of production databases. In the past I have relied on the following methods: Set the job that restores logs to the database kick off another job as its last step. Set the job that restores logs to the database to insert a record in a control table as it...

I need someone to explain this ASP function to me

Hello! I've got an ASP document that 5 years old. Actually I'm working with PHP but I must use ASP for a Windows Application. So I need someone to explain this function to me. //DNS SETTINGS ARE INCLUDED ALREADY. function Check_Is_Web_Locked() dim cmdDB , Ret OpenDatabase Set cmdDB = Server.CreateObject("ADODB.Command") ...

Is sql server's openXML bulk insert faster than bcp or is it more convient to use only?

Is sql server's openXML bulk insert faster than bcp or is it more convient to use only? ...

Can someone explain me the parameter RETURN_VALUE ?

Hello. I want to know what does RETURN_VALUE mean! I'm stuck at this thing. How to use RETURN_VALUE in a SQL Server stored procedure? thanks.. ASP: Set cmdDB = Server.CreateObject("ADODB.Command") With cmdDB .ActiveConnection = ADOConM .CommandText = "usp_jaljava_member_select" .CommandType = adCmdStoredProc .Parameters.App...

How to add an additional column in a table by comparing the values in a different column

I have a table with the following records id name city 1 aaa NY 2 bbb NY 3 ccc LA 4 ddd LA 5 eee NY I want the table with an additional column by comparing the 'city' column. The values in the col4 should have '1' for every unique value in 'city' column and '0' for the repeating values in 'city' column. id ...

Data Quality Check - SQL Server

I am trying to find a good mechanism where I can check whether the data being entered by a group of people is grammatically correct, has correct spellings, etc, etc. I also would like to compute words per minute and accuracy. Is there any process to do this so that I do not have to re-invent the wheel? Thanks in advance. ...

Knowing the type of the stored proc when invoking from C#

I am making a windows service to be able to run operations on a sql server database (insert, edit, etc) and invoke Stored Procs. However, is there a way for me to know the type of the SP? When invoking from C#, I need to knof if it is returning 1 value, or more, or none (so I can use executereader, scalar, etc)? Thanks ...

SQL Server Full Text Search Leading Wildcard

After taking a look at this SO question and doing my own research, it appears that you cannot have a leading wildcard while using full text search. So in the most simple example, if I have a Table with 1 column like below: TABLE1 coin coinage undercoin select COLUMN1 from TABLE1 where COLUMN1 LIKE '%coin%' Would get me the results I ...

What can be a cookie? How to set with OUTPUT? RETURNVALUE?

hello. i think i got some problems with setting a cookie data. for this code: Set cmdDB = Server.CreateObject("ADODB.Command") With cmdDB .ActiveConnection = ADOConM .CommandText = "usp_jaljava_member_select" .CommandType = adCmdStoredProc .Parameters.Append .CreateParamete...

what's a good way to synchronize a sql server 2008 database from a 2005 database automatically?

Ok, the scenario is... two servers, on completely different parts of the internet. The sql 2008 database just needs to get data updates and schema changes. It doesn't need to send anything to the 2005 database. Basically just suck data and schema as efficiently as possible automatically as a scheduled task. The database is quite huge...

How to get Master and Slave Table data in one row using SQL Server ?

I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has a FK from 'Employee'. Each row in 'Employee' can have zero or many rows in 'EmployeeTypes' and I want to make an SQL Query that returns data of all Employees and each employee row should contain its related data in 'EmployeeTypes' (for example co...

Could anyone help me with the script for this

have a table like this empid questionid options 1 1 A 2 1 A 3 1 B 4 1 C now i need result like this questionid responseA responseB responseC 1 50% 25% 25% ...

Infopath Attachment Field; Submit in SQL Server

Hi all, Is there a way to get the attachment from the form to an SQL Server column using VBA? There are some examples about encodind and decoding attachments, though is this the case? Does SQL server support attachments somehow? Thanks in advance, Sun ...

Searching a table in several databases

How can I figure out a table (say tbl_mytable) lies in which database? ...