April 27, 2012 at 4:33 am
HI
I want to script a table with data using query wise.
if its having any possible to script the table with data
using dbcc commands.....:-)
April 27, 2012 at 4:36 am
There are no DBCC commands to script tables out.
Scripting out data is fairly easy, just query the table and build insert statements. That said, if you're over a few MB, probably easier to bcp the data out.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 27, 2012 at 6:41 am
You can downoad and install ssms tools (www.ssmstoolspack.com).
It has a handy feature to help you script out data in a table as Insert Statements.
But, as mentioned, if you are dealing with large tables, bulk copying it out to a file will be faster and
more efficient.
April 27, 2012 at 6:57 am
April 27, 2012 at 9:07 am
Thanks friends
for ur
kind replay
April 27, 2012 at 9:12 am
hi friends
i have another one question
how to use " bcp in " command...
i want import data form a csv file
i used this cmd to import:
DECLARE @bcp_cmd VARCHAR(8000)
SET @bcp_cmd = 'bcp [DB_name].[dbo].[Table_name] in "d:\Test.CSV" -c -T -S ' + @@servername
EXEC @bcp_cmd
but its showing some error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.
how to solve this problem......:-)
April 27, 2012 at 9:38 am
Start by reading the Books Online entry for bcp... Take special note of what kind of command it is (ie where it runs)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 27, 2012 at 9:47 am
And while you are looking at BCP, you may also want to look at BULK INSERT.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply