How do I create a view in SQL Server in Visual Studio Express 2013 for Desktop?

Hi
I've got a SQL Server database set up using the internal SQL Server in Visual Studio Express 2013 for Desktop. I want to create a view (using tables with one to many relationships) but I don't
know how to do it.
Where can I find a good tutorial on creating views in SQL Server in Visual Studio Express 2013 for Desktop? I think Visual Studio Express 2013 for Desktop doesn't have some view designer that
exists in the non-express version of Visual Studio (if I'm not mistaken). So I think I'd need a tutorial on how to do the actual SQL, unless there is some tool I don't know about.
Thanks

Hi ,
According to your description, if you install SQL Server SQL Server 2014 Express and SQL Server Manager Studio tools (SSMS), if you want to create a view, you can use SSMS. Then if you want to connect to and Diagram your SQL Express Database in Visual Studio
2013, you can attach the database file by using the .NET Framework Data Provider for SQL Server in Visual Studio, and create a database diagram via expanding the “Database Diagrams” node.
 For more information, there is similar issue about how to connect to and Diagram your SQL Express Database in Visual Studio 2012 , you can review the following article,
http://blogs.msdn.com/b/bethmassi/archive/2011/10/27/how-to-connect-to-and-diagram-your-sql-express-database-in-visual-studio-lightswitch.aspx.
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support

Similar Messages

  • How to prevent "Sign in" dialog on first launch of Visual Studio Express 2013?

    I am installing Visual Studio Express 2013. When I launch application shortcut for first time, It shows "sign in" window, which I want to hide for the users. This window also overrides all my settings (e.g. disabled "automatic check for
    updates"). Is there any way to prevent this dialog from appearing?

    Hi,
    >>I was looking for file or registry settings to suppress this dialog
    As far as I know, there is no way to realize this. It is by design. Since the users will sign in later, why need to suppress the dialog. What's more, this is an express edition, so you can't find any third-party add-in to help hide the dialog because Visual
    Studio Express doesn't support third-party add-ins. The only way you want the dialog not showing is to click "cancel" button the first time the dialog pop up. After that, you still can sign in if you want to. Click "Help", choose "register product", then
    you can sign in the appearing dialog.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I cannot connect to my basic SQL server from Visual Studio Ultimate 2013? Error 40 - Cannot establish connection

    I just started learning ASP.NET through a book, and it asks to connect to "your" SQL server and explore a .mdf file. I've been trying to install SQL, but I only just now got a working installation, and even then it won't let me install the Management
    Software. Whenever I try to connect, I get this error: http://puu.sh/7F2JY.png
    This is exactly what I do to connect:
    1) Open project
    2) Navigate to the Server Explorer
    3) Click on connect to database
    4) In this menu, I can see me Machine name on the top part, which I think means that it's picking up my server runningh
    5) On the bottom, it wants me to enter a database name. I think this may be my problem, as I have no idea what to do here.
    Also, when I double click on the database file, I get this errpr (52): http://puu.sh/7F2Yw.png
    I really don't know what to do here, so post any tips down below

    Hi,
    Did you choose the correct Server name? It should be the machine name where you installed SQL Server on.
    Is it empty when you open select or enter database name drop box in the Add connect dialog box in the Visual Studio 2013?
    “Update: I re-installed, and then used both installers. Now I have the Server Management tools, but I still cannot connect.”
    The screenshots indicates that the SQL Server is not accessible.
    Do you mean that you are not able to connect SQL Server by using SQL Server Management Studio?
    If so, make sure that SQL Server Services is started.
    Please check out the following articles for details:
    How to: Start an Instance of SQL Server (SQL Server Configuration Manager)
    http://technet.microsoft.com/en-us/library/ms190699(v=sql.105).aspx
    Connect to Any SQL Server Component from SQL Server Management Studio
    http://technet.microsoft.com/en-us/library/ms173871.aspx
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Error installing sql server 2008 management studio express

    Hello,
    I need to install sql server 2008 management studio express on a sql server 2k8 R2 instance.
    First of all, I've downloaded this one from this link: http://www.microsoft.com/en-us/download/details.aspx?id=7593 (for 32 bits).
    Once I've the downloaded file I run this file and choose the first option (New sql server stand-alone...) in the installation part. Finally, in the installation type I choose the option 'Add features to an existing instance of SQL Server 2008' with the instance
    selected. I push Next and then I get the following error: 'The instance ID is required but it is missing'.
    Can anybody help me?
    Thanks a lot.
    Regards.

    Hello,
    What’s the edition of the SQL Server 2008 R2? If you had installed SQL Server 2008 R2 Developer edition, you should install “SQL Server 2008 Express with Tools” edition or “SQL Server 2008 Express with Advanced Services” edition.
    Please refer to the following article for more information:
    http://www.benlittler.com/2009/06/how-to-install-sql-management-studio-express-2008/
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Licencing of Windows 8.1, SQL Server and Visual Studio

    1. Windows 8 (OEM Version)
        a. Is it legal to re-install Windows 8 OEM version on a PC (this might
    be required because of formatting of PC hard disk)? Is there any upper limit on how many times a Windows 8 OEM version can be re-installed
    on a PC?
        b. Can I continue to use same Windows 8 OEM version even after upgrading
    a PC (for example change of processor, change of hard disk, change of RAM etc.)
    2. SQL Server (Developer and Express) Version:
       a. Your site mentions that SQL Server Developer edition can be used for
    software development and testing, but a software dealer whom I have approached says its not legal to use SQL Server Developer edition for
    development in a software consultancy. Please clarify.
       b. Is it legal to use SQL Server Express Edition for software development
    purpose in  a software consultancy?
    3. Visual Studio Express Edition
        a. Is it legal to use Visual Studio Express Edition for software development
    purpose in  a software consultancy?
    I had emailed this query to [email protected] yesterday but I have not received any reply.

    This question is a bit broad for a forum post. What have you tried and where does it fail? This code will give a list of files in an app folder. It might get you started: [c# code, but should be easy to translate to VB]
    public async Task<List<string>> GetFileListFromFolder() {
    List<string> fileList = new List<string>();
    StorageFolder storageFolder = await Package.Current.InstalledLocation.GetFolderAsync(@"myFolder\");
    foreach (StorageFile fl in await storageFolder.GetFilesAsync())
    fileList.Add(fl.Name);
    return fileList;
    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

  • Hi, I would like to know if is it possible to install windows on mac pro , because I need to have some application like SQL server and visual studio, and they could not be install on mac

    hi, I would like to know if is it possible to install windows on macbook pro , because I need to have some application like SQL server and visual studio, and they could not be install on mac

    Windows on a Mac

  • Microsoft SQL Server 2012 Management Studio Express silent installation very slow

    Iam doing silent installations often on several Systems.
    I install the Microsoft SQL Server 2012 Management Studio Express with this command:
    "SQLManagementStudio_x64_DEU.exe /ACTION=INSTALL /QUIET /IAcceptSQLServerLicenseTerms="True" /FEATURES=CONN,BC,SSMS /indicateprogress"
    The installation will take almost an hour to finish. 
    I never get error messages or so. The installation afterwards is fine.
    Is there a way to speed up the installation process?
    Thanks!

    Hi Dennis,
    When installing SQL Server Management Studio, it is normal for us taking an hour to finish the installation.
     Personally, if you want to speed up the installation process, I recommend improve your hardware device on your computer, such as CPU, RAM, hard disk and so on.
    Or you can submit an submit the requirement at https://connect.microsoft.com/SQLServer/. 
    If the requirement mentioned by customers for many times, the product team may consider to add or improve this requirement in the future SQL Server version. Thanks for your understanding.
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Microsoft SQL Server 2012 Management Studio Express

    Hello,
    I have a question, Can I use Microsoft SQL Server 2012 Management Studio Express tool to administrate my SQL Server 2008 Enterprise database without a restriction or limitations?.
    Basically, I have a SQL server 2008 R2 database as production enviroment(Enterprise version) and I would like to know if I can use Microsoft SQL server 2012 Management Studio Express tool to manage my database without limitations.
    Thanks

    SSMS2012 is backwards compatible so you can use ..
    http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/0151c2e8-2281-4a78-86b0-20cc1bfd57ac
    Raju Rasagounder MSSQL DBA

  • How to replace a dates on a SQL query on Visual Studio (and get the query to work in there in the first place)?

    Morning all,
    I've just been assigned a report-related project but I have not created much of anything in C# or .Net before!
    I was wondering if someone could help me get started. Here are the specifications:
    Basically, I am to create an automated report application. I have the query and I will include it further down
    in this post. The page is to have a couple blanks to specify the Start Date and End Date and replace those dates in the query, and generate the report. What I need some help on is how to make the SQL query work in the application which I will connect to the
    intended database to generate the report (basic I know, but I'm new at this) on Visual Studio 2010. I also need some help on programming the Start Date blank and End Date blank so that what the user types in for those blanks will replace the date fields in
    the SQL query, then generate the report with the new dates. 
    I appreciate the help!
    The SQL query and what the dates are replacing:
    select 
    PTH.INST_ID ,
    PTH.EMPLOYEE_ID,
    DBH.HR_DEDUCTION_AND_BENEFITS_CODE,
    replace(DB.DESCRIPTION,',',''),
    DB.WITHHOLDING_LIABILITY_ACCOUNT_MASK,
    DBH.HR_DEDUCTION_AND_BENEFITS_ID,
    DBH.CHECK_DATE,
    DBH.CHECK_NO,
    DBH.FIN_INST_ACCT_ID,
    replace(replace (DBH.COMMENT,CHAR(10),' '),CHAR(13),' '),
    DBH.HR_DEDUCTION_AND_BENEFIT_CYCLE_CODE,
    DBH.LENGTH,
    DBH.EMPLOYEE_COMPUTED_AMOUNT,
    DBH.EMPLOYEE_BANK_ROUTING_NUMBER,
    DBH.EMPLOYEE_ACCOUNT_TYPE,
    DBH.EMPLOYEE_ACCOUNT_NUMBER,
    DBH.EMPLOYER_COMPUTED_AMOUNT,
    DBH.EMPLOYEE_GROSS_AMOUNT,
    DBH.EMPLOYER_GROSS_AMOUNT,
    DBH.PAYROLL_EXCLUDE,
    PTH.VOID_DATE,
    PTH.BATCH_QUEUE_ID,
    B.BATCH_CODE,
    BQ.FY,
    BQ.END_DATE,
    BQ.COMMENTS,
    BQ.BATCH_CRITERIA_USED,
    BP.COLUMN_VALUE,
    PTH.REPLACEMENT,
    P.LAST_NAME,
    P.FIRST_NAME,
    P.MIDDLE_NAME
    from PY_EMPLOYEE_TAX_HISTORY PTH
    INNER JOIN PERSON_EMPLOYEE PE ON
    PE.INST_ID=PTH.INST_ID AND
    PE.EMPLOYEE_ID=PTH.EMPLOYEE_ID
    INNER JOIN PERSON P ON
    PE.INST_ID=P.INST_ID AND
    PE.PERSON_ID=P.PERSON_ID
    LEFT JOIN HR_EMPLOYEE_DEDUCTIONS_AND_BENEFITS_HISTORY DBH ON
    PTH.INST_ID=DBH.INST_ID AND
    PTH.CHECK_DATE=DBH.CHECK_DATE AND
    PTH.CHECK_NO=DBH.CHECK_NO AND
    PTH.EMPLOYEE_ID=DBH.EMPLOYEE_ID
    LEFT JOIN HR_DEDUCTION_AND_BENEFITS DB ON
    DB.INST_ID=DBH.INST_ID AND
    DB.HR_DEDUCTION_AND_BENEFITS_CODE=DBH.HR_DEDUCTION_AND_BENEFITS_CODE
    LEFT JOIN BATCH_QUEUE BQ ON
    PTH.BATCH_QUEUE_ID=BQ.BATCH_QUEUE_ID
    LEFT JOIN BATCH B ON
    B.BATCH_CODE=BQ.BATCH_CODE 
    LEFT JOIN BATCH_PARAMETER BP ON
    BQ.BATCH_QUEUE_ID=BP.BATCH_QUEUE_ID
    AND BP.COLUMN_NAME = 'SUPPRESS_DIRECT_DEPOSIT'
    ------Please change the WHERE condition for date range of the month you need to run this for.
    WHERE PTH.CHECK_DATE >='07/01/2013'
    AND PTH.CHECK_DATE <='07/31/2013'
    and BQ.BATCH_CODE='BAT_PY_PAYCALC'
    and bq.fy=2014
    ORDER BY PTH.INST_ID ,
    PTH.EMPLOYEE_ID,
    DBH.HR_DEDUCTION_AND_BENEFITS_CODE,
    DBH.CHECK_DATE

    Try this code.  The Server name will be the same name when you use SQL Server Management Studio (SSMS).  It is in the login window for SSMS.  I assume you are using SQLSTANDARD (not SQLEXPRESS) which is in the connection string in the code
    below. I also assume you have remote connection allowed in the database.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data;
    using System.Data.SqlClient;
    namespace ConsoleApplication1
    class Program
    const string DATABASE = "Enter Database Name Here";
    const string SERVER = "Enter Server Name Here";
    static void Main(string[] args)
    DateTime startDate = DateTime.Parse("07/01/2013");
    string startDateStr = startDate.ToString("MM/dd/yyyy");
    DateTime endDate = new DateTime(startDate.Year, startDate.Month + 1, 1).AddDays(-1);
    string endDateStr = endDate.ToString("MM/dd/yyyy");
    string connStr = string.Format("Server={0}\\SQLSTANDARD;Database={1};Trusted_Connection= True;", SERVER,DATABASE);
    string SQL = string.Format(
    "select\n" +
    " PTH.INST_ID\n" +
    ",PTH.EMPLOYEE_ID\n" +
    ",DBH.HR_DEDUCTION_AND_BENEFITS_CODE,\n" +
    ",replace(DB.DESCRIPTION,',','')\n" +
    ",DB.WITHHOLDING_LIABILITY_ACCOUNT_MASK\n" +
    ",DBH.HR_DEDUCTION_AND_BENEFITS_ID\n" +
    ",DBH.CHECK_DATE\n" +
    ",DBH.CHECK_NO\n" +
    ",DBH.FIN_INST_ACCT_ID\n" +
    ",replace(replace (DBH.COMMENT,CHAR(10),' '),CHAR(13),' ')\n" +
    ",DBH.HR_DEDUCTION_AND_BENEFIT_CYCLE_CODE\n" +
    ",DBH.LENGTH\n" +
    ",DBH.EMPLOYEE_COMPUTED_AMOUNT\n" +
    ",DBH.EMPLOYEE_BANK_ROUTING_NUMBER\n" +
    ",DBH.EMPLOYEE_ACCOUNT_TYPE\n" +
    ",DBH.EMPLOYEE_ACCOUNT_NUMBER\n" +
    ",DBH.EMPLOYER_COMPUTED_AMOUNT\n" +
    ",DBH.EMPLOYEE_GROSS_AMOUNT\n" +
    ",DBH.EMPLOYER_GROSS_AMOUNT\n" +
    ",DBH.PAYROLL_EXCLUDE\n" +
    ",PTH.VOID_DATE\n" +
    ",PTH.BATCH_QUEUE_ID\n" +
    ",B.BATCH_CODE\n" +
    ",BQ.FY\n" +
    ",BQ.END_DATE\n" +
    ",BQ.COMMENTS\n" +
    ",BQ.BATCH_CRITERIA_USED\n" +
    ",BP.COLUMN_VALUE\n" +
    ",PTH.REPLACEMENT\n" +
    ",P.LAST_NAME\n" +
    ",P.FIRST_NAME\n" +
    ",P.MIDDLE_NAME\n" +
    " from PY_EMPLOYEE_TAX_HISTORY PTH\n" +
    " INNER JOIN PERSON_EMPLOYEE PE ON\n" +
    " PE.INST_ID=PTH.INST_ID AND\n" +
    " PE.EMPLOYEE_ID=PTH.EMPLOYEE_ID\n" +
    " INNER JOIN PERSON P ON\n" +
    " PE.INST_ID=P.INST_ID AND\n" +
    " PE.PERSON_ID=P.PERSON_ID\n" +
    " LEFT JOIN HR_EMPLOYEE_DEDUCTIONS_AND_BENEFITS_HISTORY DBH ON\n" +
    " PTH.INST_ID=DBH.INST_ID AND\n" +
    " PTH.CHECK_DATE=DBH.CHECK_DATE AND\n" +
    " PTH.CHECK_NO=DBH.CHECK_NO AND\n" +
    " PTH.EMPLOYEE_ID=DBH.EMPLOYEE_ID\n" +
    " LEFT JOIN HR_DEDUCTION_AND_BENEFITS DB ON\n" +
    " DB.INST_ID=DBH.INST_ID AND\n" +
    " DB.HR_DEDUCTION_AND_BENEFITS_CODE=DBH.HR_DEDUCTION_AND_BENEFITS_CODE\n" +
    " LEFT JOIN BATCH_QUEUE BQ ON\n" +
    " PTH.BATCH_QUEUE_ID=BQ.BATCH_QUEUE_ID\n" +
    " LEFT JOIN BATCH B ON\n" +
    " B.BATCH_CODE=BQ.BATCH_CODE\n" +
    " LEFT JOIN BATCH_PARAMETER BP ON\n" +
    " BQ.BATCH_QUEUE_ID=BP.BATCH_QUEUE_ID\n" +
    " AND BP.COLUMN_NAME = 'SUPPRESS_DIRECT_DEPOSIT'\n" +
    " WHERE PTH.CHECK_DATE >='{0}'\n" +
    " AND PTH.CHECK_DATE <='{1}'\n" +
    " and BQ.BATCH_CODE='BAT_PY_PAYCALC'\n" +
    " and bq.fy=2014\n" +
    " ORDER BY PTH.INST_ID\n" +
    ",PTH.EMPLOYEE_ID\n" +
    ",DBH.HR_DEDUCTION_AND_BENEFITS_CODE\n" +
    ",DBH.CHECK_DATE", startDateStr, endDateStr);
    SqlDataAdapter adapter = new SqlDataAdapter(SQL, connStr);
    DataTable dt = new DataTable();
    adapter.Fill(dt);
    jdweng
    Could you elaborate more on what this code does in general?
    Does it generate a table with the data between specified dates? If so, where is the table shown? 
    Where does one enter in the specified start and end dates on the Web Application? Do I have to create start and end date blanks and link them to the code for it to work?
    Sorry for the inconvenience - I'm just really new at this. Thanks!

  • Creating Data Source to SQL Server 2008 in SharePoint Designer 2013

    Hello,
     I have been trying to create a Data Source connection to a SQL Server 2008 Database. I use a custom string and I choose the table to display and hit ok. When I try to click on the connection to edit it I get the following error.

    Hi Derek,
    According to your description, my understanding is that the error occurred when you edited the Data Source connected to SQL Server.
    How did you create the Data Source connected to SQL server using custom string?
    I recommend to connect to the database by saving the user name and password to see if the issue still occurs.
    More information are provided in the link below:
    http://office.microsoft.com/en-us/sharepoint-designer-help/add-a-database-as-a-data-source-HA010355745.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Can I use Built-in SQL Server in Visual Studio 2010 ?

    Hi Friends, I am Atif.
    If I will upload my project to my Server Domain and I want to use Built-in Visual Studio 2010 Sql Server Expreess Database then it will work. If yes then Please suggest me How..??
    Actually I don't want to install SQL Server Database Seperately.
    Tell me How can i achieve this.
    Thanks and Regards.
    Atif.

    Hi Atif,
    Besides other post, to use SQL Server Express for development work, you just need to specify the data source (SQL server's name) and authentication details in a connection string. For more information about SQL Server Express connection string, you can review
    the examples in the following articles.
    Database Connectionstrings
    SQL Server Connection Strings for ASP.NET Web Applications
    Also please note that SQL Server Express edition has some limitations, for example: only one CPU can be used by the express edition, the maximum size of a database is 4 GB (10GB in SQL Server 2008 R2 Express and higher versions of SQL Server Express),
    it can only use up to 1GB of RAM.
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • SQL Server 2008 Management Studio Express

    So I have an employee that works on Domain A, however she needs to log into SSMS 2008 Express under Domain B. When she launches SSMS Express it will not let her change the windows login credentials at all. My boss told me that the solution below was suggested
    to him by MS to resolve the issue.
    runas
    /netonly
    /user:domain\username
    "C:\Progr...\IDE\Ssms.exe"
    So I did this and still same issue, the ability to change the credentials are still grayed out.
    Any suggestions?
    Thanks,
    Matt M.

    Hi,
    It is by design that User name and Password area is grayed out when using Windows Authentication. SQL Server Management Studio fills in the user with the currently logged on Windows account for Windows authentication. The end-user is not allowed to change
    or input a different user.
    As suggested, you can launch SSMS with runas command with the "/netonly" switch to log in using remote credentials on a domain that you’re not currently a member of.
    Check out the following link for more information:
    SSMS - Allow login with other domain and user
    http://connect.microsoft.com/SQLServer/feedback/details/774357/ssms-allow-login-with-other-domain-and-user
    TIP: How to Run Programs as a Domain User from a Non-domain Computer
    http://codebetter.com/jameskovacs/2009/10/12/tip-how-to-run-programs-as-a-domain-user-from-a-non-domain-computer/
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Crystal reports integration with sql server and visual studio 2010

    when I am trying to open a crystal report  through code ( visual basic 2010 ) I get the error
    the report has no tables
    I am using SQL SERVER 2008 R2
    HERE IS THE CODE I WROTE 
    Imports System.Data
    Imports System.Data.OleDb
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Windows.Forms
    Imports CrystalDecisions.Shared
    Public Class frmRep
        Dim objConnection As New OleDbConnection("Provider=SQLOLEDB;Data Source=ASHRAF-PC\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=TEST")
        Dim objDataAdapter As New OleDbDataAdapter()
        Dim objDataSet As New DataSet()
        Private Sub CrystalReportViewer1_Load(sender As System.Object, e As System.EventArgs) Handles CrystalReportViewer1.Load
        End Sub
        Private Sub frmRep_Load(sender As Object, e As System.EventArgs) Handles Me.Load
            Dim cr As New ReportDocument
            objDataAdapter.SelectCommand = New OleDbCommand()
            objDataAdapter.SelectCommand.Connection = objConnection
            objDataAdapter.SelectCommand.CommandType = CommandType.Text
            objDataAdapter.SelectCommand.CommandText = "select * from bands"
            objConnection.Open()
            objDataAdapter.Fill(objDataSet, "bands")
            objConnection.Close()
            cr.Load("D:\MY VB 2010 PROJECTS\test2\test2\CrystalReport1.rpt")
            cr.SetDataSource(objDataSet.Tables("bands"))
            CrystalReportViewer1.ReportSource = cr
            CrystalReportViewer1.Refresh()
        End Sub
    End Class

    I suggest you post that question in a Crystal Reports forum.
    Markus

  • Creating multiple views in SQL Server 2008 database through sqlcmd

    I've written a script that generates a ddl file. The ddl file contains all the table creation, view creation and stored proc creation SQL statements for refreshing my database. The ddl file gets run by sqlcmd.
    From reading other forum posts, it seems that views and stored procedures can only be created through the sqlcmd command when they are part of an individual batch. Can someone please direct me to the documentation on how to do this?
    My DDL is below pertaining to view creation:
    CREATE VIEW [global].[viewDstLocations]
      WITH SCHEMABINDING
     AS
       SELECT REPLACE(STR(c.dstYear, 2), ' ', '0') AS 'DSTyear',
              a.countryCode AS 'CountryCode',
              a.countryDivision AS 'CountryDivision',
              a.stateCode AS 'StateCode',
              a.locationCode AS 'LocationCode',
              a.locationType AS 'LocationType',
              a.gmtVariation AS 'GMTvariation',
              c.dstVariation AS 'DSTvariation',
              REPLACE(SUBSTRING(CONVERT(VARCHAR(8), c.dstStartTs, 8), 1, 5), ':', '')  AS 'DSTstart_time',
              CONVERT(VARCHAR(8), c.dstStartTs, 12) AS 'DSTstart_date',
              c.statusMarkerStart AS 'StatusMarker_start',
              REPLACE(SUBSTRING(CONVERT(VARCHAR(8), c.dstEndTs, 8), 1, 5), ':', '')  AS 'DSTend_time',
              CONVERT(VARCHAR(8), c.dstEndTs, 12) AS 'DSTend_date',
              c.statusMarkerEnd AS 'StatusMarker_end',
              c.dataIndicator AS 'DataIndicator',
              b.locationName AS 'LocationName',
              a.latitude AS 'Latitude',
              a.longtitude AS 'Longtitude'
          FROM [global].[dstLocations] a
             LEFT JOIN [global].[dstLocationNames] b ON (b.locationId = a.locationId AND b.locale = 'en_US')
                LEFT JOIN [global].[dstLocationInfo] c ON (c.locationId = a.locationId);
    GO;
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'DST location info shown in the legacy table structure as well as data format.',
     @level0type=N'SCHEMA', @level0name=N'global', @level1type=N'VIEW', @level1name=N'viewDstLocations';
    GO;
    CREATE VIEW [global].[viewTypes]
      WITH SCHEMABINDING
     AS
       SELECT a.levelTypeId, a.levelTypeName, a.levelDepth, b.productId, b.productName, c.baseLevelTypeId, c.baseLevelTypeName
          FROM [global].[levelTypes] a
             LEFT JOIN [global].[products] b ON (b.levelTypeId = a.levelTypeId)
                LEFT JOIN [global].[baseLevelTypes] c ON (c.levelTypeId = a.levelTypeId);
    GO;
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Displays level types and their associated products and base level types.' , @level0type=N'SCHEMA',@level0name=N'global', @level1type=N'VIEW',@level1name=N'viewTypes';
    GO;
    <<Several other views>>

    Kalman,
    I've followed that approach, but was getting an error. Hopefully this gives enough detail:
    First, I use a .bat file to generate the sql file as you suggest. The structure is as follows:
    USE [MYDB] 
    GO
    <<All my create scripts, without GO between them>>
    GO;
    <<All my view scripts, without GO between them>>
    GO;
    <<All my strored procedures, without GO between them>>
    GO;
    Then, I run the generated SQL with the -i option as you mentioned.
    I get back the resulting error below:
    Msg 156, Level 15, State 1, Server DEV-238SQLEXPRESS, Procedure viewDstLocations, Line 2
    Incorrect syntax near the keyword 'EXEC'.
    Msg 156, Level 15, State 1, Server DEV-238SQLEXPRESS, Procedure spGeneralDeleteNodeAndSubtree, Line 2
    Incorrect syntax near the keyword 'PROCEDURE'.
    Msg 137, Level 15, State 2, Server DEV-238SQLEXPRESS, Procedure spGeneralDeleteNodeAndSubtree, Line 2
    Must declare the scalar variable "@parentId".
    Msg 137, Level 15, State 2, Server DEV-238SQLEXPRESS, Procedure spGeneralDeleteNodeAndSubtree, Line 2
    Must declare the scalar variable "@levelTypeId".
    Msg 137, Level 15, State 1, Server DEV-238SQLEXPRESS, Procedure spGeneralDeleteNodeAndSubtree, Line 2
    Must declare the scalar variable "@name".
    Msg 137, Level 15, State 2, Server DEV-238SQLEXPRESS, Procedure spGeneralDeleteNodeAndSubtree, Line 2
    Must declare the scalar variable "@name".
    Msg 134, Level 15, State 1, Server DEV-238SQLEXPRESS, Procedure spGeneralDeleteNodeAndSubtree, Line 2
    The variable name errormsg has already been declared. Variable names must be unique within a query batch or stored procedure.
    From the documentation, I saw that CREATE VIEW needs to be the first statement in a batch. I assume this to mean I will need to break out my view and stored procedures to separate files and call the sqlcmd command multiple times, once for the table creation
    and then once for each view and once for each stored procedure. If there is a way to still do this as only one file, that would answer my original question.
    If there is anything else I can paste or send, please let me know.

  • Have VS Express 2013 for Web but need to add JavaScript .. how to add this Template in the New Project or should I...

    Install Visual Studio Express 2013 for Desktop instead. Is there a way to have both installed on same machine? Or can I install some add ons (if so what) to get that feature in VS Express for the Web? suggestions?

    Thanks for pvge42's help.
    Hi Phillipk,
    I agree with the pvdg42's suggestion, so if possible I suggest you can try the pvdg42's suggestion to install the VS2013 Community check your issue.
    In addition, I suggest you can refer the VS2013 Express MSDN document to understand different project use the different version of VS2013 Express.
    http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for