I am using BCP to dump a Temp Table out to a .CSV file every night. the BCP works great for the most part and 5000 records get dumped just fine but approx 900 records get dumped to the .CSV as just the deliminator.
Here is my BCP statement
EXEC master..xp_cmdshell 'bcp "adult.dbo.clients"...
I have a Query that pulls a subset of data into a temp table and then has to look for field that contain a Char. it looks like below:
UPDATE clients SET clients.client_city = Null
WHERE (((clients.client_city)=" "));
Now I also want this statement or another one to update the field to Null if...
We are running a standard SQL maintenance plan and it looks like the optimization job is running a xp_sqlmaint on the master database.
I hope this helps,
Thomas.
I have a SQL 7.0 Server that serves up 4 databases. For the last month we have been having problems on Sunday nights when we run our DB optimization job the DBCC command ends up locking the database on one of the 4 databases. On Monday morning we end up having to kill the Optimization Job to...
I have a SP that updates 3 tables in SQL with data from approx 7 others. This works great and I have a .Bat file that runs BCP to export them out to a ~ delimited .CSV File. This also seems to work good but I have a problem.
The Dates in SQL look like MM/DD/YYYY or MM/DD/YYYY HH:MM:SS PM but...
The code from zhavic posted works great but now I am having a problem whan I put it into a Stored Procedure in SQL, if there is a NULL value in any of the 3 fields Client_Last_name, Client_First_Name, or Client_Middle_Name then it makes the whole field a null value.
I was thinking if I could do...
I am trying to Automate the moving of data from on Database to another with differnt size Fields. I am fine with the data being truncated down from 50 to 30 Char but do not know how to do it.
I get the following error:
Server: Msg 8152, Level 16, State 9, Line 60
String or binary data would...
SQLSISTER
I tied your Syntax and now get the following error.
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near 'int'.
What am I missing?
Thanks,
Thomas.
So I have tried the suggestion and using the following syntax and I get the following error.
CREATE TABLE #CaseSeq
(Case_Seq int)
Select DISTINCT case_table.case_seq
INTO #CaseSeq
FROM ((agent RIGHT JOIN (client LEFT JOIN client_agent_link ON client.client_seq = client_agent_link.client_seq)...
I have a database that has many tables and a massive table that links it all together called Case_History. I have been trying for a while to get the correct data out of this history table because of duplication when Client move from here to there and back I have resigned myself to breaking it...
I have a SQL server that has been having many problems lately not the least of which is an inability to backup that databases nightly to .BAK files. I have been getting the following error when I do try to back up the database:
1453(Insufficient quota to complete the requested service)
I have...
I have a table that is used to keep history of client movement and most clients have 3 or 4 records in the table.
I.E:
Table 1
Seq 1 2 3 4
Name Tom Bill Tom Jan
Open Date 1/2/2000 1/5/2002 2/5/2002...
We made a change to our SQL 7.0 Server from 6.5 Compatibility to SQL 7.0 compatibility and afterwards we have been having problems with Random Locking on tables in our Application. We have since change the compatibility back to SQL 6.5 but the problems continue. (I do not know if this change...
I work for a company that runs 4 Databases on one SQL 7.0 server. We can not upgrade to SQL 2000 because on 2 of our applications, built in PowerBuilder, can not handle the upgrade and are in the process of being rebuild. The current problem we are having is in an attempt to get out Disaster...
I have been working more on this and had a Select Query woring and in attempting to modify it into a Insert Query I have run into a few new issues. This version does have the Where Clause updated.
With the following Script I get the error:
Server: Msg 107, Level 16, State 3, Line 2
The column...
I have been working on this problem my company has to move data from one database to another. I have a Query that I set up in Access to query out all of the data element and update another table. I grabbed the SQL script data and tried to fix it so I could run it in Query Analyzer.
Generally...
Zhavic, your wisdom is only exceeded by your generosity with it, or in other words that worked excellent. Now for the final follow up question for you or any of our other fine viewers.
Now that I have a Query that can update my table with the correct data that I need, is a scheduled nightly...
Thanks for that Help "Zhavic", the "+" replacing the "&" solved that error now I get the following error:
Server: Msg 553, Level 16, State 1, Line 1
UPDATE over nullable side of outer join query on table 'CaseManager'.
Just to try to give you as much information...
I am new to Tek-Tips and this has been a very useful site.
I am trying to update one table from 2 others Then once updated I planned to use BCP to export the table to a .CSV file.
2 Data Tables
-Agent
-County
1 Table to be updated
-CaseManager
This is the Syntax that I have been using...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.