SQL server table on a PC

  • Hello,

    can we create a SQL server table on a PC based on a query on the sql server ?

    Thank you

  • Beginner2012 (6/8/2012)


    Hello,

    can we create a SQL server table on a PC based on a query on the sql server ?

    Thank you

    What? Can you explain in greater detail what you are asking?

  • I want to save a table from a sql server on my local pc..

  • Beginner2012 (6/8/2012)


    I want to save a table from a sql server on my local pc..

    Still not sure what you mean. You could export the data to a file and store the file on your PC.

  • You could try this (it worked for me when I installed SQL Server 2008 over my SQL Server 2005 instance and SQL Server 2005 databases - after I could not get any data from my Server). I copied my database and log files and opened it on another SQL Server 2005, then running following step:

    1. Open SQL Server 2005 Management Studio Express, connect to your server.

    2. Open the New Query window [(just below menu (File, New...)].

    3. Type USE db (or whatever name of your database is, for instance if your db name is USA, type USE USA).

    4. SELECT * From table1 (table1 is a name of table that you want to save on your computer) AS data.

    5. Find button on the top-right side of that window and above that should be named Results to file (third line from the top, 11th, command after command Execute, just point mouse above each of commands and search for one called Results to file...).

    6. Click F5 on key board

    7. Click it and when new window opens up choose a location of your data. In file name type whatever you want and after type, for example data.txt (data is a name of your file, let's say).

    It should get your data in text file on your PC from your SQL Server table.

    I hope this could be useful to you.

    Sincerely yours,

    Fr. ivan Delic

    Serbia

  • Beginner2012 (6/8/2012)


    Hello,

    can we create a SQL server table on a PC based on a query on the sql server ?

    Thank you

    edited... Misunderstood your question.

    ... Perhaps some more detail would help.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • XMLSQLNinja (8/16/2012)


    ... Perhaps some more detail would help.

    For example...

    -How do want the data from the server to be shown on the PC? Flat file, XML, Excel, CSV, what?

    -Do you have an instance of SQL server on your PC with a target database available to receive the table? In that case, a simple

    SELECT <fieldlist>

    INTO <your.local.PC.table>

    FROM <your.SQL.source.table>

    would suffice.

    -Do you want to have the data in Excel? Do an Export from SSMS.

    The answer to your question is "Yes", but you didn't give us enough detail to allow us to help you get to your preferred end-state.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply