Viewing 15 posts - 10,681 through 10,695 (of 13,461 total)
heres a generic example; if you post your actual table definition, we could tailor the example to your actual table:
Create Trigger TableName_Update On TableName For Update As
Update Tb
...
August 4, 2009 at 10:48 am
i guess it depends on the program you are using; what happens if you find and replace NULL with a space or empty string in your result file prior to...
August 4, 2009 at 10:44 am
i would definitely do this using the SSMS GUI on a test database;
since it is a PK,the table will probably be dropped and recreated, and any indexes, foreign keys...
August 4, 2009 at 10:40 am
you did not paste your entire query, so you have to extrapolate:
take your entire query from your stored proc, not just the case statement, and wrap it in parenthsis.
give it...
August 4, 2009 at 9:15 am
the default trace would have any objects that were dropped/created/altered.
try this query:
select * from sys.trace_events
declare @tracefile varchar(256)
SELECT @tracefile=convert(varchar(256),value)
from(
SELECT *
FROM fn_trace_getinfo(default)) X
where property=2
print @tracefile
SELECT * from fn_trace_gettable(@tracefile, default)
select
...
August 4, 2009 at 8:36 am
the cursor i posted works, did you try that yet? just remove the oldtable/newtable replace function.
August 4, 2009 at 8:31 am
here's an example that Jack was referencing:
exec ServerName.master.dbo.sp_executesql N'Select SERVERPROPERTY(''MachineName'')'
--or if you are calling a function that exists on the server:
SELECT * FROM OPENQUERY(LINKEDSERVER1,'SELECT dbo.T_DATE(''D'')')
August 4, 2009 at 8:20 am
ironically, it's easy...you just wrap the whole thing to be a sub query:
SELECT ISNULL(CTTitle1,CTTitle) As TheTitle
From
(
SELECT
[CTTitle] =(SELECT TOP 1 TITLE FROM mms.dbo.vwcommitteetermmembers WHERE ID =
...
August 4, 2009 at 8:18 am
the REPLACE function is pretty straight forward;
here's an example:
with myAddresses As (
SELECT '164 N. Daves Street,Madisonville,FL 42431' AS ADDR1 UNION ALL
SELECT '1333 Weller Ave,Miami,FL 40208' AS ADDR1 UNION ALL
SELECT...
August 4, 2009 at 7:53 am
and here's how you'd use your function in an update statement:
UPDATE MyTable
Set MyColumn = dbo.InitCap(MyColumn)
August 4, 2009 at 7:40 am
Chandu's got you going in the right direction; If you downloaded SQL Express and installed it, you might not have SQL Server Management Studio. You'll want to download SQL Server...
August 4, 2009 at 7:36 am
your sql statement should not have GO statements, that's all.
this worked fine for me.
note that since i'm quoting the whole thing as a multiline statement, i didn't need the @newline...
August 3, 2009 at 8:20 pm
Lynn's point on security is a good one; I would think it might be possible with CLR, but I'm not sure; there are a lot of objects that you cannot...
August 3, 2009 at 8:11 pm
shouldn't that be DBCC SHRINKDATABASE(N'YourDataBaseName' ) instead of shrinkfile? I'm thinking that if you deleted a lot of data, the space is reserved in the MDF, and not in the...
August 3, 2009 at 12:32 pm
tough call; i'm guessing that you really need to join the the data you are testing to the same two tables Rate_table
and Rate_price_table;
with 6 conditions in the WHERE statement, I'd...
August 3, 2009 at 10:19 am
Viewing 15 posts - 10,681 through 10,695 (of 13,461 total)