Viewing 15 posts - 361 through 375 (of 1,156 total)
Do you only want to run the sp? If so just execute the sp in a tsql task.
Drag an execute tsql task to the pane. Open it and...
March 7, 2008 at 4:39 pm
You can name the constraints. You dont have to let them auto generate.
ALTER TABLE Morningstarcategory
ADD LastUpdated DateTime null
CONSTRAINT Morningstarcategory_LastUpdated_DF DEFAULT GETDATE()
March 7, 2008 at 4:04 pm
1. i write a script to make schema changes in a DB
2. i have to provide a rollback script that will remove those changes
Your rollback should undo everything your...
March 7, 2008 at 3:12 pm
Sure, you can use LEFT 10 to do that... but stop just for a minute... you've not tols us why you want to overwrite the ID with the Description. ...
March 7, 2008 at 3:04 pm
I can see you running into another problem with this update. What if a city and county have the same name and the name is greater than 10 characters. ...
March 7, 2008 at 3:02 pm
You can use whichever query you want but the end result is you want to use the left function to get the first 10 characters.
March 7, 2008 at 2:59 pm
UPDATE MYTABLE
SET TAX_GROUP_ID = LEFT(TAX_GROUP_DESC,10)
WHERE LEFT(TAX_GROUP_ID, 3) = 'VA-'
March 7, 2008 at 2:58 pm
Hold the phone... how do you know that the only things that start with VA are VA- as in Virginia... never do an update of this nature without first doing...
March 7, 2008 at 2:49 pm
Delete the column in SSMS. You can then generate the change to script for review. SSMS will include all the drops for all the constaints, keys etc..
To generate...
March 7, 2008 at 2:44 pm
This looks like a job for an update statement 🙂 I do not know how your data is stored but since you say begins with VA. I will grab...
March 7, 2008 at 2:29 pm
Views and inline functions cannot return xml columns that are typed with a schema collection registered in a database other than current. Column "LMPXML" is typed with the schema collection...
March 7, 2008 at 2:10 pm
The link he posted is the same as BOL. This is the remark he is concerned with
OPENQUERY does not accept variables for its arguments.
In SQL Server 2000 and later...
March 7, 2008 at 1:30 pm
You have to create you statement as a string and execute it via exec or sp_executesql. Look at my example above.
March 7, 2008 at 12:18 pm
You cant do that unless you use dynamic sql.
DECLARE @sql NVARCHAR(500)
SET @sql = N'
SET IDENTITY_INSERT '+ @TABLENAME + ' ON
INSERT INTO '+ @TABLENAME
EXECUTE sp_executesql @sql
March 7, 2008 at 11:50 am
You have to use dynamic sql:
Declare @filename varchar(125)
set @filename = 'C:\testdata.xml'
DECLARE @sql NVARCHAR(500)
SET @sql = N'
select Bulkcolumn
FROM OPENROWSET
(BULK ''' + @filename + ''', SINGLE_CLOB) ...
March 7, 2008 at 11:35 am
Viewing 15 posts - 361 through 375 (of 1,156 total)