ah I see, thanks for explaining :) is it a feature you would like me to leave for you to tackle or are you happy for me to give it a go when (if!) I get time? :) I imagine it could be (naughtily) simplified slightly by expecting a CREATE TABLE statement for all files in the tables folder etc. ;) so if I do it, we might not end up with a "complete" sql parser, so to speak :P
enjoy your vacation :)
Anyone is free to take a stab at it. I like you're idea for simplifying it. If we only support parsing scripts in the format generated by SchemaZen.
is it possible to also export the data using schemazen?
yes, check out the --dataTables option.
Here's an example: SchemaZen script -s localhost -b test -d c:\test --dataTables "table1,table2,table3"
I get an exception using schemazen
SQL data type hierarchyid is not supported
is it possible to exclude such a field from the export and fill it with null values?
I already forked and working on this :)
I'd never heard of that data type before. I created an issue for it: sethreno/schemazen#34
That was where I started, afterwards the export worked, but I had another exception during restore. I have to look further into this. Right now I'm even not sure, if the exception is related to the unsupported type
Okay good luck. If you want some help send me create scripts for the objects that fail and I'll take a look.
I wonder what other features were introduced in SQL Server 2014 that we might want to add support for :)
which is ok so far, since it's a correct representation
but there is a problem to write this back to the server
apart from this, ist there a possibility so restore just the data
by defaukt schemazen creates the schema first
did I say Thank You! for that tool already? :)
if I remember rightly, there currently isn't an option to just restore the data, but you can get it to do this without changing any code if you simply delete all the other files/folders that were created from the "script" command, so that the data folder will be all that SchemaZen sees
what error are you getting when it tries to write the hierarchy back to the server? I would like to think that if it is serialized correctly as ToString() then SqlServer should be able to un-serialize it from that...
but nothing ever works the way we would like ;)
Hey @sethreno I'm trying to get a feel for the state of the compare function. At a glance, it would appear the scripts created by the compare function simply use whatever database is selected. Also, any schemas missing from the target database are not added to the script. Is this expected behavior?
@NathanaelThompson I believe I can answer this, I did some work on the compare function a while ago. It is a bug that schemas are not compared - they are missing from the DatabaseDiff class. You could open an issue for this. And, yes, the scripts created by the compare function do indeed just use whatever database is selected when the scripts are executed. If you want this changed, you could again open an issue :)
the history behind the compare function is, that Seth had disabled it (commented out the code) because he wasn't sure it always produced correct results. and I came along, and being new to open source development, blundered in without knowing this or asking about it and uncommented it and added a few object types that were missing - it seems I missed schemas, so I think that it's my fault ;) I'm sure there is a discussion about it somewhere - maybe on the commits themselves, I'll try to find it
unfortunately, I can't seem to find the discussion/comments, but anyway, "compare" is labelled as experimental in the readme, so it's good to have people finding missing features or bugs and validating that claim hehe ;)
Thanks for the reply @keith-hall. I think I can do one better than opening an issue. I'll look into fixing these issues today.
Hi, is anyone still maintaining the repo?
Pablo Ovelleiro Corral
@honzabilek4 Doesn 't seem very active. I use the tool quite regulary though. I haven't found a way to fully automate my git/mssql workflow yet, is there some way to "sync" between the generated .sql files and the procesdures on the server? the direction SQLserver -> Files is easy with this.
Hello, when I make a backup with schemazen and restore it, the filestream has lost. Is that a known "feature"? Does someone know how to solve this?
@sethreno Just wanted to chime in on an issue that I've been having while working with SchemaZen, I am able to copy down most of the database objects from my source database, but I'm seeing that database Sequences are not coming down as expected. Is there some database rule I am missing to where sequences could not be copied?
How can I make a data backup with schemazen?
Does anyone know about it?
Hi! I'm having trouble. Is there a way to script only one table? Just the create table script.
I'm trying to get around the time it takes to expand all tables in SSMS
like @raminmahpour asked, can I make databackup with schemazen? I seen option "--datatable <tablename1>,<tablename2>,<tablename3> (etc).." but I want to get data of all tables in my db. It is not easy to enter all the table name since there are a number of tables. please help me on this. Thanks in advance.
@arifzain74 You can use the following option to script all tables: "--dataTablesPattern=.*"
Any plans to make schemazen available with .NET Core?
Yes! I've started a branch for it but don't have much spare time right now. Hope to release sometime this year.
Hi, I am getting below error while creating databases using schemazen
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Hi, can I use this tool to export tables whose Table schema is other than 'dbo' ?