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?

More than 1 year has passed since last update.

LaravelでSQL Server(Azure SQL Database)のシーケンスを取得

Posted at

ググっても見つからなかったのでメモ。
こんな感じで取れました。

$sql = "
DECLARE @next_val BIGINT = NEXT VALUE FOR sequence_test;
SELECT @next_val AS next_val;
";
$test = DB::connection('sqlsrv_test')->select($sql);

echo $test[0]->next_val;

もっといいやり方があれば更新します。

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?