Categories
internet

Microsoft SQL Server Management Studio question window INSERT remark effects factor

Apologies. This is most likely now not the proper Category. Tips to mend this favored.

Environment:

Workstation: 16GB RAM. 500MB SSD

Windows 10 Pro 64-bit

SQLServer 2020 Express Edition Just put in 2 weeks in the past.

Not to be had on workstation although some supporting libraries is also provide, e.g. .NET framework 3.5 && 4.8 for Windows 10:

Visual Studio

C# compiler

and so forth.

Task: Select entered VARCHAR knowledge.

Error/roadblock steps to breed:

Within Microsoft SQL Server Management Studio,

I’ve a easy database “take a look at2020” with 1 desk “eligibleperson” with 6 columns 2 int, 4 nvarchar, and 1 number one/establish key personid.

I hand-type copied from an Excel spreadsheet an INSERT remark:

USE [test2020]

GO

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

INSERT INTO dbo.eligibleperson

Values

820682 , N’ Michael ‘,N’Ok ‘,N’ Alley ‘,N’ Active’, 10003 ,

820686 , N’ David ‘,N’J ‘,N’ Anderson ‘,N’ Active’, 10008 ,

820687 , N’ Lynn ‘,N’C ‘,N’ Anderson ‘,N’ Active’, 10009 ,

820688 , N’ Bob ‘,N’A ‘,N’ Anderson ‘,N’ Active’, 10010 ,

820689 , N’ Will ‘,N’H ‘,N’ Banker ‘,N’ Active’, 10011 ,

820690 , N’ Ranesse ‘,N’T ‘,N’ Barsanti ‘,N’ Active’, 10012 ,

820696 , N’ Carol ‘,N’Reid ‘,N’ Belew ‘,N’ Active’, 10013 ,

820698 , N’ Cathy ‘,N’L ‘,N’ Bertucci ‘,N’ Active’, 10015 ,

820699 , N’ Dennis ‘,N’Ok ‘,N’ Bertucci ‘,N’ Active’, 10020 ,

820701 , N’ Bruce ‘,N’W ‘,N’ Bilgers ‘,N’ Active’, 10030 ,

820709 , N’ Irene ‘,N’M ‘,N’ Boden ‘,N’ Active’, 10036 ,

820717 , N’ Carl ‘,N’E ‘,N’ Brooke ‘,N’ Active’, 10040 ,

820718 , N’ Tom ‘,N’Scott ‘,N’ Streamer ‘,N’ Active ‘, 10050

GO

The information have been effectively inserted:

USE [test2020]

GO

make a selection * from eligibleperson

GO

effects:

personid firstname middlename lastname countrystatus countryid

820682 Michael Ok Alley Active 10003

820686 David J Anderson Active 10008

820687 Lynn C Anderson Active 10009

820688 Bob A Anderson Active 10010

820689 Will H Banker Active 10011

820690 Ranesse T Barsanti Active 10012

820696 Carol Reid Belew Active 10013

820698 Cathy L Bertucci Active 10015

820699 Dennis Ok Bertucci Active 10020

820701 Bruce W Bilgers Active 10030

820709 Irene M Boden Active 10036

820717 Carl E Brooke Active 10040

820718 Tom Scott Streamer Active 10050

Next I question:

SELECT TOP 10 [personid]

,[firstname]

,[countrystatus]

FROM [test2020].[dbo].[eligibleperson] the place countrystatus=’Active’

GO

No effects are returned: 0 rows affected

Why is that this? Hopefully only a easy mistake on my section!

I did realize this question

SELECT TOP 10 [personid]

,[firstname]

,[countrystatus]

,LENpersonid personidlength

,LENfirstname firstnamelength

,LENcountrystatus countrystatuslength

FROM [test2020].[dbo].[eligibleperson]

GO

Returns sudden effects:

personid firstname countrystatus personidlengthfirstnamelength countrystatuslength

820682 Michael Active 6 9 8

820686 David Active 6 7 8

820687 Lynn Active 6 6 8

820688 Bob Active 6 5 8

820689 Will Active 6 6 8

820690 Ranesse Active 6 9 8

820696 Carol Active 6 7 8

820698 Cathy Active 6 7 8

820699 Dennis Active 6 8 8

820701 Bruce Active 6 7 8

Notice

personidlength is what I be expecting, 6

firstnamelength is at all times longer than I’d be expecting by way of 2

countrystatuslength is at all times longer than I’d be expecting by way of 2

Is {that a} clue?

TIA

🙂