How to save a database in SQL format

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Is there a way to save database in SQL format to take a look how it looks inside SQL tables? Or maybe there is an utility to convert .dt file into .sql?

 
#2
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

Hello Peter,

your question is not very clear...

Do you want to see how 1C data is stored in SQL tables? You can always do this in SQL Management Studio (please see the screenshot).

But it makes little practical sense

 
#3
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

You can use SQL Management Studio if you already have your 1C:Enterprise data in SQL format. My question was how to get my 1C:Enterprise database in SQL format without having 1C:Enterprise Server? My database now in file format.

 
#4
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

Hey Peter,

I understand your question now!

Unfortunately, if we want to take advantage of the SQL database when working with 1C, we need to use 1C:Enterprise Server.

1C:Enterprise Server accepts requests from the 1C thin client and redirects these requests to the SQL database.

 
#5
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

If it's impossible could you post here how content of SQL tables for catalogues and documents looks like?

 
#6
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

yes, sure,

the first screenshot is a table of one catalog, the second screenshot is a document table.

As you can see, we can look at the data, but it will be very difficult to work with them directly.

Moreover, 1C does not recommend working with SQL tables directly!

Could you tell me what your task is? Maybe I can suggest some other solution

Download scr_1.png (84.95 KB)
Download scr_2.png (78.35 KB)
 
#7
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

If I decide to crypt all text fields of catalogues and documents will this be a serious overhead for the system?

 
#8
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

How do you want to encrypt the fields?

 
#9
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

CryptoManager.Encrypt(...)

 
#10
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

Hello Peter,

if you encrypt absolutely all fields in Catalogues and Documents, then this may lead to a slowdown in the system, you are right.

You will also need to perform the reverse operation - decryption - to show the necessary data to the right users... This will also take CPU time....

Maybe in your case you can do just setting up the rights? If you configure the data access rights correctly, it will be very difficult or even impossible for an outsider to read the data.

 
#11
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Normally this is done by concatenating all object's text fields separated by some separator character and then encrypting this long string in one operation and storing the result in one additional field. And all these text fields are replaced by hash of their content. Shouldn't take too much time. In Java Spring Boot such operation - quite OK, doesn't create too noticeable delay.

 
#12
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

Could you try to do this and then share your experience please. I think many developers will be interested in this.

 
#13
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Of course, when I get there.

 
#14
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Jan 17, 2023
Company: Techatom Pvt Ltd

Hello this is Gulshan Negi
Well, yes it is possible means a custom script or utility is required for converting.dt files to.sql files. The process involves understanding the structure of the .dt files, determining the appropriate SQL commands, and parsing the data to generate SQL INSERT statements.  
Thanks

 
#15
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Anybody tried Onec_dtools? The author claims that he can get any information from .1cd file.

 
#16
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Quote
Could you try to do this and then share your experience please. I think many developers will be interested in this.

Alex, I tried to encrypt and decrypt quite substantial document with JWT: https://github.com/pintov/1c-jwt. Works quite brisk. Time spent for encryption and decryption of all document header attributes and all table section attributes took less than 1 sec. It's a symmetric encryption which should be enough for a decent information security. Quite good, I think. Shouldn't create a serious overhead for the whole system.

 
#17
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

Wow! It looks great!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.