Skip to content
Advertisement

Tag: sql-server-2008

Creating text file without using bcp in sql

I have to query a table and print the output in a text file. I have a normal user login with dbo permission on the database. I cannot use bcp or cannot give any special permissions. Can anyone help me with this? Answer You can’t create a text file on the server or elsewhere with only permissions in the database.

Split time records across midnight

I’m trying to run some reports and having to deal with the whole issue of employee labor hours crossing midnight. It occurs to me though that I could split the records that cross midnight into two records as if the employee clocked out at midnight and simultaneously clocked back in at midnight thus avoiding the midnight problem altogether. So if

Changing the maximum length of a varchar column?

I’m trying to update the length of a varchar column from 255 characters to 500 without losing the contents. I’ve dropped and re-created tables before but I’ve never been exposed to the alter statement which is what I believe I need to use to do this. I found the documentation here: ALTER TABLE (Transfact-SQL) however I can’t make heads or

Advertisement