.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Using equal operator in transact-SQL for ntext datatype column

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
 
Hi, I've a problem with using equal operator in transact-SQL for ntext datatype column. (SQL Server 2000) I'm using the following SQL command text. use NorthwindSelect * from Categorieswhere Description ='Seaweed and fish' If I use 'like' operator intead of '=' then the qurey retuns correct value. Any idea about this? Any help is appreciated. Regards, Julia


View Complete Post


More Related Resource Links

Bug: Does not change column type from nvarchar to ntext

  

Scenario: If you create a table with a column of type nvarchar, populate it with some content and try to modify it using the WebMatrix editor, from nvarchar to ntext, it does not display any error message or warning that this is not possible. It silently saves and reverts the change, back to nvarchar. Wasted some hours on this issue as I thought my column was ntext, but in fact was still nvarchar.

Expected behavior: It should change to ntext, or if SQL CE doesn't support that, it should notify the user that no change was applied.


What can be the datatype for a column having records as weblinks?

  
Hi, i am trying to insert records in a column having records as weblinks but it gives me following error. --------------------- Msg 128, Level 15, State 1, Line 2 The name "www.yahoo.com" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted. -------------------------------- NOTE : i have tried nvarchar(2083) but still giving me the same error. but if i try insert something like http://yahoo.com i get ERROR : incorrect syntax near 'http:'-   

how to get datatype a column in sqlserver ?

  
hi all I want have datatype a field in sqlserver how to get it with (T-sql) thank you

Not Equal To Operator (<>) Behavior

  
Can someone explain this behavior with the <> operator when used along with a variable as opposed to a hard coded value. I'm totally confused (: Thanks for the help! -- Scenario 1: Value 3 is hard coded if object_id ('tempdb..#t') is not null drop table #t GO SET ANSI_NULLS OFF GO create table #t (c1 int null) insert into #t select 3 insert into #t select NULL SELECT * FROM #t WHERE c1 <> 3 -- 0 rows returned ---------------------------------------------------------------- ---------------------------------------------------------------- -- Scenario 2: Value 3 assigned to variable @a and used if object_id ('tempdb..#t') is not null drop table #t GO SET ANSI_NULLS OFF GO create table #t (c1 int null) insert into #t select 3 insert into #t select NULL declare @a int = 3 SELECT * FROM #t WHERE c1 <> @a -- 1 row returned with NULL value.. Why..?? ---------------------------------------------------------------- ---------------------------------------------------------------- -- NOTE: Both the queries ve the ANSI_NULLS OFF  

how to retrieve various date format from datetime datatype column

  

first table

Area_code (varchar)    Loan_date (datetime)

USA                             9/21/2009  12:00:00 AM

CAN                            10/22/2010  12:00:00 AM

ARG                            12/23/2009 12:00:00 AM

Second table

Area_code (varchar)    Date_format(varchar)

USA                             dd/mm/yy

CAN                             yy.d.m

ARG                            yy'?'d'?'m'?'

I want to add Loan_date column in second t

how to retrieve various date format from datetime datatype column

  

first table

Area_code (varchar)    Loan_date (datetime)

USA                             9/21/2009  12:00:00 AM

CAN                            10/22/2010  12:00:00 AM

ARG                            12/23/2009 12:00:00 AM

Second table

Area_code (varchar)    Date_format(varchar)

USA                             dd/mm/yy

CAN                             yy.d.m

ARG                            yy'?'d'?'m'?'

I want to add Loan_date column in second table and nee

Using ntext column i a table with many many rows?

  

I want to know more about implications of adding a ntext column to an already existing table with 10000+ rows. My estimate is that only 1 out of 100 rows will haveanything stored in the ntext field. Does this mean that space required is counted for every row this table contains? Not only for those rows that have data in this field?

Shall I instead constuct a sub table storing the ntext column with a relation id pointer to the specific row in the mother tale to save space?


Kontorshotell


get database column datatype from metadata

  

Is there a way to get the database column DataType length information given a table's EntityType by sql query?

 

Example like: varchar(MAX), nvarchar(255),decimal(16, 4) .....

 

I need that query for documentation purpose.


Meng Chew

A tidy and efficient way of excluding rows with the same column value or equal to null

  

Good morning

I frequently use the pivot statement to generate columns I wish to compare, often looking for differences between the values in the columns. Quite often the pivot returns some null values which I am having some difficulty in comparing.

 

Rownum              Col1       col2        col3    col4  etc

1                              A             A             A     &

ODBC API to retrieve User-Defined DataType of a Column in a ResultSet ?

  

Hi,

ODBC APIs such as SQLDescribeCol(), SQLColAttribute() could be used to retrieve SQLDataType of a particular column in a ResultSet.

Similarly, Is there any ODBC API which could be used to retrieve User-Defined DataType of a particular column in a ResultSet?

-Vengatesh

 


Cannot insert NULL into a ntext type column ? Using SQL CE product version 3.5.8080.0

  

CREATE TABLE People ( 
      personID    
int          not null 
   
, name         nvarchar(50)  not null 
   
, addrLine1    nvarchar(50) null 
   
, addrLine2    nvarchar(50) null 
   
, suburb       nvarchar(30)

Declaring a foreign key to a column of 'formula' datatype

  
I have a primary key declared as 'Computed'. Trying to relate a foreign key to this column in the Database Diagram, it complains on data types being different. Declaring the Foreign key as nvarchar or varchar did not help. When declaring it as 'Computed', column was not available for selection as a foreign key. Any advice?
Baruch Barness

To Update a Binary datatype column using a query from MSAccess:

  

Hi,

I have MSAccess as front-end application and SQL Server as the database. I need to update a column of varbinary datatype using the MSAccess application.

The below is the code snippet i work on:

===============================================================================================

If StrComp(Nz(rsDst!destination_column, ""), Nz(rsSrc!source_column, ""), vbBinaryCompare) <> 0 Then
     
      strSQL = "UPDATE tablename SET " & _
                   "destination_column = '" & Nz(rsSrc!source_column, "") & "'" & _
                   "WHERE case_party.file_id= " & rsSrc!file_id & " " & _
      DoCmd.SetWarnings True
      DoCmd.RunSQL strSQL
      DoCmd.SetWarnings True
End If     

==============================================================================

I am getting an error with the above code. The error mentioned is synta

Transact-SQL Built-In Stored Procedures

  
To assist you with managing Microsoft SQL Server databases, Transact-SQL provides many built-in stored procedures.

Renaming an Object

Sending Email

Tooltip for GridView Column Headers (ASP.Net)

  
I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don't want to use javascript and wanted to use simple 'title' attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here's the code and logic behind it.

Multiple Column Dropdownlist for the ASP.NET DataGrid

  
Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

DECLARE CURSOR in Transact-SQL

  
Defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query used to build the result set on which the cursor operates. DECLARE CURSOR accepts both a syntax based on the ISO standard and a syntax using a set of Transact-SQL extensions.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend