Viewing 15 posts - 31 through 45 (of 137 total)
You do not need dynamic sql to do this. You can crate the table with a dummy name first, and use sp_rename to give it the name you want :
declare...
April 22, 2005 at 12:51 am
This is a new script. The first part ( up to the first go ) creates the stored procedure. This should only be executed once. The part after the go...
April 20, 2005 at 6:46 am
Yes you can, but you have to create a format file for the bcp. If you want to continue using SQL script, you can try following script ( it uses...
April 20, 2005 at 3:24 am
Hi,
For 1) and 2), you could use a script like below. For 3), you should give some more details about what you want exactly. You can put the below script...
April 20, 2005 at 1:00 am
I suppose you want load the file into a table. You can do this like this :
declare @file varchar(1024)
set @file = '''C:\abc2005_04_10.txt'''
exec ('bulk insert tempdb.dbo.test from ' + @file )
Or with...
April 14, 2005 at 12:40 am
You can use the DDL script generated by SQL Server Enterprise Manager as an example:
"Right click" a table, choose Design Table.
Make a minor modification to the table and click "Save...
April 12, 2005 at 12:56 am
The option -F2 starts the copy from the second row. Try using -F3.
You should also try to use BULK INSERT and not EXEC master..xp_cmdshell :
BULK INSERT myDB.dbo.myTable from 'D:\Temp\download.csv'
WITH (...
April 12, 2005 at 12:41 am
I tried you script, and the insert works fine.
Please verify if the option in QA ( Tools -> Options -> Results tab ) "Maximum characters per colomn" is set...
April 11, 2005 at 12:56 am
Int can hold up to 2147483647. Smallint is limited to 32767 .
From BOL:
bigint
Integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes.
int
Integer (whole...
April 8, 2005 at 7:47 am
I use gvim, as I am used to work on Unix system. gvim is free, and it prints in color ...
Bert
April 7, 2005 at 2:08 am
Did you verify the log and data size ? Maybe the log or data file is full, and they can not grow ( not automatically grow, Restricted file growth or disk...
April 7, 2005 at 2:01 am
It all depends on the type of union.
If it is a union ALL without an order by, the union will be faster, as the server will not need to use...
April 7, 2005 at 1:47 am
In the code I see
moDataConn.InitializeConnection()
This is probably where the connection will be made. But the connection is never been closed ?!
Before the return moDS, there should be a moDataConn.close()...
April 7, 2005 at 1:38 am
Here is an exampl eusing dynamic SQL:
You can use the proc like
exec dbo.spTestTable -- will use Price2 column
exec dbo.spTestTable 'Price3' -- will use Price3 column ...
create proc dbo.spTestTable
(
@PriceCol...
April 7, 2005 at 1:23 am
You can try the bcp utility to get the data out of SQL server.
Try this : ( the generated xml is not OK, as the AUTO statement does not generate...
April 6, 2005 at 1:11 am
Viewing 15 posts - 31 through 45 (of 137 total)