sql-server

MySQL has no transaction support?

Hello everyone, I heard MySQL has no transaction support at all? Is that true? If yes, how could people write reliable code to make sure data consistency and reliable compared to other commercial database (e.g. Oracle/SQL Server)? thanks in advance, George ...

choose MySQL or choose SQL Server Express (free)?

Hello everyone, I need to develop a mid-sized Inernet facing web site (e.g. less than 1000 users) for information sharing and simple workflow. Since limitation of budget, I am choosing free database. And since the developers are familiar with .Net, C#/ASP.Net is the choosen programming language. I am using Windows Server 2008 x64 editio...

How to insert binary data into sql server using SSMS

Is there a way to insert binary data into sql server directly from SQL Server management studio? ...

Check SQL Database offline

I am trying to check the integrity of MSSQL database when microsoft SQLServer itself not running (or) is not installed . Means i have mdf and ldf files of one database how can i check integrity( like DBCC CHECKDB when database is online on sqlserver). Thanks in advance ...

How to insert content of large xml file into tables in sql server 2005?

Hi all, I need to insert the content of an xml file of size 350 Mb into tables in sql server 2005. How to insert? I have tried to use bulk insert but got out of memory exception. Please help. ...

SQL Statement from DML Trigger

How can i know which sql statement fired through trigger for select, insert, update and delete on table? Thanks, Paresh Prajapati http:\paresh-sqldba.blogspot.com ...

Redirecting Database Queries to another Server

I have to move a production SQL Server database onto another server soon, and I'm keen to catch any little programs which have been written by hard coding the server name into them. I have only recently inherited the system, and there seem to be a lot of Excel files scattered around connecting in using ODBC connections. My initial thoug...

Help needed in getting total resource count (SQL Server 2005)

I have a requirement. I have been given the following table DownLineid UplineId Name DirectResources 1 2 Sarvesh 7 2 NULL Admin 5 3 2 Lonesh 10 4 2 Swapna 2 5 2 Priyanka 12 8 2 Sumi 1 6 ...

The quickest way to find the ForeignKey is related to what table in Management Studio?

Hi, I wonder if there is a quicker way for this: *"I have my Management Studio open and I have a Db table with manes of columns listed in front of me. I know FK_SomeTable field is a ForeignKey. But I do not know it is an FK on what table. And I need to learn that."* So, normally I open the "Relationships" of that table, go one by one...

SQL Server Management Studio: Increase number of characters displayed in result set

Hello! I have the following scenario: We have stored procedures which compare our developement database to our customer databases and tell us, what the difference is (so, what we have to update on the customer machine). Now I wrote some additional code to automatically generate the CREATE/ALTER/DROP statements needed to bring the custo...

delphi using SQL Server with WMI

Hi, I need to determine the sql server instances (local) as part on an installer. Does anyone have any code how I can do this with WMI and Delphi? JD. ...

When to try and tune the SQL or just summarize data in a table?

I have an EMPLOYEE table in a SQL Server 2008 database which stores information for employees (~80,000+) many times for each year. For instance, there could by 10 different instances of each employees data for different years. I'm reporting on this data via a web app, and wanted to report mostly with queries directly against the EMPLOY...

Query regarding SQL Insert in SQL Server?

I am using SQL Server 2008 and developing a project which is in maintenance phase. I want to insert record in a table whose primary key is an Integer but not an identity. e.g. table name is tblFiles and fields are ID, FileName, FileContent. Actually that table is in use so I don’t want to make any schema change in it. And I want the ...

Determining sql command type in the trigger in sql server 2000

Is there more recomended way of determining command type in the trigger then testing DELETED and INSERTED tables? Currently i'm using approch: (EXISTS (select 1 from INSERTED) AND NOT EXISTS (select 1 from DELETED)) = INSERT (EXISTS (select 1 from INSERTED) AND EXISTS (select 1 from DELETED)) = UPDATE (NOT EXISTS (select 1 from INSERT...

SQL server Query help

I am passing a list of zipcodes to a stored proc (say 11111, 11112, 11113, 11114, 11115) and the zip code table contains only few rows (say 11111, 11112, 11113) and now I want to write a query which returns the zip codes that are not exists in the table (11114 and 11115) Could anyone please help me to write a query like this? Thanks in...

WIX installer with delphi custom actions

Hi, We are writing custom actions using Delphi and wanted to know if there would be any issues with the following or whether one way would be better than the other. Using WMI to determine if SQL server is installed and getting the SQL server instance names. If there is an issue with WMI (exception raised), then use SQLDMO. Using WMI t...

Ok to rely on SQL Server tuning advisor for generating Indexes?

I've been having it analyze my queries and pushing the recommendations for some time now. Are there any potential pitfalls with doing this? Would I be better of creating my own indexes by hand? ...

How can I finding the index of a record with SQL or Stored Procedure?

Using SQL Server 2008, but could relate to other databases as well probably. If I had the following data (table t): id text date 1 Data1 2/1/2009 2 Data2 2/2/2009 3 Data3 2/3/2009 4 Data4 2/4/2009 5 Data5 2/5/2009 How could I find the index of a certain record? indexOf(select id from t where id = 1) = 0 or indexOf(select id from...

SQL Server: Code page translations are not supported for the text data type.

When inserting text into a TEXT column in SQL Server using ADO, i get the error: Code page translations are not supported for the text data type. From: 1257 To: 1252. Now it is true that i've changed my Windows code page to 1257 (Estonian). My question is: How does SQL Server know what code page i'm running in? All strings sent t...

Creating a database remotely using C#

I'm trying to create a database by remote connecting to a SQL Server Express using Visual Studio 2008. I log onto SQL Server using SQL Authentication. I can do that remotely using SQL Server Management Studio Express no problem by using the following command: CREATE DATABASE dbname ON (NAME='dbname_dat', FILENAME='C:\folder\dbn...