Search This Blog

Showing posts with label SQL 2012. Show all posts
Showing posts with label SQL 2012. Show all posts

Friday, January 17, 2014

Opening Firewall for SQL Server allowing TCP access

From Microsoft TechNext

When you can't access a remote sql server, always change the firewall 1st.
the confirm what the sa / user password.

To open a port in the Windows firewall for TCP access

  1. On the Start menu, click Run, type WF.msc, and then click OK.
  2. In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.
  3. In the Rule Type dialog box, select Port, and then click Next.
  4. In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine, such as 1433 for the default instance. Click Next.
  5. In the Action dialog box, select Allow the connection, and then click Next.
  6. In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then click Next.
  7. In the Name dialog box, type a name and description for this rule, and then click Finish.


Friday, November 22, 2013

Using BCP utility

Bulk copy program bcp is still supported by SQL 2008 R2 and SQL 2012 Yeah!!!

SQL 2008 R2 http://technet.microsoft.com/en-us/library/ms162802(v=sql.105).aspx
The bcp 10.0 client is installed when you install Microsoft SQL Server 2008 R2 tools. If tools are installed for both SQL Server 2008 R2 and SQL Server 2005, depending on the value of the PATH environment variable, you might be using the earlier bcp client instead of the bcp 10.0 client. This environment variable defines the set of directories used by Windows to search for executable files. To discover which version you are using, run the bcp /v command at the Windows Command Prompt. For information about how to set the command path in the PATH environment variable, see Windows Help.

SQL 2012 http://technet.microsoft.com/en-us/library/ms162802.aspx
The bcp 11.0 client is installed when you install Microsoft SQL Server 2012 tools. If tools are installed for both SQL Server 2012 and an earlier version of SQL Server, depending on the value of the PATH environment variable, you might be using the earlier bcp client instead of the bcp 11.0 client. This environment variable defines the set of directories used by Windows to search for executable files. To discover which version you are using, run the bcp /v command at the Windows Command Prompt. For information about how to set the command path in the PATH environment variable, see Windows Help.

For exporting

bcp [database name].dbo.[table name] out  -n -S -U -P


For Import

bcp [database name].dbo.[table name] out  -n -S -U -P


case is important on arguments.  -n is very important. forces bcp to sql native format.  This is essential of you are exporting and importing data to tables to prevent truncating.

Example

Bcp [New410].dbo.tbCPTDx out tbCPTDx.bcp –n –SRISQA2008R2 –Usa –Psa