Ask Zou Jian teacher (of course, the rest of the master, welcome) SQL storage procedure

zhaozj2021-02-12  132

The longitudinally transversely, it is variable, finding the information says the following stored procedures:

Declare @s varchar (8000) set @S = '' SELECT @ S = @ S ', [' CAST (YGXZ As Varchar) '] = SUM (Case Ygxz When' ' Cast (YGXZ As Varchar) '' 'Ten 1 End' from xxxbgroup by BM

Exec ('SELECT BM' @ S 'from xxxb group by bm')

But I don't know how to perform the above stored procedure, can you copy the code directly to the VB process (if you can't, right?), Do you have to create a stored procedure in SQL? How to call? Specifically, please explain, grateful!

(I am a newbie, the memory process is unless, more detailed, better.)

转载请注明原文地址:https://www.9cbs.com/read-7089.html

New Post(0)