Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Glyndwr

    Why # of Rows Not = # of Records???

    Henry, you say you are comparing number of rows with rowcount in the properties form of the table. The properties form uses the value found in the sysinexes table. this can NOT be guaranteed to be up to date. if you wish to use this value then you must ensure the sysindexes table is updated...
  2. Glyndwr

    Converting datetime from character string error

    Viruland, you need to enclose the date in quotes try the following changes 1) SET @Query = @Query + ' AND (GeplAfhDatum < ''' + GetDate() + '''))' 2) SET @Query = @Query + ' AND (GeplAfhDatum < ''' + DateAdd(&quot;d&quot;, 90, GetDate())+ '''))' Glyndwr
  3. Glyndwr

    instring changes in text field

    travis, I've just spotted this article, I have not tried it but it may be what you're looking for http://www.sqlmag.com/Forums/messageview.cfm?catid=8&threadid=8135 Glyndwr
  4. Glyndwr

    instring changes in text field

    travis, I have done a simple mod to the example in BOL (type text and image function into index tetxbox to find] this shows how to replace a textstrig with another string (oldserver to newserver) it only finds the first occurrence so will need to execute as many times as occurrences use...
  5. Glyndwr

    update all rows where id isin comma delimted string

    Tokhra, there is a freely available function called fn_split, I can't remember where i got it from - either Andrew Novick's site, sqlteam or microsoft.(shame on me) which really makes this stuff easy ( create function included drop table #t go create table #t(val1 int, val2 varchar(40))...
  6. Glyndwr

    What should I use a variable, cursor or something else ?

    rzirpol. I have obviously misunderstood your question, do you want the sequence number to be kept between connections? if so create a table with the batchno in and read this everytime you need to use it and increment when required. Glyndwr
  7. Glyndwr

    What should I use a variable, cursor or something else ?

    rzirpolo, try something like this exec sp_main 5,10 where: create proc sp_main @start int, @end int as begin declare @cnt int while @start <= @end begin exec sp_doBatch (@start) set @start = @start +1 end end create proc sp_doBatch @id in as begin -- your batch ops insert...
  8. Glyndwr

    Use of RAM by SQL Server

    Tessai2003 , you can, if you wish query the db using vbscipt, following example will show you , providing you have sufficient db privelegs, you can easily modify this to update values also Set cn = CreateObject (&quot;adodb.connection&quot;) Set rs = CreateObject...
  9. Glyndwr

    Arrays in T-SQL?

    Waynest, there aren't arrays as such but there are workarounds declare @myArray table (id int , myValue char(10)) declare @cnt int set @cnt = 0 while @cnt < 10 begin set @cnt = @cnt + 1 insert into @myArray values(@cnt, cast(@cnt as char(10))) end select * from @myArray Glyndwr
  10. Glyndwr

    pivot table, crosstab

    surfah, a bit kak handed but works drop table #tmpvndlst drop table #withList go declare @list varchar(8000) create table #tmpvndlst( vendid int identity(1,1), opseq char(10), vendor varchar(4)) create table #withlist(opseq char(10) , vendorList varchar(1000)) INSERT INTO #tmpvndlst...
  11. Glyndwr

    Blocking Table Access in SQL Server

    coolmoe, why not just add the user(s) to the db_denydatareader role ? Glyndwr
  12. Glyndwr

    Union problem

    Chikey, your sql statement including the union must be a single string declare @sql varchar(8000) set @sql = 'select a from tab1 UNION ALL select a from tabb' Glyndwr
  13. Glyndwr

    Passing a String Variable to SQL &quot;IN&quot; Statement

    ibethea try this declare @item int declare @text varchar(8000) declare @tab table (num int) set @text = '12, 23, 18, 34, 65, 70' set @item = 1 while @item <>0 begin set @item = charindex(',',@text) if @item <> 0 begin insert into @tab...
  14. Glyndwr

    Calling a query from another query using Query Analyzer

    supermama if you wish to execute sql batched in text files then I suggest you look at the osql or isql command line utilities.
  15. Glyndwr

    can i use distinct but still get all values?

    andycape try a group by clause create table #fruit ( fruit varchar(40), cost money ,tax money) go insert into #fruit values ('potatoes', 100,17.5) insert into #fruit values ('potatoes', 200,35) insert into #fruit values ('potatoes', 300,52.5) go select fruit, sum(cost + tax) 'Total Amount'...
  16. Glyndwr

    Can't connect to OLAP server 2000

    godzuki are you saying that you have applied sp3 to SQL and the problems have started, or that sql has been running ok with sp3? if the former you may want to check out the cross database chaining issues with sp3 , otherwise I'm not sure
  17. Glyndwr

    Checking what recovery model a DB has

    Robbomobb if you put the code in a stored proc the temp table will disappear, if you run it in QA then it will remain until you drop it
  18. Glyndwr

    Checking what recovery model a DB has

    Robbomobb I think this does what you want create table #dbRecoveryModel (dbname sysname , recoverymodel sql_variant) insert into #dbRecoveryModel exec sp_msforeachdb 'SELECT ''?'' , databasepropertyex(''?'', ''recovery'')' select * from #dbRecoveryModel
  19. Glyndwr

    File exist question

    Sivakumar is this more what you're looking for ? drop table #FileExistList drop table #tab_files go create table #tab_files (tabFile varchar(30)) insert into #tab_files(tabFile) values ('c:\autoexec.bat') insert into #tab_files(tabFile) values ('c:\config.sys') insert into...
  20. Glyndwr

    File exist question

    Sivakumar is this more what you're looking for ? it is a little more involved but gives you extra information. drop table #FileExistList drop table #tab_files go create table #tab_files (tabFile varchar(30)) insert into #tab_files(tabFile) values ('c:\autoexec.bat') insert into...

Part and Inventory Search

Back
Top