sql-server

sp_tables call taking more time which causes blocking

Hi, We could see that during our perl program runs which basically connects to SQLserver to insert/delete/update data, the below is called very frequently sp_tables @table_name='NOXXTABLE'. We see that for many SPID's the call happens a lot of times. On running sp_tables @table_name='NOXXTABLE' in SQLserver we can see that it returns n...

Service Broker : Sys.Conversation_endpoints filling up with CO/CONVERSING messages when using With Cleanup

We recently identified a problem with one of our databases where as a result of a 'fire & forget' setup (i.e: conversations being closed immediately after sending), our sys.conversation_endpoints table was filling up with DI/DISCONNECTED_INBOUND messages. This eventually spilled over into the tempDB, causing it to grow enormously and eat...

What database objects (tables, indexes, procs, etc) are added to db with diagraming support?

When you click on "Database Diagrams" in SSMS, it will ask to enable diagramming support, which means that a number of objects will be added to the db. Is there a list of all those objects added to the db? ...

What is the best solution for POS application?

I'm current on POS project. User require this application can work both online and offline which mean they need local database. I decide to use SQL Server replication between each shop and head office. Each shop need to install SQL Server Express and head office already has SQL Server Enterprise Edition. Replication will run every 30 min...

How can I check if the connected SQL Server is on the local machine?

Is there any way of telling, using C#, if the Sql Server I'm connected to in Ado.Net is on the local machine rather than remote? I'm wanting to know whether I have access to the file system where SQL Server stores, for example it's backup files. That would let me determine whether I would be able to delete a backup file programatically...

C# and SQL Server: any reason to put a single INSERT into a transaction?

Using C# and SQL Server, would there be any reason to put a single INSERT statement into a transaction? I am reviewing code written by someone else. I can't understand why a transaction would be needed since there is only one SQL statement. ...

Error using CSV string with IN Operator

When I run the following code declare @aaa nvarchar(10) set @aaa='1,2,3' Select * from Customer where CustomerId in (convert(nvarchar,@aaa,10)) I get this Error Msg 8114, Level 16, State 5, Line 3 Error converting data type nvarchar to bigint. plz help ...

Monitor SQL Server for new row

I'm creating an application that notifies users if a new row has been added to a table in the applications database. Would it be best to create a trigger for this or just check every few seconds directly from the application? Thoughts? ...

MS SQL Connection string for default instance like for named instance

In my .NET application I am connecting to Microsoft SQL Server 2005 or 2008 database. User selects instance which the application shows it and then application should do something with this instance. I take instance names from the registry, HKLM\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL. I do not know if user selects de...

What all are the possible reporting deployment options ?

I have a small application where there are some reports i have done. What i do each time when i have to deploy the reports is as follows, take the solution of the reporting to the sql machine where reporting server is installed open the solution change the data source property and sql reporting server url then say deploy. Is there o...

Is this possible to connect microsoft database from iPhone?

I would like to connect microsoft database via iPhone, is that possible to do so? Is there any third party library required? If not, any suggestions on that?? Thank you. ...

Sequential Guid and fragmentation

I'm trying to understand how sequential guid performs better than a regular guid. Is it because with regular guid, the index use the last byte of the guid to sort? Since it's random it will cause alot of fragmentation and page splits since it will often move data to another page to insert new data? Sequential guid sine it is sequentia...

generate where clause dynamically with dynamic column names

Hi, I have data in the SQL 2005 table as below. Table Name: FilterData CategoryID ColumnID AnswerCode -------------------------------- 0349 Q15 02 0349 Q15 03 0349 Q16 04 Table Name: TransactionData CategoryID Q15 --------------------------------- 0349 01 0349 02 0349 03 0349...

Differentiate between client app and browser in ASMX Web Service?

This is a follow-up to http://stackoverflow.com/questions/3444000/choosing-a-connection-string-based-on-kind-of-request for which I got no answer and what I thought worked doesn't. I have a webservice that needs to choose a specific connection string based on the user calling it from a browser or from a client application. I tried: H...

Full Text Search Exact Match - in binaries

I have a query that is running something like this in SQL Server 2008 Select [key], Rank From ContainsTable(tblDocuments, '"Exact Match"') At the time we decided to use SQL FTS Exact Matching wasn't a requirement; sadly requirements move on and now we are interested in the possibility of getting exact matches too - i am not in a place...

Suitable platform for developing browser based database application (reporting) with SQL Server?

I need to develop a dynamic web page retrieve data from a stored procedure on a SQL Server. Considering the licensing issue, development resources, security and maintainability, can someone suggest a suitable platform for this project? I have a Ubuntu server running Drupal and also a Windows Server 2003 running SQL Server 2000 and IIS ...

SQL can you use IF statement in a UDF and how do you do that?

I am trying to create a UDF that does 2 different things depending on the time. Below is my code. I am wondering if you can use the IF statement in a UDF because I am etting 4 errors, incorrect syntax near Begin and Returns and also a Return Statement with return value cannot be used in this context....Any suggestions? SET ANSI_NULLS ON...

varchar(1) or bit?

Possible Duplicate: NCHAR(1) vs BIT I have a field in the database that currently stores two values: 'Y' and 'N' (yes, no). The field datatype = varchar(1). Would it be better to convert 'Y' to 1 and 'N' to 0 and to use a bit datatype? Is there any benefit to using varchar(1) over bit in this case? ...

VBA Transactions

I'm trying to insert some data into SQL from Excel VBA. The SQL commands are built up over the course of the VBA script, and include the use of some SQL variables. I'm trying to understand how transactions work in VBA, and whether they will work with what I need to do, I have the code below that will test this, but it does not work. It ...

Best practice for securing username/password between clients and server

Howdy, Got an application (C# WPF) that needs to "call home" and get updated stuff from a home server. In theory there could be thousands of client out there, needing to communicate over the public internet. Each user will first register with a username and a password. Then, as the application runs, it will call home every now and then...