|
|
How to export table or Query output to a file using BCP
|
Total Hit (2814) |
To export Query result to a file use following command to your command prompt
«code LangId=6»EXEC master..xp_cmdshell
'bcp "select * from pubs..authors" queryout c:\authors.txt -c -Usa -Pmypassword'«/code»
To export table to a file use following command to your command prompt
«code LangId
....Read More |
Rating
|
|
|
Quickly copy records between tables with same structure
|
Total Hit (2948) |
The SQL language offers a simple and effective way to quickly move all records from a table to another table with same field structure, that is same fields' name, type and position:
«Code LangId=6»
INSERT Customers SELECT * FROM New_Customers
-- you can optionally complete the move by
-- delet
....Read More |
Rating
|
|
|
|
How to restore a SQL Server database marked as "suspect"
|
Total Hit (10670) |
At times a database appears to be marked as "suspect" in the Enterprise Manager. SQL Server marks a database as suspect with it can't access the database. What happens at a low level is that SQL Server sets one of the bits in the status field in the sysdatabases table.
In general, this problem ha
....Read More |
Rating
|
|
|
|
|
|
|
|
|
|
Export SQL data to XML File (3 different ways)
|
Total Hit (13376) |
Many times we need to export sql server data to some form of XML. As we know that SQL Server can output data in XML format when you use "FOR XML" clause. You can use ADO and MSXML along with "FOR XML" sql query to generate XML files from SQL Server data. The following script is pure VB Script so if
....Read More |
Rating
|
|
|
|
How to Do SQL Server Log Shipping ?
|
Total Hit (1559) |
This article is about log shipping, a refined variation of the traditional manual standby failover server process. Its two major benefits over the traditional methods is that it automates most of the manual work and helps to reduce potential data loss even more.
....Read More |
Rating
|
|
|
|
|
DTS How to...Skip Rows during Import
|
Total Hit (847) |
Firstly you can skip header rows by using the First Row property of the DataPump Task, see Advanced properties sheet. The Text File Connection also has a Skip Rows property, see file Properties of the Connection.
|
Rating
|
|
|
Find an Access Database (from anywhere on the file system)
|
Total Hit (638) |
It may be that we have built a DTS package to synchronise data held in an Access database and our SQL Server. The Access databases all have a consistent name but due to the fact that they are used by travelling salesmen on their laptops we cannot guarantee where the database will be.
For this we
....Read More |
Rating
|
|
|
|
How to export all tables in a database
|
Total Hit (764) |
This is a very short article as it is really a demonstration of concepts explained elsewhere, although quite a useful implementation in it's own right. The export itself is done with the Bulk Export Task, and this is wrapped in a recordset driven loop as covered in the article How to loop through a
....Read More |
Rating
|
|
|
|
SQL Server 2000 DTS Part 4 - DTS Designer Tasks
|
Total Hit (1927) |
In the previous article of our series dedicated to SQL Server 2000 Data Transformation Services, we covered the first of the essential elements of a package - connection. Now it is time to look into another critical component - task - that is responsible for the processing of data retrieved through
....Read More |
Rating
|
|
|
Managing Users Permissions on SQL Server
|
Total Hit (1298) |
Permissions are the rights to access the database objects. Permissions can be granted to a user or role to allow that user or role to perform operations such as selection, insertion or modification of data rows.
|
Rating
|
|
|
|
A Server by Any Other Name
|
Total Hit (750) |
It is imperative to change the server name when infrastructure policy changes, naming convention standard changes or making a standby server the production server (when production server fails). When a server name is changed, SQL server should go through a process to acknowledge and assimilate the c
....Read More |
Rating
|
|
|
Scripting Traces for Performance Monitoring on SQL Server
|
Total Hit (985) |
The SQL Profiler is a great tool for monitoring and analyzing SQL Server Performance. I use it all the time to watch the detailed actions of a stored procedure, trigger or user-defined function (UDF) that I am developing. It can also be used to monitor aggregate performance of an entire SQL Server i
....Read More |
Rating
|
|
|
|
|
Troubleshooting SQL Server Jobs
|
Total Hit (681) |
If you have problems with SQL Server jobs, review this troubleshooting checklist to find potential solutions.
|
Rating
|
|