I am using the following to take data from an output file and put into a .TXT file
Is it possible within the same procedure to output the first line as the column headers ? if So how do I do it please
CREATE Procedure Z_TEST_BCP_Text_File
If exists(Select * from information_Schema.tables where table_name='databaselog')
Declare @str varchar(1000)
set @str='Exec Master..xp_Cmdshell ''bcp "Select * from '+db_name()+'..'+@table+'" queryout "'+@FileName+'" -c -t"|" -T '''
Select 'The table '+@table+' does not exist in the database'
to execute I run the following command
EXEC Z_TEST_BCP_Text_File 'My_File_Name','C:\My_Output_File.txt'
So every once in a while at work I am asked to export data from one table and insert it into another on a different server. I hate doing this. There's so many different tables and data types. Some column data needs quoted and some doesn't. What …
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted? Many believe this is the case.
Let us try to examine for ourselves with an example.
To get started, use the following script, wh…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online)
The email signat…