Viewing 15 posts - 4,831 through 4,845 (of 5,588 total)
Jeff Moden (1/29/2010)
I forgot about that and that's very true. Have you ever seen code that does that, though?
Another use is in auditing... if you want to audit what...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
February 1, 2010 at 1:21 pm
Charlottecb (1/30/2010)
Wayne, I've tried running your code but it doesn't seem to give the correct splits in values - It may be me doing something wrong though.
Charlotte,
It wasn't you... the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 31, 2010 at 7:48 pm
AVB (1/29/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 29, 2010 at 5:18 pm
Charlotte,
First, I want to thank you for providing DDL/DML to show what your working with.
Now, this just expands on what you've started.
--===== Split or "Normalize" the whole table at once
;WITH...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 29, 2010 at 5:00 pm
Steve Jones - Editor (1/29/2010)
Especially if there are edits to the PK, which can happen.
Ideal world: the columns that define a PK will NEVER, EVER be changed.
Real world: invariably, some...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 29, 2010 at 4:27 pm
Lynn Pettis (1/29/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 29, 2010 at 4:18 pm
san43 (1/29/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 29, 2010 at 11:58 am
stricknyn (1/29/2010)
I included the SELECT portion. The error I get is
Msg 102,...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 29, 2010 at 11:34 am
I haven't used OpenRowSet to open up a csv file before. You may need to use OpenDataSource instead.
In the meantime, here's the sp_OA method:
declare @FileName varchar(100)
set @FileName = '<Put your...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 28, 2010 at 8:12 pm
Bhavesh_Patel (1/27/2010)
Points for taking ... 😛
Makes up for yesterdays (though points were awarded anyway...)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 27, 2010 at 10:10 pm
tan110 (1/27/2010)
Thanks everyone, was able to get it working with set based statement. Had to loop through all the records.
Would you care to elaborate on how a set-based method is...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 27, 2010 at 10:03 pm
As others have already mentioned, sys.tables will show the time the structure of the table was last changed. And you will need a trigger to show when the data was...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 27, 2010 at 9:58 pm
The can think of of two ways:
select *
into #temp
from OpenRowSet(...)
where 1=2
select count(*)
from tempdb.sys.columns
where object_id = object_id('tempdb..#temp')
drop table #temp
and use sp_OA...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 27, 2010 at 9:38 pm
arctica82 (1/27/2010)
I am working with SQL SERVER 2000,Is it possible to Pass table variable or temp table as input parameter to stored procedure?
Not in SQL 2000.
Can I define a...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 27, 2010 at 9:30 pm
CirquedeSQLeil (1/27/2010)
Jeff Moden (1/27/2010)
Alvin Ramard (1/27/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 27, 2010 at 6:54 pm
Viewing 15 posts - 4,831 through 4,845 (of 5,588 total)