sql

What purpose does “using” serve when used the following way

What purpose does “using” serve when used the following way:- ONE EXAMPLE IS THIS, (AN ANSWERER- @richj - USED THIS CODE TO SOLVE A PROBLEM THANKS) private Method(SqlConnection connection) { using (SqlTransaction transaction = connection.BeginTransaction()) { try { // Use the connection here ...

how to retrieve images from database and display in div using java script

Hii, I want to retrieve data from sql database and display dynamically in div using javascript can anyone please help me on this... Thanks... ...

DataContext to DB

Hi all, I have designed my DB using the ORM in VS 2008. What is the best way to export this to an SQL server so it will create the tables and relations on SQL Server? Thanks, JD ...

MySQL - NULL value check and Dynamic SQL inside stored procedure

DROP PROCEDURE IF EXISTS HaveSomeFun; CREATE PROCEDURE HaveSomeFun(user_id CHAR(50),house_id CHAR(50),room_id CHAR(50),fun_text TEXT,video_url CHAR(100)) BEGIN DECLARE query_full TEXT; SET @fields_part = 'INSERT INTO fun(FunKey,UserKey,FunBody,LastModified'; SET @values_part = CONCAT(') VALUES( NewBinKey(), KeyToBin(\"', user_id, '\")...

how can a databse be created on sql server 2005 using c# vs08.

to create new a new databse file start sql server management studio express on db server and create it! i would like to create a database using c# in my web application visual studio 08 is it possible? as connection string has to have a name of database to connect, but i want to create one. ...

How can i learn Table Name in database an column name?

How can i learn table Name in database an how can i learn any Table's Column name? SELECT Col.COLUMN_NAME, Col.DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS AS Col LEFT OUTER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS Usg ON Col.TABLE_NAME = Usg.TABLE_NAME AND Col.COLUMN_NAME = Usg.COLUMN_NAME LEFT OUTER JOIN INFORM...

Update multiple rows in oracle

Hi! Can you tell me how to update multiple rows in oracle as when I fired the update statement it gave me the following error UPDATE BI_BSELATEST_LATESTPRICESTEST SET PREVIOUS_DAY_CLOSE = (SELECT DISTINCT aa.DLYPRICE_CLOSE FROM DATAFEED_EQTY.FEED_DLYPRICE aa , ( SELECT a.sc_code , MAX(a.DLYPRICE_DAT...

how to query the database without accessing the tables, correct the database but not the tables

used is c# sql vs 08 sql server 2005 express whenever and where ever an sql select statement is used, its always like select * from tablename or count statement is alsi like select count something from table name for selecting or doing anything on the tables, i would like to know which tables exits in my the database i am connec...

How do I change this query to linq to sql?

Query: select emp.empname as Name, dep.depname as Department from Employee as emp inner join Department as dep on emp.depid=dep.depid where emp.id='2' How can I change this to linq to sql? ...

Difference between MySQL IS NOT NULL and != ''

Is there any difference between MySQL IF (myText IS NOT NULL) THEN and IF (myText != '') THEN ...

How to set two column unique in SQL.

I am creating a table ,in the table two column is unique, I mean columnA and columnB do not have same value: such as : Table X A B 1 2(RIGHT,unique) 2 2(RIGHT, unique) 1 3(RIGHT, not unique) 2 3(RIGHT, not unique) 1 2 (WRONG, not unique) How to create such a table? many thanks! create table X ( [ID] INTEGER PRIMARY KEY AUTOINCREASE ...

Why Sql not bringing back results unless I set varchar size?

I've got an SQL script that fetches results based on the colour passed to it, but unless I set the size of the variable defined as a varchar to (50) no results are returned. If I use: like ''+@Colour+'%' then it works but I don't really want to use it in case it brings back results I don't need or want. The column FieldValue has a type...

How can i rename my column in sql table?

how can i rename column name via alter table in Ms sql 2005 forexample: alter table tablename rename "old col name" to "new col name" ...

Traditional SQL vs MongoDB/CouchDB for simple python app

Say I got an traditional SQL structure like so: create table tags (id PRIMARY KEY int, tag varchar(100)); create table files (id PRIMARY KEY int, filename varchar(500)); create table tagged_files (tag_id int, file_id int); I add some tags: insert into table tags (tag) values ('places'); insert into table tags (tag) values ('locations...

how to set error message of the independent form in the status bar of the mdi form in c#?

i have one independent form where i am checking read only access of an xml file , if the file is read only then i have to display message in the status bar of MDI form. since i am using independent form to valid xml file, status bar of the MDI form is not displaying the error message. now how to display message? thanx in advance ...

un able to connect my database to visual studio 2008

hey, i`m stuck on it.. plx help.. my database is created on mssql 2008 and have connected on sql server compact edition and not on windows authentication.. can any body please help me out.. ...

Taking backup of data in a table.

Hi All, Is there some way to backup the data in a table in sql server by using sql scripts. Note: I dont want to take the backup of the whole database. And later on restore the same data back in case of any failure. Please suggest some solution. ...

Is there a way to prevent Triggers from being disabled?

I have a trigger on a table that should never be disabled. It performs certain checks and there have been occasions when other developers have disabled it to get around it. This is not good so I want to be able to turn off trigger disablement on this table alone. Is this possible? If not, any suggestions please. thanks. WORKAROUND:...

connection mssql with qt

How can I connect mssql with Qt ? Thank a lot. ...

Write a SQL query to find those values from column A in table X that are NOT present in column B of table Y.

Write a SQL query to find those values from column A in table X that are NOT present in column B of table Y. update: the query is taking too long with not in(more than 5 minutes, i didn't wait for it to complete) The column B in table Y is a primary key. update: im using oracle. The table size is in millions(rows) for both tables. Of ...