Viewing 15 posts - 361 through 375 (of 485 total)
Well you learn somthing every day
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
October 23, 2002 at 7:31 am
You will need to use more variables and then executed the like this
EXECUTE (@data1 + @data2 + @data3 +....)
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
October 23, 2002 at 7:30 am
Try this
SELECT cast(OrderBand *10 as varchar(3)) + '-' + cast(OrderBand * 10 + 9 as varchar(3)) "No of Orders", countOfCustomers "No of Customers"
FROM (SELECT countOfOrders % 10 OrderBand,...
October 23, 2002 at 6:40 am
If you have a look at my post on the http://www.sqlservercentral.com/forum/topic.asp?TOPIC_ID=2568&FORUM_ID=76&CAT_ID=7&Topic_Title=When+to+Use+Dynamic+SQL&Forum_Title=Discuss+Content+Posted+by+Robert+Marda
to test what i say create a looping bit of code, using a nice query (a couple of joins), try...
October 23, 2002 at 6:32 am
Can we put a limit on paragraph size. My mind switches off after 4 lines (2 after friday lunchtime)
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
October 23, 2002 at 6:28 am
You can call dbcc inputbuffer to get what the calling code was, but not the current procedure name. In addition you cannot redirect dbcc commands to a table
Simon Sabin
Co-author of...
October 23, 2002 at 6:25 am
You actually need to use datalength which will give you the size in bytes of a column, you then need to add 1 bit if it is nullable and some...
October 23, 2002 at 5:45 am
There is a common belief, as you mention in your article, that dynamic sql does not have compile plans. This is not true.
Any adhoc query i.e not an SP, is...
October 23, 2002 at 5:27 am
Both these work because they convert the data to varchars rather than nvarchars. So if you are using unicode you will have a problem.
To get around it you have to...
October 23, 2002 at 4:42 am
Using bcp will produce csv files
bcp "select batnbr from xtemptable" queryout c:\test.txt -t, -c
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
October 23, 2002 at 4:27 am
You should pass in the operator and variable as 2 different parameters, this will allow the use of compile queries.
DECLARE @strSql VARCHAR(1000)
SET @strSql = "SELECT SUM( ... WHERE R2090_Product "...
October 23, 2002 at 4:21 am
If no record is returned from your select statement then the value in your variable will not be changed. To identify this situation check @@rowcount to see if it is...
October 23, 2002 at 4:18 am
Just a small note, that adding a username field and date field to each table can really affect your row sizes. and thus performance.
Simon Sabin
Co-author of SQL Server 2000 XML...
October 23, 2002 at 4:11 am
If you are using batchsize then the data will be commited after this number of rows so you could monitor the number of rows in the table, using sp_spaceused.
Simon Sabin
Co-author...
October 23, 2002 at 4:07 am
How are you backing up the transaction log?
Has it ever been small?
You can shrink the file, have a look at "shrinking transaction logs" in BOL to see a explanation of...
October 22, 2002 at 3:24 am
Viewing 15 posts - 361 through 375 (of 485 total)