Skip to content

Tag: sql-server

Is there any function in C# like isnull in SQL?

In SQL server we can use “isnull” function for example if Table1 Contains Field1 and only one record which Field1 is null we can write this Query: which returns “0”. can we use any function like this in C#? for Example Consider textBox1 is Empty. and I want to Show “0”. Ans…

MS SQL Server – How to create a view from a CTE?

The here above SQL is outputing like a charm all hours between two dates and a field retrieved from a join with another table: I would like to create a view from that but I do not manage to do it. I tried several things but without success. The following is returning : Incorrect syntax near the keyword &#8216…

Text Qualifier syntax in PDW dwloader

I am using dwloader utility to load data into PDW. My dwloader syntax is given below: I got the data loaded into the table. But all the varchar columns have data within double ‘quotes’. My text file is commma delimited. Any idea on how to include the text qualifier in the above syntax? Answer I fi…

Escape single quote in sql query c#

Here I have this method in my CandidateOp class file. I’m passing the ComboBox text in the form and I am getting the ID to the integer type variable tempPrID. The partyIDtoInsert, is a stored procedure I have created and it is being called in the method getpartyID as shown before, to get the id of unite…

Creating EVENTS in SQL Server

I want to execute a query at a specific time. In MySQL we use events for that, example is as follows: CREATE EVENT myevent ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO UPDATE …