0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SQL Server Express LocalDBを使ってみる

Last updated at Posted at 2025-10-06

はじめに

以前はSQLiteのデータをコマンドラインから操作してみましたが、今回はSQL Server LocalDBの機能を使ってみます。

参考サイト

以下の記事を参考にしました。
https://zenn.dev/kiyokura/articles/7538aafd8ec063

以下のような使い方を想定しています。


>sqllocaldb info
MSSQLLocalDB

>sqllocaldb info MSSQLLocalDB
Name:               MSSQLLocalDB
Version:            15.0.4382.1
Shared name:
Owner:              DESKTOP-YYYYYYY\xxxxx
Auto-create:        Yes
State:              Running
Last start time:    2025/10/06 15:13:32
Instance pipe name: np:\\.\pipe\LOCALDB#2DCB97CD\tsql\query

>sqlcmd -S (LocalDB)\MSSQLLocalDB -e
1> ALTER LOGIN sa WITH PASSWORD = 'Your$trongP@ssw0rd!';
2> ALTER LOGIN sa ENABLE;
3> go

>sqlcmd -S (LocalDB)\MSSQLLocalDB -U sa -P Your$trongP@ssw0rd!
1> create table users (id char(256) not null,email char(256),password char(256),updated datetime,CONSTRAINT PK_USERS PRIMARY KEY(id))
2> go
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?