I want SMO to not script the views so I do this
var transfer = new Transfer(database)
{
CopyAllTables = true,
CopyAllDefaults = false,
CopyAllStoredProcedures = true,
CopyAllDatabaseTriggers = true,
CopyAllObjects = false,
CopyAllPartitionFunctions = false,
CopyAllPartitionSchemes = false,
CopyAllRoles = false,
CopyAllRules = true,
CopyAllSchemas = true,
CopyAllSqlAssemblies = false,
CopyAllSynonyms = false,
CopyAllUserDefinedAggregates = true,
CopyAllUserDefinedDataTypes = true,
CopyAllUserDefinedFunctions = true,
CopyAllUserDefinedTypes = true,
CopyAllUsers = false,
CopyAllViews = false,
Options =
{
WithDependencies = true,
DriAll = true,
Triggers = true,
Indexes = true,
SchemaQualifyForeignKeysReferences = true,
ExtendedProperties = true,
IncludeDatabaseRoleMemberships = false,
Permissions = true,
IncludeDatabaseContext = true
},
PreserveDbo = true,
};
transfer.ScriptTransfer()
but the views are still scripted.
I really want to be able to use transfer as it seems to be the only way to get the objects scripted in dependency order without writing more code. I set
"CopyAllObjects = false" because I thought maybe that was causing the rest of the options that I had set to be ignored, but it didn't seem to do any good.
My goal here is to script out the views separately because I have a database server with views that depend on each other and will need to use dependencywalker on the views in all databases to script them in dependency order.
Please help?
I didn't exactly fix it but ended up filtering out any lines with "create view" in them. so I just call
transfer.ScriptTransfer().Cast<string>().ToList()
unless I am missing something, a lot of these flags (like CopyAllUsers) in the options SMO seems to only honor when it feels like it. :( it's a shame when some options looks exactly like what I need but do not work.
Related
I use .prettierrc with settings:
{
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"bracketSpacing": true,
"printWidth": 100,
"trailingComma": "none",
"arrowParens": "avoid",
"bracketSameLine": false
}
And he puts extra brackets like this in my Vue file:
#updateQuery="val => (query = val)"
But I need in:
#updateQuery="val => query = val"
What to do?
In an arrow function if you are making an assignment prettier will fix it like so:
val => (query = val)
There's nothing wrong with it.
You can find more info here https://github.com/prettier/prettier/pull/1326
I am trying to insert my data into my SQL using RODBC
This is the code I am using:
sqlSave(
odbcChannel,
final,
tablename = "SRP_KAZ_Mega_Shipment_Plan",
rownames = FALSE,
colnames = FALSE,
safer = TRUE,
fast = TRUE,
append = TRUE,
varTypes = c(
филиал = "nvarchar(250)",
SKU = "nvarchar(250)",
Month = "datetime",
Volume = "float",
Feature = "nvarchar(250)",
Period = "nvarchar(250)"
)
)
And this is what I get:
Error in odbcUpdate(channel, query, mydata, coldata[m, ], test = test, :
missing columns in 'data'
I don't know what is wrong here, but whenever I run the exact same code and data on other computers it works perfectly fine.
Any ideas of what this might be will do.
Thanks
I need to apply custom filtering function in my datatable. For this, I need to set "bFilter": true. But I don't need search box. How can I do that?
var holiday_filter = $('#holiday_table').DataTable({
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bSort": false,
"bInfo": false,
"order": [[0, 'desc']],
//"aLengthMenu": [5, 10, 20, 30],
'iDisplayLength': 4,
"bAutoWidth": false
});
Use dom option (default value lfrtip) without f which represents filtering input.
For example:
var holiday_filter = $('#holiday_table').DataTable({
// ... skipped ...
'dom': 'lrtip'
});
How can I save the output of an RStudio Shiny DataTables table using the Save to CSV extension, but have the content saved unquoted instead of the default, which is in double-quotes:
For example, for a single column with two entries, I get a file.csv like this:
"column_name"
"foo"
"bar"
And instead I would like either:
column_name
foo
bar
Or even better, without the header:
foo
bar
My current code looks like this:
output$mytable <- renderDataTable({
entries()
}, options = list(colnames = NULL, bPaginate = FALSE,
"sDom" = 'RMDT<"cvclear"C><"clear">lfrtip',
"oTableTools" = list(
"sSwfPath" = "copy_csv_xls.swf",
"aButtons" = list(
"copy",
"print",
list("sExtends" = "collection",
"sButtonText" = "Save",
"aButtons" = list("csv","xls")
)
)
)
)
)
EDIT:
I tried with one of the suggested answers, and ajax is not allowed, the page complains when I click on SaveTXT. If I do the following, it still puts things within double quotes:
list("sExtends" = "collection",
"sButtonText" = "SaveTXT",
"sFieldBoundary" = '',
"aButtons" = list("csv")
Any ideas?
It should be possible through button options:Button options
And changing sFieldBoundary value.
$(document).ready( function () {
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"aButtons": [
{
"sExtends": "ajax",
"sFieldBoundary": '"'
}
]
}
} );
} );
But I couldn't get it working in shiny.
I want to have client side paging.
But for some reason, I only seem to get back the first page? Even though I know I have two pages worth of data (IE... I step through my code, and I definitely have two...)... What is more baffling is that my links to navigate through the pages never seem to be correct... For instance I would expect the following screen to say 1 of 2...
Also I would expect the bottom right hand side to say View 1-15 of 21?
My feeling is that I am doing something wrong in my data layer to give this pager it's info.
So It only returns the first page.
public static string JsonifyEnc(IEnumerable<TemplateModel> model, int popId, int page, int rows) {
TemplateModel variable = model.ToArray()[0];
ArrayList al = new ArrayList();
//foreach (PatientACOModel patMod in variable.Template) {
int i = 1;
int rowstart = (page * rows + 1) - rows;
int rowend = page * rows;
//Here is where I create the rows... nothing special here
var griddata = new {
total = variable.Template.Count % rows > 0 ? (variable.Template.Count / rows) + 1 : (variable.Template.Count / rows),
page = page,
records = al.Count,
rows = al.ToArray()
};
When I quick wath the total variable it says two?
This would be the first part of my json string that is returned...
{"total":2,"page":1,"records":15,"rows":
So it's there. Also, this is how I am building up my jqGrid...
$(document).ready(function () {
jQuery("#frTable").jqGrid ({
cmTemplate: { sortable: false },
caption: '#TempData["POPNAME"]' + ' Population',
datatype: 'json',
mtype: 'GET',
url: '/Encounters/GetAjaxPagedGridData/', //'Url.Action("GetAjaxPagedGridData", "Encounters", new { popId = TempData["POPULATIONID"] })',//
postData: { popId: '#TempData["POPULATIONID"]'},
pager: '#pager',
jsonReader: {repeatitems: false},
loadonce: true,
height: 'auto',
gridview: true,
viewrecords: true,
rowNum: 15,
shrinkToFit: false,
autowidth: true,
If you use loadonce: true on the client side you should change the server code so that it ignores page and rows options and returns all data. You should just sort the data corresponds to sidx and sord parameter (see sortname and sortorder in jqGrid). You don't need to fill total, page and records parts in the response.
If you use loadonce: true jqGrid load the data and save it in internal data and _index parameters. After that jqGrid change datatype option of jqGrid to "local". So all later sorting, filtering (searching) and paging of data will be done locally.