Friday, August 2, 2013

[SQL Server] nvarchar(max) or nvarchar(1000)?

[SQL Server] nvarchar(max) or nvarchar(1000)?


nvarchar(max) or nvarchar(1000)?

Posted: 02 Aug 2013 08:56 AM PDT

Hi,I have a concatenated field that is usually about 80 characters but sometimes has been up to 600 characters. It could conceivably be longer than that. How should I define that field in my table? Nvarchar(max)? Nvarchar(1000)? If I define it as 1000 will that make performance better or worse than max? And if I then try to insert into it with something more than 1000 characters then what will happen? The update attempt would simply error?I have another table with the same situation except the field is usually about 10 characters and I've observed it as long as 9,033 characters. Is nvarchar(max) basically the only way to address that one?Thanks!Tai

Why does this not retrn a value?

Posted: 02 Aug 2013 11:46 AM PDT

I'm trying to use count to figure the percentage of the total number in a column.DECLARE @total_count AS intSET @total_count =(SELECT COUNT (*) COD FROM [dbo].[1870_1880_DAT])DECLARE @cuase_count AS intSET @cuase_count =(SELECT COUNT(*) CODFROM [dbo].[1870_1880_DAT]WHERE [COD] = 'Pneumonia')SELECT @cuase_count/@total_count As [Percent]

Starting point of a Join

Posted: 02 Aug 2013 07:18 AM PDT

What do you mean by a staring point of a Join?I am creating a join with some tables and I have been asked table A to be starting point for all other joins.Now what does that mean?

No comments:

Post a Comment

Search This Blog