I have a SQL table that all of a sudden cannot return data unless I include “with (nolock)” on the end, which indicates some kind of lock left on my table. I’ve experimented a bit with dm_tran_locks to identify that there are in fact a number of locks on the table, but how do I […]
The default encoding for an XML type field defined in an SQL Server is UTF-16. I have no trouble inserting into that field with UTF-16 encoded XML streams. But if I tried to insert into the field with UTF-8 encoded XML stream, the insert attempt would receive the error response unable to switch encoding. QUESTION: […]
Can I connect to SQL Server 2008 using PDO and integrated security using the mssql driver? Currently doing something like this to connect normally: $db = new PDO(“mssql:host=host;dbname=db”, “user”, “pass”); This works fine using SQL Server authentication, but it is a pain having to create SQL server logins for loads of databases, so it would […]
Hi I am trying to create a table using inner select statement… for example: CREATE TABLE JmxMonSer AS (SELECT * FROM services WHERE monitoring_enabled = 1); But keep getting error: Incorrect Syntax near keyword ‘AS’, Severity 15 please advice
MySQL has this incredibly useful yet properitary REPLACE INTO SQL Command. Can this easily be emulated in SQL Server 2005? Starting a new Transaction, doing a Select() and then either UPDATE or INSERT and COMMIT is always a little bit of a pain, especially when doing it in the application and therefore always keeping 2 […]
What is the best way to upload a large csv data file into SQL server using C# ? The file contains about 30,000 rows and 25 columns.
I am working on a database that usually uses GUIDs as primary keys. By default SQL Server places a clustered index on primary key columns. I understand that this is a silly idea for GUID columns, and that non-clustered indexes are better. What do you think – should I get rid of all the clustered […]
I have existing records like ID Hospital ID Email Description 1 15 email@example.com Sample Description 2 15 firstname.lastname@example.org Random Text I need to use a WHILE loop to insert rows with Hospital ID changing to a specific value or 32 in this case, while the others(not ID as it is auto generated) remaining constant. It […]
I have an SDF file and I would like to retrieve its schema and query it with some UI. How can I do this? I have no Visual Studio installed on the machine and I would like to install as little software as possible.
I have a Table like this one: |UserId | ContactID | ContactName ————————————— | 12456 | Ax759 | Joe Smith | 12456 | Ax760 | Mary Smith | 12458 | Ax739 | Carl Lewis | 12460 | Ax759 | Chuck Norris | 12460 | Bx759 | Bruce Lee I need to add a constraint to […]