{"id":426,"date":"2022-12-06T11:19:09","date_gmt":"2022-12-06T10:19:09","guid":{"rendered":"http:\/\/lesmrdtrucs.mataf35400.fr\/?page_id=426"},"modified":"2022-12-07T06:56:19","modified_gmt":"2022-12-07T05:56:19","slug":"sql-server","status":"publish","type":"page","link":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/sql-server\/","title":{"rendered":"SQL Server"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"426\" class=\"elementor elementor-426\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-28f45567 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"28f45567\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a37acb6\" data-id=\"a37acb6\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-72f11356 elementor-widget elementor-widget-text-editor\" data-id=\"72f11356\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Site \u00ab\u00a0qui va bien\u00a0\u00bb pour aider:<br \/><a href=\"https:\/\/docs.microsoft.com\/fr-fr\/sql\/t-sql\/functions\/functions?redirectedfrom=MSDN&amp;view=sql-server-ver15\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.microsoft.com\/fr-fr\/sql\/t-sql\/functions\/functions?redirectedfrom=MSDN&amp;view=sql-server-ver15<\/a><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4f6e3f22 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4f6e3f22\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7577f76f\" data-id=\"7577f76f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-358f436 elementor-widget elementor-widget-heading\" data-id=\"358f436\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Connexion \u00e0 une BDD sans contr\u00f4le:<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-72bef6e9 elementor-widget elementor-widget-text-editor\" data-id=\"72bef6e9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Le projet VB doit avoir dans ses r\u00e9f\u00e9rences:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-61940057 elementor-widget elementor-widget-image\" data-id=\"61940057\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"477\" height=\"370\" src=\"https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2022\/12\/Image3.png\" class=\"elementor-animation-grow attachment-large size-large wp-image-432\" alt=\"\" srcset=\"https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2022\/12\/Image3.png 477w, https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2022\/12\/Image3-300x233.png 300w\" sizes=\"(max-width: 477px) 100vw, 477px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a5b3c5f elementor-widget elementor-widget-text-editor\" data-id=\"a5b3c5f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Ouverture de la bdd (MaBase) et d&rsquo;un recordset (MonRec):<br \/><span style=\"color: #339966;\"><em>\u00a0\u00a0 \u00a0&lsquo;Ouvre la BDD ADO du projet Ping<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0Dim MaBase As ADODB.Connection<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0Set MaBase = New ADODB.Connection<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0 MaBase.Open \u00ab\u00a0Provider=SQLOLEDB.1;Password=MonBddMdp;Persist Security Info=True;User ID=MonBddLogin;Initial Catalog=MaBdd;Data Source=MonServer\u00a0\u00bb\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0<\/em><\/span><br \/><br \/><span style=\"color: #339966;\"><em>\u00a0\u00a0 \u00a0&lsquo;Ouvre la table ADO du projet Ping<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0Dim MonRec As ADODB.Recordset<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0Set MonRec = New ADODB.Recordset<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0MonRec.CursorType = adOpenKeyset<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0MonRec.LockType = adLockOptimistic<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0MonRec.Open MonRecSource, MaBase, , , adCmdUnknown<\/em><\/span><br \/><br \/>Fermeture du tout:<br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0MonRec.Close<\/em><\/span><br \/><span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0MaBase.Close<\/em><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-64e66cda elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"64e66cda\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5944273d\" data-id=\"5944273d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9061796 elementor-widget elementor-widget-heading\" data-id=\"9061796\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;}\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><div><div><main role=\"main\"><div><div><div><article><div><div data-elementor-type=\"wp-page\" data-elementor-id=\"426\" data-elementor-title=\"Page\"><div><section data-id=\"2e43c84\" data-element_type=\"section\" data-model-cid=\"c15623\"><div><div data-id=\"3447c2a9\" data-element_type=\"column\" data-col=\"100\" data-model-cid=\"c15624\"><div><div data-id=\"2745328f\" data-element_type=\"widget\" data-model-cid=\"c15625\" data-widget_type=\"heading.default\"><div><h2 data-elementor-setting-key=\"title\" data-pen-placeholder=\"\u00c9crivez ici...\"><\/h2><h2 data-elementor-setting-key=\"title\" data-pen-placeholder=\"\u00c9crivez ici...\">Requ\u00eates usuelles<\/h2><\/div><\/div><\/div><\/div><\/div><\/section><\/div><\/div><\/div><\/article><\/div><\/div><\/div><\/main><\/div><\/div><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6abb68b4 elementor-widget elementor-widget-heading\" data-id=\"6abb68b4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Filtre les enregistrements dont le champ MonChamp est nul:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5ae4ddc elementor-widget elementor-widget-text-editor\" data-id=\"5ae4ddc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #0000ff;\"><em>WHERE MonChamp is null<\/em><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c1b7ad8 elementor-widget elementor-widget-heading\" data-id=\"c1b7ad8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Filtre les enregistrements dont la date contenue dans le champ MonChamp est post\u00e9rieure au 10\/12\/2014:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a707f7c elementor-widget elementor-widget-text-editor\" data-id=\"a707f7c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #0000ff;\"><em>WHERE MonChamp &gt;convert(datetime,&rsquo;10-12-2014&prime;)<\/em><\/span><br \/>\u00a0\u00a0\u00a0 Si le nom du champ est un mot r\u00e9serv\u00e9 (par exemple Date), il doit \u00eatre mis entre crochets: [Date]<br \/>\u00a0\u00a0\u00a0 La syntaxe de la date doit \u00eatre du type: DD-MM-YYYY hh:nn:ss.sss \u00a0\u00a0 \u00a0(ou un morceau de celui-ci)<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3422e2b elementor-widget elementor-widget-heading\" data-id=\"3422e2b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Compte les enregistrements de la machine \"D T2\":<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-22007e7 elementor-widget elementor-widget-text-editor\" data-id=\"22007e7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #0000ff;\"><em>SELECT count(*) FROM\u00a0 [ping2].[dbo].[TeSysK_Auto] where QuelleMachine = &lsquo;D T2&rsquo;<\/em><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fcebcca elementor-widget elementor-widget-heading\" data-id=\"fcebcca\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Compte les enregistrements de chaque machine:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4d202db elementor-widget elementor-widget-text-editor\" data-id=\"4d202db\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #0000ff;\"><em>SELECT [QuelleMachine],COUNT(EcrasementP1) NbEnr FROM [ping2].[dbo].[TeSysK_Auto] GROUP BY QuelleMachine<\/em><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Site \u00ab\u00a0qui va bien\u00a0\u00bb pour aider:https:\/\/docs.microsoft.com\/fr-fr\/sql\/t-sql\/functions\/functions?redirectedfrom=MSDN&amp;view=sql-server-ver15 Connexion \u00e0 une BDD sans contr\u00f4le: Le projet VB doit avoir dans ses r\u00e9f\u00e9rences: Ouverture de la bdd (MaBase) et d&rsquo;un recordset (MonRec):\u00a0\u00a0 \u00a0&lsquo;Ouvre la BDD ADO du projet Ping\u00a0\u00a0 \u00a0Dim MaBase As ADODB.Connection\u00a0\u00a0 \u00a0Set MaBase = New ADODB.Connection\u00a0\u00a0\u00a0 MaBase.Open \u00ab\u00a0Provider=SQLOLEDB.1;Password=MonBddMdp;Persist Security Info=True;User ID=MonBddLogin;Initial Catalog=MaBdd;Data Source=MonServer\u00a0\u00bb\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","footnotes":""},"class_list":["post-426","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/pages\/426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/comments?post=426"}],"version-history":[{"count":28,"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/pages\/426\/revisions"}],"predecessor-version":[{"id":461,"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/pages\/426\/revisions\/461"}],"wp:attachment":[{"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/media?parent=426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}